- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a situation where i am using a dcl file to delete tabs from a template drawing that is copied into the project directory & renamed. The user will select from a box whether or not the drawing will have an architectural demolition roof plan or a demolition ceiling plan. If those selection are not made the routine will delete those tabs. The prolem i am running into is if one of the selections is made & the other one is not. Here is a sample of my code.
(if (and (demoroof)(not demorcp))
(PROGN
(command "layout" "d" "DM-102.00")
(command "layout" "R" "DM-103.00" "DM-102.00")
);END PROGN demoroof not demorcp
)
when i was degugging it in the ide it was telling me
that
; warning: local variable used as function: DEMOROOF
; error: too few arguments: (IF (AND ( ... ) ( ... )))
so i changed it to this:
(if (and (= demoroof)(= not demorcp))
(PROGN
(command "layout" "d" "DM-102.00")
(command "layout" "R" "DM-103.00" "DM-102.00")
);END PROGN demoroof not demorcp
)
This code seems to work if both the selections are not made.
(if (not demorcp)(command "layout" "d" "DM-102.00"))
(if (not demoroof)(command "layout" "d" "DM-103.00"))
)
How can i use the operators to make it so if the user selects the demo roof but they do not select the demo ceiling the routine will delete the "DM-102.00" tab & rename the "DM-103.00" tab to "DM-102.00. Perhaps my syntax is not correct but it seems like if i only have one selection the code is fine but if i have two selections it is telling me that i am using the variable as a function. When i change that it is telling me either i have too few arguments or too many. I guess i need some help on how to properly code the operators such as "and" & "or".
Solved! Go to Solution.