ADD OPTION SELECTION TO MY LISP ROUTINE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
im trying to create a lisp routine to edit layer transparency. how would i add a prefix to this code to run different options. for instance if the command is run it will give you an option to pick a,b or c. if a is picked then the following code is run, if b is picked, a different variation of the code is run. the current code below works for the layers, but id like to add the selection feature.
(vl-load-com)
(defun c:fade (/ *error* c_doc c_lyrs)
; localised error function
(defun *error* ( msg )
(if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
(if (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\nOops an Error : " msg " occurred.")))
(princ)
);_end_*error*_defun
;initial setups go here
(setq c_doc (vla-get-ActiveDocument (vlax-get-acad-object))
c_lyrs (vla-get-layers c_doc)
);end_setq
;start of altering drawing
(if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
(vla-startundomark c_doc)
(vlax-for lyr c_lyrs
(if (or (wcmatch (vla-get-name lyr) "*|*" ) (wcmatch (vla-get-name lyr) "XR-*" ))
(progn
(command "-LAYER" "_TR" 60 (vla-get-name lyr) "")
);end_progn
);end_if
(if (or (wcmatch (vla-get-name lyr) "XR-BASE|B-PROPERTY" ) (wcmatch (vla-get-name lyr) "XR-BASE|B-NONPROPERTY" ) (wcmatch (vla-get-name lyr) "XR-BASE|B-PROPERTY-STREET-TEXT" ) (wcmatch (vla-get-name lyr) "XR-TITLE|*" ))
(progn
(command "-LAYER" "_TR" 0 (vla-get-name lyr) "")
);end_progn
);end_if
);end-for
(if (and c_doc (= 8 (logand 8 (getvar 'UNDOCTL)))) (vla-endundomark c_doc))
(princ)
);end_defun