Imports System.Runtime.InteropServices
Public Class AddBalloonCallOutLeader
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim objApplication As SolidEdgeFramework.Application = Nothing
Dim objDraftDocument As SolidEdgeDraft.DraftDocument = Nothing
Dim objSheet As SolidEdgeDraft.Sheet = Nothing
Dim objBalloons As SolidEdgeFrameworkSupport.Balloons = Nothing
Dim objBall As SolidEdgeFrameworkSupport.Balloon = Nothing
Try
objApplication = GetObject(, "SolidEdge.Application")
objApplication.Visible = True
objDraftDocument = objApplication.ActiveDocument
objSheet = objDraftDocument.ActiveSheet
objBalloons = objSheet.Balloons
'Following Code will add Balloon in the sheet
objBall = objBalloons.Add(0.05, 0.05, 0)
objBall.TextScale = 1.0
objBall.BalloonText = "B"
objBall.Leader = True
objBall.BreakLine = True
objBall.BalloonSize = 3
objBall.SetTerminator(objBall, 0, 0, 0, False)
objBall.BalloonType = SolidEdgeFrameworkSupport.DimBalloonTypeConstants.igDimBalloonCircle
objBall.Style.TerminatorType = SolidEdgeFrameworkSupport.DimTermTypeConstants.igDimStyleTermFilled 'Change Terminator Type if reqd
'Following Code will add Callout in the sheet
objBall = objBalloons.Add(0.1, 0.1, 0)
objBall.Callout = True
objBall.TextScale = 1.0
objBall.BalloonText = "This is a Callout"
objBall.Leader = True
objBall.BreakLine = True
objBall.BalloonSize = 3
objBall.SetTerminator(objBall, 0, 0, 0, False)
objBall.BalloonType = SolidEdgeFrameworkSupport.DimBalloonTypeConstants.igDimBalloonCircle
objBall.Style.TerminatorType = SolidEdgeFrameworkSupport.DimTermTypeConstants.igDimStyleTermFilled 'Change Terminator Type if reqd
Marshal.ReleaseComObject(objBall) : objBall = Nothing
Marshal.ReleaseComObject(objSheet) : objSheet = Nothing
Marshal.ReleaseComObject(objDraftDocument) : objDraftDocument = Nothing
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
End Sub
End Class