Inventor General

Reply
Active Contributor
Posts: 32
Registered: ‎05-01-2013
Message 1 of 7 (451 Views)
Accepted Solution

SHEET METAL RULE iLogic

451 Views, 6 Replies
05-01-2013 10:13 AM

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

*Expert Elite*
mrattray
Posts: 2,240
Registered: ‎09-13-2011
Message 2 of 7 (443 Views)

Re: SHEET METAL RULE iLogic

05-01-2013 10:23 AM in reply to: atotiace

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

*Expert Elite*
Posts: 1,021
Registered: ‎09-03-2008
Message 3 of 7 (440 Views)

Re: SHEET METAL RULE iLogic

05-01-2013 10:26 AM in reply to: atotiace

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

Active Contributor
Posts: 32
Registered: ‎05-01-2013
Message 4 of 7 (433 Views)

Re: SHEET METAL RULE iLogic

05-01-2013 10:39 AM 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.
Active Contributor
Posts: 32
Registered: ‎05-01-2013
Message 5 of 7 (430 Views)

Re: SHEET METAL RULE iLogic

05-01-2013 10:44 AM 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

*Expert Elite*
mrattray
Posts: 2,240
Registered: ‎09-13-2011
Message 6 of 7 (426 Views)

Re: SHEET METAL RULE iLogic

05-01-2013 10:48 AM in reply to: atotiace

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

 

currentStyle = SheetMetal.GetActiveStyle()

 

 

Mike (not Matt) Rattray

Active Contributor
Posts: 32
Registered: ‎05-01-2013
Message 7 of 7 (419 Views)

Re: SHEET METAL RULE iLogic

05-01-2013 10:58 AM in reply to: mrattray

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube