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: 

CHANGE PARAMETER IN COMPONENT IN ASSEMBLY

1 REPLY 1
Reply
Message 1 of 2
tmathieson
225 Views, 1 Reply

CHANGE PARAMETER IN COMPONENT IN ASSEMBLY

Hello,  i am having an issue with iLogic in that when trying to update a parameter in a component while in an assembly, i keep getting an error.  my code....

 

Logger.Debug(NEW_PLATE)
Logger.Debug("CURRENT THICK ="&Parameter(NEW_PLATE, "PLATE_TH_MM"))
Logger.Debug ("TARGET THICK = " & PLATE_THICK)
Parameter(NEW_PLATE, "PLATE_TH_MM") = PLATE_THICK

 when i run the rule, i get the errors attached.  i have traced my variables and they are all ok (i think).  i believe i have the parameter statement right.  the only thing i can think of, (and don't know what to do about), is that the component has a number of model states. i don't know if that affects  the Parameter statement or not.

 

thanks in advance for any help or insight!

1 REPLY 1
Message 2 of 2
WCrihfield
in reply to: tmathieson

Interesting situation.  Since we can read the value of the specified parameter in the specified component, and we know its value is numeric, and we know that we are trying to set a numeric value to it in the last line, it's not obvious why it is failing.  I agree with your suspicions about the model states in that component possibly causing that line of code to fail.  I know that model states can store modified parameter values, and if there are multiple model states, you may need to set the ModelStates.MemberEditScope property of that component document.  Or you may have to edit its ModelStates.ModelStateTable.  I know there are a few new iLogic snippets related to components that let you specify ModelState in them now, but I don't think there is one like that for Parameters yet.  You may have to do it the long way for now.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report