iLogic - Model States and Parameters

iLogic - Model States and Parameters

bmcwilliam
Enthusiast Enthusiast
224 Views
1 Reply
Message 1 of 2

iLogic - Model States and Parameters

bmcwilliam
Enthusiast
Enthusiast

Hi, my knowledge of iLogic is fairly basic so apologies if this is a simple question, but I have not been able to find an answer so far.

 

I have a model with two model states, essentially a pressed part that I have created a model state to allow for "Green", aka. extra material to allow the pressing process to occur.

 

This allows a DXF and flat pattern of the full part to be generated and placed on the drawing. 

 

In our BOM we also have a plate area parameter that is calculated for material allowances and quoting etc.

 

We have an iLogic rule that calculates the plate area based on 

SheetMetal.FlatExtentsArea

 I can see in the model states Excel spreadsheet that it does capture a different value for this parameter for each model state - but how can I access these different parameters in my iLogic rule so that the Area calculation can be performed using the correct value? At the moment it just calculates based on whichever model state is active.

 

I was playing around with trying to get the rule to just set the active model state to perform the calculation and change back, but this was causing other issues and seems like an inelegant solution. Surely the specific parameter for each model state is accessible somehow and can be called up?

0 Likes
225 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @bmcwilliam.  There is generally never really a 'parameter' for that value in any model document.  There are some standard iProperties for values like that though, where previously calculated values may get stored.  And there is a general overall Area property in ComponentDefinition.MassProperties.Area, but that does not sound like what you want here.  Below are a list of some standard iProperties (all of which are in the third PropertySet named "Design Tracking Properties" in English):

 

Name = "SurfaceArea" (not just area of 1 specific face, but all faces)

Value = Double, with -1 as default value (ReadOnly)

 

Name = "Flat Pattern Area"

Value = Double (value will be in cm^2, not document units)

 

Name = "Sheet Metal Area"

Value = Double (value in document units)

 

However, if you have created an actual UserParameter for storing this value, and you want to be able to read both values (the value for both ModelStates) at the same time, then you will need to access the ModelStateTable by code, which is possible to do two different ways.

And yes, activating the ModelState you want to either read from, or make changes to, is the 'standard' way of doing things, because each ModelState can actually represent a different Document within that one File on disk.  But there is also the MemberEditScope setting, which can be set to either 'Factory Scope' (or all members scope) or 'active member scope', to specify if your 'changes/edits' will effect only the active ModelState, or all of them.  That setting is also used when working with iParts/iAssemblies.  But as for 'reading' data from multiple ModelStates in one place, the ModelStateTable is the only place to do that.

 

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes