
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have tried to do this in multiple ways, but what i am trying to do is test if the first line is true with a combination of an AND , OR condition & if not run the code on the next line. Originally i was trying to do this with just an IF statement, but i later added in the cond statement to see if that would work. Whichever way i write it either only does the top line or it does both lines. i cant get it to run the second line if the top line is false. Here is the code in question & i have also uploaded the whole file. ln13 is a variable for the state that the project is in based on a dialog box selection that gets created with another lisp routine. ln6 is a variable for the city the project is in. Basically, if the project is in MANHATTAN, BRONX, BROOKLYN, FLUSHING, JACKSON HEIGHTS, QUEENS, NEW YORK, or STATEN ISLAND i want to execute:
(Command "-layer" "s" "A-ANNO-TEXT" "" "insert" "H:\\Overlays\\BCK_McDonalds\\CoverinfoNYC.dwg" "0,0" "1" "" "")
If the project is in NY , but not in those cities i want it to execute:
(Command "-layer" "s" "A-ANNO-TEXT" "" "insert" "H:\\Overlays\\BCK_McDonalds\\CoverinfoNY.dwg" "0,0" "1" "" "")
code snippet is here:
(cond
(If (AND (= ln13 "NY")(OR (= (strcase ln6 "MANHATTAN"))(= (strcase ln6 "BRONX"))(= (strcase ln6 "BROOKLYN"))(= (strcase ln6 "FLUSHING"))(= (strcase ln6 "JACKSON HEIGHTS"))(= (strcase ln6 "QUEENS"))(= (strcase ln6 "NEW YORK"))(= (strcase ln6 "STATEN ISLAND")))))(Command "-layer" "s" "A-ANNO-TEXT" "" "insert" "H:\\Overlays\\BCK_McDonalds\\CoverinfoNYC.dwg" "0,0" "1" "" "")
(Command "-layer" "s" "A-ANNO-TEXT" "" "insert" "H:\\Overlays\\BCK_McDonalds\\CoverinfoNY.dwg" "0,0" "1" "" "")
)
Solved! Go to Solution.