I have no experience with trying to extract property values from a sheet set, so I will not be much help there. If you can work out how to do that, the following comments may be useful in the other parts of your AutoLISP function.
CMDECHO is an AutoCAD system variable that controls whether or not the command line prompts of command issued via the AutoLISP command function are echoed to the command line. If it is set to 1, they are; if it is set to 0, they are not. Depending upon you application, one or the other setting may be preferred. Usually, turning it off makes for less chatter on the command line. (Turning it on while debugging a function can be helpful, however.) So setting it to 0 before your routine gets to the point where you will be using the command function is a good idea. I generally like my routines to leave things as they were when the routine started, so I will usually save the current value of the CMDECHO system variable first, in a local variable, and then restore it at the end.
(defun c:test01 ( / acmde)
(setq acmde (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
....
(setvar "CMDECHO" acmde)
(prin1)
) ;_ End c:test01.
The "...." is the rest of your program. Any variable names included after a forward slash in the pair of parantheses that follow the defun name are treated as local variables, and will not be "remembered" after the routine is completed.
Your cond functions are not formatted properly. You are missing parentheses around the command functions and arguments. While you could use four separate cond functions, with one action each here, and get what I assume is your desired result (if you are able to get the values from the sheet set, a cond function is more typically used when there are multiple, mutually exclusive options, only one of which is to be executed. I assume that NWGSEAL and DCSSEAL are independent, and could both be 0, both be 1, or either could be 1 and the other 0. Since each only has two values, I would probably use if functions:
(if (= DCSSEAL 0)
(COMMAND ".LAYER" "OFF" "*-DCS" "")
(COMMAND ".LAYER" "ON" "*-DCS" "")
) ;_ End if.
(if (= NWGSEAL 0)
(COMMAND ".LAYER" "OFF" "*-NWG" "")
(COMMAND ".LAYER" "ON" "*-NWG" "")
) ;_ End if.
You could use cond functions, but would only need two:
(cond
((= DCSSEAL 0)
(COMMAND ".LAYER" "OFF" "*-DCS" "")
) ;_ End condition 1.
((= DCSSEAL 1)
(COMMAND ".LAYER" "ON" "*-DCS" "")
) ;_ End condition 2.
(T
(prompt "\nInvalid value assigned to variable DCSSEAL. ")
) ;_ End condition 3.
) ;_ End cond.
(cond
((= NWGSEAL 0)
(COMMAND ".LAYER" "OFF" "*-NWG" "")
) ;_ End condition 1.
((= NWGSEAL 1)
(COMMAND ".LAYER" "ON" "*-NWG" "")
) ;_ End condition 2.
(T
(prompt "\nInvalid value assigned to variable NWGSEAL. ")
) ;_ End condition 3.
) ;_ End cond.
Hope that helps, and good luck with finding out how to get the field data out of the Sheet Set Manager using AutoLISP.
David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
