Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using User Params that are created with iLogic

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
rsmabery
557 Views, 6 Replies

Using User Params that are created with iLogic

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

 

 

Thanks,
Randy Mabery
Please accept my post as a solution or use the Kudos button if I was helpful
http://inventbetter.blogspot.com/
6 REPLIES 6
Message 2 of 7
rsmabery
in reply to: rsmabery

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

Thanks,
Randy Mabery
Please accept my post as a solution or use the Kudos button if I was helpful
http://inventbetter.blogspot.com/
Message 3 of 7
adam.nagy
in reply to: rsmabery

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,



Adam Nagy
Autodesk Platform Services
Message 4 of 7
rsmabery
in reply to: rsmabery

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

Thanks,
Randy Mabery
Please accept my post as a solution or use the Kudos button if I was helpful
http://inventbetter.blogspot.com/
Message 5 of 7
Vladimir.Ananyev
in reply to: rsmabery

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)

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 6 of 7
saif08
in reply to: rsmabery

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?

Message 7 of 7
Vladimir.Ananyev
in reply to: saif08

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:

http://forums.autodesk.com/t5/Inventor-Customization/Can-iAssembly-configuration-list-appear-in-an-i...

 

If you still have questions please start new thread because this thread is related to another topic.

Thanks,

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report