iLogic to create several model states and assign custom iproperty for each model state
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Edit - I decided to go a different direction. No need for the help on this one. Thanks all for looking!
Hey everyone, we just upgraded to Inventor 2022 from 2020 and enjoying model states capability. I've been reading over a few threads and snippets that others have written. Some of them capture a small aspect of what I'm trying to do but I can't seem to pull it all together and functioning. I was hoping this thread would get me close to what I need but so far it only creates a model state for the top level assembly and we don't need dialog boxes just yet https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/example-create-and-activate-model-st....
Previously in 2020 Inventor, we were using a simple snippet to combine the part number iproperty with a "-N" or "-G" etc text but with Model States I'm hoping we can make this even better. Here is the code we were using which is very simple as you can see:
iProperties.Value("Custom", "Finished part number") = iProperties.Value("Project", "Part Number") & "-N"
What I'm trying to do is create an ilogic rule to run on our legacy Inventor 2020 files that will create several model states. I want to the ilogic code to create a string of model states, fetch the Master model state iproperty and populate it into each new model state's part number iproperty but add a suffix of the model state name at the end of the part number.
To give some info on what these values mean. -N is natural metal finish, -G is galvanized part, L-N is a left-hand natural metal finish part, L-G is a left-hand galvanized part, R-N is a right-hand natural metal finish part, R-G is a right-hand galvanized part.
Basically I need to:
- Automatically create "-N", "-G", "L-N", "L-R", "R-N", and "R-G" model states on each part or assembly file
- Populate each new model state part number iproperty with the same part number iproperty as the Master model state and then add a suffix to the part number of each model state that contains the model state's name
Hope that all makes sense. If not here are some pictures showing what I'm trying to achieve...
Model States:
Master Model State Part Number iproperty:
-N Model State Part Number iproperty needs to read as:
L-N Model State Part Number iproperty needs to read as:
Kenny
If this post solved your issue please mark "Accept as Solution". It helps everyone...really!