set solid body's sheetmetalrule to Follow Defaults.

set solid body's sheetmetalrule to Follow Defaults.

kesUPRHR
Contributor Contributor
294 Views
2 Replies
Message 1 of 3

set solid body's sheetmetalrule to Follow Defaults.

kesUPRHR
Contributor
Contributor

hey.

i am in the making an addin for inventor 2026, and i got most things to work but the last thing i need is: after changing sheetmetal rules and if a part only has one solid body. then it should tick the "Follow Defaults".

i have tried using "UseDefaultSheetMetalRule" but that is not catching all cases. 

kesUPRHR_0-1749505071726.png

 

i am thinking that Commandmanager might do the trick but i don't know how to make it open the "Set Sheet Metal Rule" nor how to make it do the check mark.

 

anybody who knows how to make it work or another method?

 

thanks in advance

0 Likes
295 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Hi @kesUPRHR.  I am still using 2024.3.5, so can not test my theories, but after looking within the 2026 Inventor API online help, the properties & methods below are pretty much all I was able to find:

SheetMetalComponentDefinition.GetBodySheetMetalStyle 

SheetMetalComponentDefinition.SetBodySheetMetalStyle 

SheetMetalComponentDefinition.SetBodySheetMetalStyle2 

SheetMetalComponentDefinition.ActiveSheetMetalStyle 

SheetMetalComponentDefinition.UseSheetMetalStyleMaterial 

SheetMetalComponentDefinition.UseSheetMetalStyleThickness 

SheetMetalComponentDefinition.UseSheetMetalStyleUnfoldMethod 

I'm thinking that maybe if setting those 3 properties to True does not work, then maybe try iterating through the bodies, maybe using the GetBodySheetMetalStyle method, to see if it is different than the 'active' one, , then if it is, using the SetBodySheetMetalStyle2 method to set it to the 'active' one.  Not sure if that 'set' method would let us set 'Nothing' as the body's sheet metal style, but that came to mind also, as a way to 'reset' it to 'default'.  Haven't tested that theory yet though.  Just throwing ideas out there.  There does not appear to be a property or method for the individual SurfaceBody objects that would help...unless it is 'hidden'.  I am not sure how we could check that box in the pop-up, contextual dialog though.  I did dabble with 'SendKeys.SendWait() method a bit in the past for navigating & interacting with Inventor dialogs that we have no access to, but that is a relatively dangerous way to do something like that, because we seem to have very little control over where those keystrokes get sent, so they could effect something other than what we intended, and have unexpected results.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

kesUPRHR
Contributor
Contributor

Hi @WCrihfield.

thanks for the reply

i have tried the things you have mentioned and while it didn't work, i got some other things out of the testing

1: the problem "Follow defaults" check seems to be a primary problem on parts with more than one solid. so it is not as severe as i thought.

2: i can't remember if my code had a problem with single body parts, but if it was a problem it is now gone.

3: i found a workaround for when it is a problem. the workaround is to create an empty face feature and attach the main body you want to control to it and then use the "UseDefaultSheetMetalRule" on the face feature to control the main body's property

 

kesUPRHR_0-1749581401510.png

 

 

this could be used to make sure that the body has the right property every time i make changes through my addin.

 

this should be good enough to fix my problem. and again thank you @WCrihfield for the reply