mwade93 Posted December 16, 2016 Share Posted December 16, 2016 I got help with another command using conditionals on here, but I seem to be having difficulty with this code. What it does is read the value of the sheetsize command which is selected outside of this code. Not all of the layouts are available for every paper size. So this code is supposed to cancel if the layout selected isn't created for that paper size. However, it isn't functioning correctly. If I select the correct paper size, it will insert the layout with no problem. It also works if the value is nil. I'm assuming it has something to do with the conditional lines for the last two conditionals, but I can't figure out what's wrong. Thanks for the help. ((/ SHEETSIZE) (if (and SHEETSIZE) (progn (command "layout" "template" SheetSize "QF002DES" "imageframe" "1" "imageframe" "0") ) (cond ((not SHEETSIZE) (alert "Sheet size was not selected. Please select sheet size and restart the command.")) ((= "2016 TM 30x42 Template" SHEETSIZE) (alert "This layout is not available for the selected size.")) ((= "2016 TM 11x17 Template" SHEETSIZE) (alert "This layout is not available for the selected size.")) ) ) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 16, 2016 Share Posted December 16, 2016 Hi, I am not that sure that I got your point but let's hope this would help. (if SheetSize (if (wcmatch SheetSize "2016 TM 30x42 Template,2016 TM 11x17 Template") (alert "This layout is not available for the selected size.") (command "layout" "template" SheetSize "QF002DES" "imageframe" "1" "imageframe" "0") ) (alert "Sheet size was not selected. Please select sheet size and restart the command.") ) Quote Link to comment Share on other sites More sharing options...
mwade93 Posted December 16, 2016 Author Share Posted December 16, 2016 Thank You. It seems to be working. Another function to make note of. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted December 16, 2016 Share Posted December 16, 2016 Glad to help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.