How to retrieve Balloons position in draft sheet

Creator
Creator

I'd like to iterate over the existing balloons of a draft sheet and retrieve the X and Y positions of the balloons center (relative to the draft sheet). Which method should I use?

 

Thanks!

3 REPLIES

Re: How to retrieve Balloons position in draft sheet

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

You should try something like this :

 

 

                            For Each ObjBalloon In ObjdraftSheet.Balloons
                                If ObjBalloon.Callout = 0 Then
                                    Dim vX, vY, vZ As Double
                                    BalloonElem.Name = ObjBalloon.Name
                                    BalloonElem.UpperText = ObjBalloon.BalloonText
                                    BalloonElem.LowerText = ObjBalloon.BalloonTextLower
                                    BalloonElem.PrefixText = ObjBalloon.BalloonTextPrefix
                                    BalloonElem.SuffixText = ObjBalloon.BalloonTextSuffix
                                    BalloonElem.Type = ObjBalloon.BalloonType
                                    BalloonElem.Sides = ObjBalloon.BalloonSides
                                    BalloonElem.Size = ObjBalloon.TextScale
                                    BalloonElem.BOMLink = ObjBalloon.LinkToPartsList
                                    Try
                                        ObjBalloon.GetVertex(1, vX, vY, vZ)
                                        BalloonElem.X_AbsCoord = vX
                                        BalloonElem.Y_AbsCoord = vY

                                        ObjBalloon.GetTerminator(objTerminator, x, y, z, keypoint)
                                        BalloonElem.X_OrigCoord = x
                                        BalloonElem.Y_OrigCoord = y
                                        BalloonElem.X_RelCoord = vX - x
                                        BalloonElem.Y_RelCoord = vY - y
                                        ObjModelMember = objTerminator.object.Modelmember.immediateparent
                                        BalloonElem.FileName = ObjModelMember.ModelNode.FileName

                                        PathOcc = ObjModelMember.ComponentName
                                        Do While Not (ObjModelMember.ImmediateParent Is Nothing)
                                            ObjModelMember = ObjModelMember.ImmediateParent
                                            PathOcc = ObjModelMember.ComponentName & SepOcc & PathOcc
                                        Loop
                                        BalloonElem.Occurrence = PathOcc
                                        BalloonElem.CutLength = objTerminator.object.Modelmember.ImmediateParent.ModelNode.CutLength
                                        BalloonElem.ViewName = objTerminator.ImmediateParent.CaptionDefinitionTextPrimary

                                    Catch ex As Exception
                                        BalloonElem.FileName = ""
                                        BalloonElem.Occurrence = ""
                                        BalloonElem.CutLength = Nothing
                                        BalloonElem.ViewName = ""
                                    End Try
                                    BalloonElem.SheetName = ObjdraftSheet.Name
                                    BalloonElem.Layer = ObjBalloon.Layer
                                    BalloonCollection.Add(BalloonElem)
                                End If
                            Next

 


Romuald BERTIN

Re: How to retrieve Balloons position in draft sheet

Creator
Creator

Thanks a lot rbertin!

Re: How to retrieve Balloons position in draft sheet

Pioneer
Pioneer

Hi all,

 

Which method should I use to get position of baloon like on a picture ? thanks

 

BALOON.png