Change sheet metal rule in sheet metal defaults using API

Change sheet metal rule in sheet metal defaults using API

nishantkumat5921
Enthusiast Enthusiast
1,078 Views
3 Replies
Message 1 of 4

Change sheet metal rule in sheet metal defaults using API

nishantkumat5921
Enthusiast
Enthusiast

Hello,

 

I am trying to change the sheet metal rules mentioned in sheet metal defaults but could find any API codes in the forums so reaching out for help. For example I want to change it from "14 GUAGE C.R.S" to "14 GUAGE 304S.S ". I do not want help in illogic's but need help in API.

 

Thanks in advance. Attaching a image below for clarification on what ISheet_Metal.PNG want to change.

0 Likes
Accepted solutions (2)
1,079 Views
3 Replies
Replies (3)
Message 2 of 4

bradeneuropeArthur
Mentor
Mentor
Accepted solution
Dim a As Inventor.PartDocument = ThisDoc.ModelDocument

Dim c As Inventor.SheetMetalComponentDefinition = a.ComponentDefinition


c.SheetMetalStyles.Item("14 GUAGE 304S.S").Activate

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 3 of 4

FINET_Laurent
Advisor
Advisor
Accepted solution

Hi,

 

You can use :

Dim oSheetMetal As SheetMetalComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
oSheetMetal.SheetMetalStyles.Item("Par Défaut").Activate

 

In your case :

Dim oSheetMetal As SheetMetalComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
oSheetMetal.SheetMetalStyles.Item("14 GUAGE 304S.S").Activate

 

Regards,

 

FINET L.

If this post solved your question, please kindly mark it as "Solution"

If this post helped out in any way to solve your question, please drop a "Like"

@LinkedIn     @JohnCockerill

Message 4 of 4

nishantkumat5921
Enthusiast
Enthusiast

Thanks @bradeneuropeArthur for the quick reply and found the solution.