- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello again,
I've done the best i can with understanding what I've read. i am attempting to have keywords appear and depending on what you choose the opposite will be deleted.
Attached is the cad file for reference that include a generic template. Also, I've attached the two codes that are broken. I did the best I could to my knowledge.
First, "FFF" is to choose LEFT or RIGHT. If I choose RIGHT then the LEFT should be erased and vice versa. I was able to write the code to erase the first command but i cannot figure out how to skip the command if the opposite is chosen.
Second, the "DDD" code is the same concept but with multiple combinations. There should only be one choice and the others should be erased. This one, doesn't work at all.
(defun C:FFF (/ LR RR) (initget 1 "Left Right") (setq LR (getkword "\nPick Garage Left or Garage Right? [Left/Right]")) (if (eq "Left" LR) (setq LR "LH" RR "RH") (setq RR "RH" LR "LH")) (if (setq LR (ssget "_C" '(24 24) '(0 0))) (command "_.erase" RH "") );if (if (setq RR (ssget "_C" '(59 24) '(35 0))) (command "_.erase" LH "") );if );defun ;;; (defun C:DDD (/ Aa Bb Cc) (initget 1 "ElevA ElevB") (setq Aa (getkword "\nWhat Elevation Opt You Want? [ElevA/ElevB/ElevC]")) (if (eq "ElevA" Aa) (setq Aa "A" Bb "B" Cc "C")) (if (setq Aa (ssget "_C" '(59 -44) '(0 -102))) (command "_.erase" B "") );if );defun
Solved! Go to Solution.