Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SHEET METAL RULE iLogic

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
phillip.shields
2284 Views, 7 Replies

SHEET METAL RULE iLogic

Hello,

 

I am trying to use my sheet metal rules to drive my part numbers and titles in iproperties. I am using inventor 2012. please look at my code and see if I am missing anything. This code has worked in the past but since the Inventor Service Pack 3 installed SOME of our code has stopped working, specifically gaskets.

 

capture-20130501-120623.png

7 REPLIES 7
Message 2 of 8
mrattray
in reply to: phillip.shields

Where does "currentStyle" come from? If what you're showing is all of the code you have, then currentStyle will always equal nothing, as it's not recieving a value. Is it supposed to be a parameter? If so, then I can see by it's color that it's no longer in the file. (parameters are blue)

Mike (not Matt) Rattray

Message 3 of 8
cwhetten
in reply to: phillip.shields

Hi and welcome to the forum!

 

Can you post a part that uses this rule?  Just from the code you posted, it's impossible to tell what might be wrong.  There is nothing wrong with the code itself, except it is unclear what your intent is with the variable called currentStyle.  Is this a parameter, or a variable from somewhere else in the code?

 

I set up a part with a text user parameter called currentStyle, and set the value to be "GASKET 1 1/2", and this code works without errors.  So there is something else going on outside of the code that is causing errors.

 

Cameron Whetten
Inventor 2012

Message 4 of 8
phillip.shields
in reply to: cwhetten

SCREEN.png

 

 

"currentStyle" should be retrieving "GASKET 1 1/2" from the "sheet metal rule". At least this is what I thought was happening. I basically would like my code to look at the style under the "Sheet Metal Rule" box and fill my part number and title accordingly in the iproperties. Please let me know if the image is too small to see I can't tell from here.
Message 5 of 8
phillip.shields
in reply to: mrattray

Thanks for the quick reply. No, it is not a parameter. It is a style that I custom created. I thought "currentStyle" would retrieve any style from the "Sheet Metal Rule" dialog.

 

a.png

Message 6 of 8
mrattray
in reply to: phillip.shields

You're missing this line at the begining of your rule:

 

currentStyle = SheetMetal.GetActiveStyle()

 

 

Mike (not Matt) Rattray

Message 7 of 8
phillip.shields
in reply to: mrattray

THAT DID IT. THANK YOU VERY MUCH FOR THE HELP.

Message 8 of 8

Hello,  I need to pull out the sheet metal unfold rule being used in the current part file. Do you know if this is possible?

 

Bob

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

Post to forums  

Autodesk Design & Make Report