iLogic, Assemblies and part parameter values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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.