I’ve been looking around for a macro that changes a selected balloon with a lead to “No Lead”. But can not find any.
Does anyone have such a macro?
W2022 SP5
Thanks.
I’ve been looking around for a macro that changes a selected balloon with a lead to “No Lead”. But can not find any.
Does anyone have such a macro?
W2022 SP5
Thanks.
Try the codes from this post How To Change Arrow Style On Balloons
Having trouble getting your balloons to go over?
Thanks @gupta9665
With a little googling and some modification to the macro in the page you suggested, the following macro does the job.
But it loops and hides all leaders of balloons attached to all views.
Is it possible to change it somehow that only the balloons attached to a selected view are changed?
Thanks again.
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Sub main()
Dim swView As SldWorks.View
Dim vAnnots As Variant
Dim i As Integer
Dim swAnn As SldWorks.Annotation
Dim swNote As SldWorks.Note
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
Set swView = swDraw.GetFirstView
While Not swView Is Nothing
vAnnots = swView.GetAnnotations
If Not IsEmpty(vAnnots) Then
For i = 0 To UBound(vAnnots)
Set swAnn = vAnnots(i)
If swAnn.GetType = swAnnotationType_e.swNote Then
Set swNote = swAnn.GetSpecificAnnotation
If swNote.IsBomBalloon() Then
swAnn.SetLeader3 swLeaderStyle_e.swNO_LEADER, swLeaderSide_e.swLS_SMART, False, False, False, False
End If
End If
Next
End If
Set swView = swView.GetNextView
Wend
swDraw.GraphicsRedraw2
End Sub
@josh thanks for stepping in.
I’m not too good in English and I’m not sure if I understand your question.
Let me explain my case:
I mostly do Sheet Metals. Because of a lot of problems, I don’t use multi body parts. I start with an empty assembly, and add virtual parts which would be welded or spot welded together.
We have one drawing for each virtual part. At the top left, we add a balloon that shows the item number of the part in BOM, along with the count and a memo for the size of part’s flat pattern. Each time I add a balloon, I have to open it’s property sheet, scroll down and click More More Properties button, and in the new property sheet select No Leader from the list.
I was just trying to do the same with a macro.
You can save a style in the drawing, and then when adding balloons, you can select that style to get the desired balloons.
Here are the updated codes
Dim swApp As SldWorks.SldWorks
Dim swDraw As SldWorks.DrawingDoc
Dim swSelMgr As SldWorks.SelectionMgr
Dim i As Integer
Dim swAnn As SldWorks.Annotation
Dim swNote As SldWorks.Note
Dim nSelCount As Long
Sub Main()
Set swApp = Application.SldWorks
Set swDraw = swApp.ActiveDoc
Set swSelMgr = swDraw.SelectionManager
nSelCount = swSelMgr.GetSelectedObjectCount2(-1)
If nSelCount = 0 Then Exit Sub
For i = 0 To nSelCount - 1
Set swNote = swSelMgr.GetSelectedObject6(i + 1, -1)
If swNote.IsBomBalloon() Then
Set swAnn = swNote.GetAnnotation
swAnn.SetLeader3 swLeaderStyle_e.swNO_LEADER, swLeaderSide_e.swLS_SMART, False, False, False, False
End If
Next
swDraw.GraphicsRedraw2
End Sub
Million thanks
@Tera sorry… It’s a little bit of a pun in English.
There’s an idiom “going over like a lead balloon”, as in Pb, the metal. It means something like that an idea/concept/situation is not well accepted. That meaning is not so important for the pun.
The main thing is that both “lead” and “lead” are spelled the same.
Just some extra info, in English we refer to the arrow attached to the balloon as a “leader” rather than a “lead”. Of course, your English is much better than my [everything except English], so I probably have no business giving you tips.
@josh I had to back to the top of the thread & reread the first couple of post to get what you were referring to! Now I can’t stop Thinking about Tera trying to the “lead” out of his balloons so they “go over”!
And I’ll agree to this statement!
I had to go back to my first post above to understand what you guys are talking about. That “lead” was a mistype and I don’t know why I missed “er” at the end. And interestingly, not only in the title, but in the main post too.
Well, at least it ended to learn something new in English. @josh Good for me that I learnt what “going over like a lead balloon” means.