Creating a button add Balloon to pre-saved Style via MACRO

Hello

We now use a method to attach notes to certain components on drawings.
The values of these notes are linked to an already existing personal property on the components (Part/Assembly).
Today I use the " Bubble" command, then I have to load an existing style (always the same) by selecting it via the explorer, and clicking on the chosen component in the drawing.

1st problem: when the style is not loaded, at the 1st insertion of this bubble, you have to do a lot of manipulation for a single note.

2nd problem: when I clicked on the component to create the note, I have to position this note. At this point the command remains active, but the problem is that it doesn't remember the style. I need to cancel the command, then reselect the bubble command, select the style now present in the drop-down list, and clicked on my component, etc

I don't find it very simple to use.

I would like to have a special button for this type of note, pre-configured, and to be able to apply this note to several components successively.

Thank you for your help.

In general, you just have to redo the layout and background plan templates with the requested bubble style so that you don't have to set it up each time.
Document templates are in the location shown in the tool option file location and document templates and also basemaps.
image

You open each format, change your balloon style, and overwrite it (after a backup backup)
In addition, it is also possible to create favorites of a bubble style

Hello, just create a note with the properties you need + wrap + arrow if needed. Save it as an annotation that will fetch the value of the part property of the selected drawing. This annotation will have the extension .sldnotestl.
Example: annotation that fetches the name of the file, but all the properties are available. Any type of annotation of this kind can be created
image

2 Likes

Le_Bidule,
Indeed it looks like what I already have, except that my template file has a .sldballoonestl extension.

My problem as I described it is that I have to reload the style every time by going to get my model file hard the explorer on the one hand. And then I had to reselect my style from the drop-down list for each balloon that I want to add.

Sbadenis, I don't want to change my default bubble style, because I use the bubble command most often with the BOM.

I want to have access to a simplified bubble control with specific parameters.

Thank you

Hello;
Why not save your .sldballoonestl directly in your document templates *... DRWDOT?
You could find it directly in the drop-down menu, for any new drawings.

And to avoid having to "

re select my style from the drop-down list for each balloon I want to add."

Copy/paste an existing bubble and only move its attachment...

or use the " Reproduce format " command:

image

2 Likes

Maclane, I understand your approach, but will it be possible not to go through the slightest drop-down menu, but just to be able to directly position my annotation, like a bubble, or a dimension, and to be able to do it simultaneously several times?

Un bouton Macro ferait-il l’affaire ?
https://help.solidworks.com/2019/english/api/sldworksapi/Add_Autoballoon_to_Face_Example_VB.htm
ou

2 Likes

Yes Maclane, that's what I wish I could have.

The examples you attached to your answer are interesting.
The first seems to automatically add bubbles to a MEP with an associated BOM. That's not what I'm looking for.

On the other hand, the 2nd example is very interesting, now I have to find a way to set it up to my liking!!

To change the values of the balloon text:
https://help.solidworks.com/2018/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.inote~setbomballoontext.html

https://help.solidworks.com/2018/english/api/sldworksapi/Set_BOM_Balloon_Example_VB.htm

and for the style:
https://help.solidworks.com/2022/english/api/sldworksapi/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IModelDoc2~InsertNewNote3.html?verRedirect=1

https://help.solidworks.com/2022/english/api/swconst/SOLIDWORKS.Interop.swconst~SOLIDWORKS.Interop.swconst.swBalloonStyle_e.html

2 Likes

And how can I recover my custom property, attached to the component?

https://help.solidworks.com/2022/english/api/swconst/SOLIDWORKS.Interop.swconst~SOLIDWORKS.Interop.swconst.swBalloonTextContent_e.html?verRedirect=1

and/or

https://help.solidworks.com/2022/english/api/swconst/SolidWorks.Interop.swconst~SolidWorks.Interop.swconst.swDetailingNoteTextContent_e.html

1 Like

Thank you Maclane, I'll dig a little deeper into the subject, and give you feedback when I manage to make it work.

In any case, thank you for these ideas.