Hi guys,
I am trying to find the best, easiest solution to my code. From the code below I am getting the drawing name and then from that I am also able to extract the floor number base on how we name our drawings. I am then writing a condition statement for when the floor number matches then assign a variable base on the floor number.
(setq DV:FILE-NAME (strcase (getvar "DWGNAME")));Retrieve Drawing Name
(setq DV:FLOOR-NUMBER (substr DV:FILE-NAME 5 2));Retrieve Floor Number
(cond
((= DV:FLOOR-NUMBER 01) (progn (setq DV:DRAWING-TITLE "1ST FLOOR PLAN")))
((= DV:FLOOR-NUMBER 02) (progn (setq DV:DRAWING-TITLE "2ND FLOOR PLAN")))
((= DV:FLOOR-NUMBER 03) (progn (setq DV:DRAWING-TITLE "3RD FLOOR PLAN")))
((= DV:FLOOR-NUMBER 04) (progn (setq DV:DRAWING-TITLE "4TH FLOOR PLAN")))
((= DV:FLOOR-NUMBER 05) (progn (setq DV:DRAWING-TITLE "5TH FLOOR PLAN")))
)end Cond
I have a list of floors "written out" below which is just a snippet of the entire list but if I code it with Cond then it will be very long. How can I accomplish this so the code is more manageable? Is the answer LISTS? I'm just not sure.
01:FIRST FLOOR
02:SECOND FLOOR
03:THIRD FLOOR
04:FOURTH FLOOR
05:FIFTH FLOOR
Thanks for any assistance.