Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
anoor
417 Views, 4 Replies

iLogic Error Message

I'm trying to write some code to change the diameter of a plate and Inventor lets me add a rule and type in the code but then when i try to 'save' or 'save&run' I get this message:

2018-10-17 11_18_03-Edit Rule_ Diameter.jpg

 

 

Curtis_Waguespack
in reply to: anoor

Hi @anoor

 

 

Programming questions of this type are best posted on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

With that in mind, from your screen grab it looks like your file name formatting is not correct... can you post the code and some more info on the file name, and more specifics concerning what you're attempting to do?

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

anoor
in reply to: Curtis_Waguespack

This is the code I created. It's just a simple If/Then statement:

SyntaxEditor Code Snippet

If Plate_Diameter = 4 ft  Then
Parameter("Dia") = "4'-0"""
Parameter("THK") = "1/2"""
Cutout_Length = 18 in
Cutout_QTY = 14 ul

Else If Plate_Diameter = 6 ft  Then
Parameter("Dia") = "6'-0"""
Parameter("THK") = "1/2"""
Cutout_Length = 30 in
Cutout_QTY = 14 ul

Else If Plate_Diameter = 8 ft  Then
Parameter("Dia") = "8'-0"""
Parameter("THK") = "1/2"""
Cutout_Length = 36 in
Cutout_QTY = 14 ul

End If

I don't use iLogic much, but I have written this type of code hundreds of times and I've not had any issues with it until now. 

Curtis_Waguespack
in reply to: anoor

Hi @anoor,

 

I'm not certain, but I think the error might be coming from the use of quote symbols. Note that you can use CHR(34) instead of "

 

See if this resolves the issue:

 

If Plate_Diameter = 4 ft  Then
Parameter("Dia") = "4'-0" & Chr(34)
Parameter("THK") = "1/2" & Chr(34)
Cutout_Length = 18 in
Cutout_QTY = 14 ul

Else If Plate_Diameter = 6 ft  Then
Parameter("Dia") = "6'-0" & Chr(34)
Parameter("THK") = "1/2" & Chr(34)
Cutout_Length = 30 in
Cutout_QTY = 14 ul

Else If Plate_Diameter = 8 ft  Then
Parameter("Dia") = "8'-0" & Chr(34)
Parameter("THK") = "1/2" & Chr(34)
Cutout_Length = 36 in
Cutout_QTY = 14 ul

End If

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Anonymous
in reply to: anoor


@anoor wrote:

I'm trying to write some code to change the diameter of a plate and Inventor lets me add a rule and type in the code but then when i try to 'save' or 'save&run' I get this message:

2018-10-17 11_18_03-Edit Rule_ Diameter.jpg

 

 


Hi guys,

I get the same error message, I woder if you came to a solution for that!

 

best regard 

Mamo