Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Code. Parameters.

4 REPLIES 4
Reply
Message 1 of 5
shmartin89
447 Views, 4 Replies

iLogic Code. Parameters.

I have code written containing 2 numerical parameters & 1 text parameter. Once each numerical parameter equals a certain value I would like the text parameter to equal a definition.

 

I have no problem getting this to work for 1 numerical value but not for 2. The iLogic does not seam to take the second numerical parameter value into account. How do I get iLogic to look at the first value & then also the second before determining the value of the text parameter.

 

 

This is my code:

 

If Parameter("PFC_HEIGHT")=100 AndAlso Parameter ("PFC_WIDTH")=50
Parameter("Name2")="100x50x10"

End If

Tags (2)
4 REPLIES 4
Message 2 of 5
shmartin89
in reply to: shmartin89

Sorry, this is my code. I missed a line.

 

If Parameter("PFC_HEIGHT")=100 AndAlso Parameter ("PFC_WIDTH")=50
Parameter("Name2")="100x50x10"

End If


iProperties.Value("Custom", "Name2") = Name2

Message 3 of 5
mrattray
in reply to: shmartin89

Try this:

 

If PFC_HEIGHT=100 And PFC_WIDTH=50 Then
  Name2="100x50x10"
End If

iProperties.Value("Custom", "Name2") = Name2

 

Mike (not Matt) Rattray

Message 4 of 5
shmartin89
in reply to: mrattray

This didnt work. The second If is ignored by iLogic. Luckily the sum of the parameters is unique for each part so that was a way round the problem. It still doesnt solve it though.

Message 5 of 5
mrattray
in reply to: shmartin89

Do both PFC_HEIGHT and PFC_WIDTH show up blue in the editor?
Are you doing anything else with these (or affecting these) parameters upstream in the rule?
Can you attach the part here for us to look at? I use And & Or statements all the time in iLogic and I've never had this problem.
Mike (not Matt) Rattray

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

Post to forums  

Autodesk Design & Make Report