I'm starting with an assembly that only has a few paramaters in it. I'm creating parameters 'on the fly' in one of my iLogic rules.
My other iLogic rules are written to use those parameters that are newly created. I did not use the Parameter("paramname") format in these rules. I am calling out the paramname.
Example:
I used:
Select Case frame_style
instead of
Select Case Parameter("frame_style")
When these other iLogic rules run, they do not see those newly created parameters unless I open the rule and hit OK (Typically, they are chained to run in a specific order).
I would rather not have to go thru and change all locations where I am calling just the paramname to Parameter("paramname"). There are a lot. 🙂
Is there anyway I can get the parameters in the iLogic rules to 'reinitialize' to the parameter? Or maybe another suggestion?
Thanks in advance,
Randy Mabery
Inventor 2014
Solved! Go to Solution.
Solved by Vladimir.Ananyev. Go to Solution.
So it appears a possible solution would be to Regen a rule, rather than Run that rule.
Regenerating a rule "Regenerates the selected rule. Reconnects the rule to the Inventor parameters that it references, then recompiles and runs the rule."
If I manually RMB on one of my rules, I can Regen it and it reconnects the param just as I'd hope.
Any way to do this programatically? Instead of this:
iLogicVb.RunRule("Delete_Comps")
Is there a version to Regen a rule? I know I can programatically Regen All Rules but that doesn't help. I need to be able to do one at a time.
Thanks,
Randy
Hi Randy,
Based on this thread (http://forums.autodesk.com/t5/Inventor-Customization/iLogic-Rebuild-part-sub-assembly-regen-all-rule...) the following should work:
Dim controlDef as ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("iLogic.RegenAllRules") controlDef.Execute2(True)
I hope this helps.
Cheers,
Thanks for the reply Adam.
I was hoping to find a way to just regen an individual rule. I don't want to regen all rules.
Thanks,
Randy
There is to API function to regenerate a single rule.
But you can do it with the following code:
auto = iLogicVb.Automation rule0 = auto.GetRule(ThisDoc.Document, "Rule0") ' Reset the rule text. This clears the list of referenced parameters. rule0.Text = rule0.Text auto.RunRuleDirect(rule0)
hi
can i export all parameters from open iparts and iassembly to an excel file.i mean i assembly parameters should be in different column.but exporting should be done only for active documents.is it possible?will someone pls help?
The iAssemblyFactory object provides access to the iAssembly table and all members.
iAssemblyFactory.TableRows.Count property specifies the number of items in the collection.
iAssemblyFactory.TableRows.Item property returns iAssemblyTableRow object by index or by name.
iAssemblyTableRow.Item returns the specified iAssemblyTableCell object from the collection.
iAssemblyTableCell.Value property gets the string value of the cell.
I hope the following thread could help you to start:
If you still have questions please start new thread because this thread is related to another topic.
Thanks,