Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python Script - Get Sheet Metal Thickness

1 REPLY 1
Reply
Message 1 of 2
isocam
121 Views, 1 Reply

Python Script - Get Sheet Metal Thickness

Can anybody help?

 

I have seen a lot of posts regarding the lack of support for sheet metal API.

 

Is it now supported?

 

I need to be able to get the sheet metal thickness, using a Python script and display the thickness, for testing purposes, in a messagebox.

 

Many thanks in advance!

 

Darren

1 REPLY 1
Message 2 of 2
john.kirchner
in reply to: isocam

There are some basic Sheet Metal and Flat Pattern features now available through the API, added last year.

Thickness can be grabbed from the SheetMetalRule object. Thickness returns a SheetMetalRuleValue which you would use .expression or .value depending on what you want to display.

The quickest way to grab a SheetMetalRule is through Component.activeSheetMetalRule

So for an easy example of a file using sheet metal in the root component:

 

 

app = adsk.core.Application.get()
des = app.activeProduct
root = des.rootComponent
smr = root.activeSheetMetalRule
smr.thickness.expression # e.g. "2.50 mm"

 

 

 
And you can use that expression in a message box.



Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report