- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@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:
Hi guys,
I get the same error message, I woder if you came to a solution for that!
best regard
Mamo