Jump to content

Conditional Help


mwade93

Recommended Posts

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."))
       )
   )
)

Link to comment
Share on other sites

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.")
)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...