Inventor General Discussion

Inventor General Discussion

Reply
Valued Contributor
shmartin89
Posts: 74
Registered: ‎04-25-2012
Message 1 of 10 (394 Views)
Accepted Solution

'End if must be preceded by a matching if'

394 Views, 9 Replies
11-23-2012 12:41 AM

Iv attached a picture to show the error & my rule text. I have created the Parameters etc. & the statement includes if & end if. Cheers,Capture.PNG

If Parameter("HEIGHT")=152.4

Parameter("UC_PROFILE")="152.4"
EndIf

 

If you are finding usnderstanding ilogic difficult, have a go at the online tutorials.

when you created the "UC_PROFILE" Parameter, did you create it as a text parameter?

 

If not, in the parameters dialogue, use the drop down in the bottom left which by default says "Add Numeric". Select "Add Text" instead.

Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 2 of 10 (385 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 01:33 AM in reply to: shmartin89

If Parameter("HEIGHT")=152.4

Parameter("UC_PROFILE")="152.4"
EndIf

 

If you are finding usnderstanding ilogic difficult, have a go at the online tutorials.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 3 of 10 (374 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 03:48 AM in reply to: waynehelley

** Use "End IF', not "ENDIF"

 

Pasting into IE erased the space.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
Valued Contributor
shmartin89
Posts: 74
Registered: ‎04-25-2012
Message 4 of 10 (367 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 04:58 AM in reply to: waynehelley

Cheers,

 

My text in the 'UC_designation' Parameter contains 'x's. E.g - 152.x152x23

 

Inventor recognises this as an equation, therefor the rule doesnt work. Is there any way around this without replacing the 'x's?

 

Cheers,Capture.PNG

Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 5 of 10 (363 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 05:09 AM in reply to: shmartin89

when you created the "UC_PROFILE" Parameter, did you create it as a text parameter?

 

If not, in the parameters dialogue, use the drop down in the bottom left which by default says "Add Numeric". Select "Add Text" instead.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
Valued Contributor
shmartin89
Posts: 74
Registered: ‎04-25-2012
Message 6 of 10 (344 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 07:40 AM in reply to: waynehelley

Cheers Wayne.

 

This is the first time iv started using Rules. If you havent already guessed!

 

Sandy

Valued Contributor
shmartin89
Posts: 74
Registered: ‎04-25-2012
Message 7 of 10 (340 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 08:17 AM in reply to: shmartin89

Do you know if there is a way in which rules can be run automatically? E.g Everytime the part is updated or saved rather then having to press iTrigger

 

Cheers,

Valued Contributor
shmartin89
Posts: 74
Registered: ‎04-25-2012
Message 8 of 10 (338 Views)

Re: 'End if must be preceded by a matching if'

11-23-2012 08:24 AM in reply to: shmartin89

NVM. Iv added the rule into event triggers.

Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 9 of 10 (282 Views)

Re: 'End if must be preceded by a matching if'

11-26-2012 12:20 AM in reply to: shmartin89

I'm not that knowledgeable about triggers I'm afraid, as I have only really been creating rules which I need to run on command, but have a look at this...

 

http://inventortrenches.blogspot.co.uk/2012/01/creating-basic-ilogic-rule-with-event.html

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
Mentor
waynehelley
Posts: 151
Registered: ‎09-10-2012
Message 10 of 10 (280 Views)

Re: 'End if must be preceded by a matching if'

11-26-2012 12:23 AM in reply to: waynehelley

I just realised NVM stands for nevermind so mevermind my last post also!

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2013
Windows 7 Enterprise, 64-bit
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.