Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawing Balloons 1

Status
Not open for further replies.

LucasC

Automotive
Feb 18, 2019
157
I cant find any information or mention of the balloon command in the drafting workbench documentation.

For the search I'm using:

Set Selection1 = DrawingDocument1.Selection
Selection1.Search "CATDrwSearch.DrwBalloon,all"

works fine for my purposes.


The part I need help with is how to remove the leader from them. The documentation gives the example below but it doesn't work as shown or if I alter it to include my initial search. Are the balloon leaders a different method? Any ideas on how to accomplish this?

"Removes a drawing leader from the DrawingLeaders collection."
Dim MyView As DrawingView
Set MyView = MySheet.Views.ActiveView
MyView.DrawingLeaders.Remove(3)


 
Replies continue below

Recommended for you

Could still use some help on this, any new ideas?

The search works fine, I simply want to remove the leaders from drawing balloons. I tried to use removepoint but that didn't seem to work either.

Code:
Dim DrawingDocument1 As Document
Set DrawingDocument1 = CATIA.ActiveDocument

Dim Selection1 As Selection
Set Selection1 = DrawingDocument1.Selection
Selection1.Search "CATDrwSearch.DrwBalloon,all"

Dim LeaderCollection As DrawingLeaders
 Set LeaderCollection = Selection1.leaders


leadercollection.remove(1)
 
Hi Lucas,
I also have errors by using the remove methode but sometimes the leaders are removed, that why I add "On Error resume Next" to trap this errors.
Try this code:

Code:
Sub CATMain()


Dim DrawingDocument1 As Document
Set DrawingDocument1 = CATIA.ActiveDocument

Dim Selection1 As Selection
Set Selection1 = DrawingDocument1.Selection
Selection1.Search "CATDrwSearch.DrwBalloon,all"
For i = 1 To Selection1.Count
    Set selectedBalloon = Selection1.Item(i).Value
    Set myleaders = selectedBalloon.Leaders
    On Error Resume Next
    myleaders.Remove (1)
    'MsgBox Err.Number
Next i
On Error GoTo 0
End Sub

Regards
Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor