Default SheetMetal rules on body

Default SheetMetal rules on body

patrice.vallet
Contributor Contributor
1,005 Views
6 Replies
Message 1 of 7

Default SheetMetal rules on body

patrice.vallet
Contributor
Contributor

Hello,

 

I need your help.

 

I have a sheet metal part where I derive a body from another part and customize it.

My problem is when I update the part there is an error on my flatpattern, and in the sheetmetal rules on the body, the option "follow the default values" is untick.

 

Capture d’écran 2021-04-02 100247.png

 

I have to tick manually this option to fix my problem, but I need to automatize it with Ilogic.

I know how to change the sheetmetal rule on a body by Ilogic, but not tick this option.

 

Can you help me to write this Ilogic code ?

 

Thanks you

0 Likes
Accepted solutions (1)
1,006 Views
6 Replies
Replies (6)
Message 2 of 7

Ralf_Krieg
Advisor
Advisor

Hello

 

Can you please tell which version of Inventor you use?


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 7

patrice.vallet
Contributor
Contributor

I'm using Inventor 2019.4.1

0 Likes
Message 4 of 7

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

I was a little bit confused about the dialog. I couldn't find it. After some digging around I found it.

Can you try following:

Dim oApp As Inventor.Application= ThisApplication
Dim oPartDoc As PartDocument = oApp.ActiveDocument
Dim oCompDef As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition
Dim oFeatures As SheetMetalFeatures = oCompDef.Features

Dim oFaceFeature As FaceFeature
For Each oFaceFeature In oFeatures.FaceFeatures
    If oFaceFeature.Definition.UseDefaultSheetMetalRule = False Then oFaceFeature.Definition.UseDefaultSheetMetalRule = True
Next

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 5 of 7

patrice.vallet
Contributor
Contributor

Hello Krieg,

 

Your solution works great. It will help me a lot.

 

Thanks you

0 Likes
Message 6 of 7

b.mccarthy
Collaborator
Collaborator

@Ralf_Krieg

 

Hello.

 

I have a similar problem with random parts where this setting gets unchecked. This code works great on standard folded sheet. However, in those cases where a sheet is derived (to create a left and right version) and the setting gets turned off, the rule will throw this error:

 

2023-05-31 692.jpg

 

Line 10:

2023-05-31 693.jpg

 

When this happens, I must manually reset it.

 

Any idea why this occurs, and how to repair it?

 

Thank you.

0 Likes
Message 7 of 7

Maxim-CADman77
Advisor
Advisor

The code discussed is not applicable to those SheetMetal parts done with Derived Part because they don't have FaceFeatures (or any of the three types of SheetMetal Features that do have 'UseDefaultSheetMetalRule' property).

 

The best I can think of is to select the body and use CommandManager to open the Form shown in the start message of the topic where user is supposed to enable the "Follow Defaults" option and close the form with 'OK' button which is non-professional.

 

But maybe @johnsonshiue or @MjDeck can suggest the better way?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes