Variable Recovery: Number of Bodies?

to recover the number of bodies

After an FCT body repetition in an area

c.f. . PNG Joint

Regards


ncv_01_capture.png

via a mechanically welded workpiece table?

1 Like

Hello

 

The only place where it gives the volume number is in " performance evaluation" in the Evaluate tab or in the tools/evaluate menu.

But no idea how to recover this value for a MEP for example

1 Like

By macro:

Sub main()  
    Dim swApp As SldWorks.SldWorks  
    Dim swModel As SldWorks.ModelDoc2  
    Dim swPart As SldWorks.PartDoc  
    Dim vBodies As Variant  
    Set swApp = Application.SldWorks  
    Set swModel = swApp.ActiveDoc  
      
    Set swPart = swModel  
    vBodies = swPart.GetBodies2(swSolidBody, False)  
    Debug.Print UBound(vBodies) + 1  
End Sub

Add a control to make sure that the current file is a part.

6 Likes

 

I'm going to track the mechanically welded table track.... it works (nre body on nomenclature ok)

on the other hand via macro

the vBodies variable I get it or ?

Thank you

Jd

 

Hello

You can use the variable to create a note for example, you can also create a custom property by code in your part / assembly / MEP.