How to add balloon on drawingview

hi

i want to add a balloon on a drawingview by the  "AddByTerminator" method but my code don't work

I took the code given in the example of the SDK and i modify it

 

Dim objApp As SolidEdgeFramework.Application

Dim objDoc As SolidEdgeDraft.DraftDocument

Dim objSheet As SolidEdgeDraft.Sheet

Dim objCircle As SolidEdgeFrameworkSupport.Circle2d

Dim objBalloons As SolidEdgeFrameworkSupport.Balloons

Dim objLine As SolidEdgeDraft.DVLine2d

 

' Report errors

Const PI = 3.14159265358979

' Create/get the application with specific settings

On Error Resume Next

Set objApp = GetObject(, "SolidEdge.Application")

If Err Then Err.Clear 

   Set objApp = CreateObject("SolidEdge.Application") 

   Set objDoc = objApp.Documents.Add("SolidEdge.DraftDocument") 

   objApp.Visible = True

Else 

   Set objDoc = objApp.ActiveDocument

End If

' getting the Active Sheet object

Set objSheet = objDoc.ActiveSheet

' getting the Balloons collection object on the active sheet

Set objBalloons = objSheet.Balloons

 

Set Drawing = objDoc.Sheets.Item(1).DrawingViews.item(1)

Set objLine = Drawing.DVLines2d.Item(1)

 

' adding two balloons on the active sheet

Set objBalloon = objBalloons.AddByTerminator(TerminatorObject:=objLine, X1:=0.75, Y1:=0.05, z1:=0, keyPoint1:=True)

 

' USER DISPLAY

' Release objects

Set objApp = Nothing

Set objDoc = Nothing

Set objSheet = Nothing

Set objCircle = Nothing

Set objBalloons = Nothing

 

Posted by: BONNAUDET eric
Post date: 6/29/2011 11:53:40 PM

1 REPLY

RE: How to add balloon on drawingview

I have find the solution

 

the good code is :

 

Set objBalloon = objBalloons.AddByTerminator(TerminatorObject:=objLine.Reference , X1:=0.75, Y1:=0.05, z1:=0, keyPoint1:=True)

 

 

 

Posted by: BONNAUDET eric
Post date: 6/30/2011 4:00:01 AM