iLogic, Assemblies and part parameter values

iLogic, Assemblies and part parameter values

NachoShaw
Advisor Advisor
345 Views
2 Replies
Message 1 of 3

iLogic, Assemblies and part parameter values

NachoShaw
Advisor
Advisor

 

 

Hey

 

i do try to avoid iLogic where possible but sometimes there is a need. In my case, model states and the relationship between assembly values & part values. To be honest, Model states shouldnt really come into this but im using them so will reference them.

 

In my assembly, i have a custom iProperty field called "P_Qty"

in my part, i have a Parameter called "Qty"

i want to change the parameter in the part when the iProperty is changed in the assembly.

 

iLogic

 

Parameter.Value("GL:1", "QTY") = iProperties.Value("Custom", "P_Qty")

 

ive also tried

 

Parameter("GL:1", "QTY") = iProperties.Value("Custom", "P_Qty")

 

which is basically saying or at least it should be-

Change the value of the parameter named "QTY" in occurrence "GL:1" to the value of the custom iProperty "P_Qty" in the assembly

when i run this, i get an error

 

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Inventor.Parameter.set_Expression(String )
   at iLogic.ParamDynamicFinder.SetParamValue(Parameter param, Object value, Boolean doUpdate)
   at ThisRule.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

Even if i change to a static number, it doesnt work..

 

Parameter.Value("GL:1", "QTY") = 1

 

 

what am i missing? The part is in the assembly and im trying to run this from the assembly iLogic

 

 

thanks

 

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
346 Views
2 Replies
Replies (2)
Message 2 of 3

NachoShaw
Advisor
Advisor

UPDATE

If i dont have any Model States in the part, i can update the parameter. If this is the case, how do you control parts with different model states in an assembly? i thought the idea was so we could create an assembly and have different versions based on Model states? Ive been working with Model States for about 2 weeks now and there appears to be a blockade on everything ive tried to do... Its like American Ninja is the Model State function and i am the 1 legged contestant trying to get across the line...

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 3 of 3

NachoShaw
Advisor
Advisor

Dont worry, i have gone a different route now and skipped away from Model States...

 

Thanks 🙂

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes