xarial / codestack

Library of SOLIDWORKS API, SOLIDWORKS PDM API, VBA and Desktop code examples, applications macros and tutorials.
https://www.codestack.net
MIT License
186 stars 69 forks source link

How to select edge of part in particular drawing view to attach balloon's leader to it using SolidWorks API? #21

Open RashishManvar opened 3 years ago

RashishManvar commented 3 years ago

Using SolidWorks API in drawing sheet, How can I automate balloons at exact location and attach arrow(Balloon leaders) to the defined an edge(silhouette, face, or vertex) of part in the particular view(Section view and details view of section view)?

Please find the attachment for review the code and test it with Assy.SLDDRW.

Assy.zip

artem1t commented 3 years ago

Hi Rashish,

Thank you for the ticket and the sample model. Please take a look at this macro: Insert BOM Balloons. It demonstrates how to add all balloons one-by-one (not an auto balloons) to the first drawing view and attach the leader to the center of the corresponding edge and also align the balloon itself by offsetting by 10 mm in X and Y.

The above example adds the balloon to the first edge found. Here is another example which can be useful which demonstrates how to find and select the specific edge: Find and select specific edge in the drawing view