Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all
I found this really useful lisp routine by "Geobuilder" which allows for extruding 2D entities into 3D using the object layer instead of current layer. The only issue is that it pause for a variable. Is there a way to modify the routine so that the user can use the mouse click instead of typing a number? Below is the routine
I read in another thread by using dist function I will have a choice between entering a number or using the mouse but I don't know lisp to modify the code.
Greately appreciate any help I can get with this
Regards
F
(defun c:geo_extrude (/ nabor dlina i oldcolor sloy ima cvet 3Dob c b) (setq nabor (SSGET ":L" '((0 . "LWpolyline,circle"))) dlina (SSLENGTH nabor) i -1 oldcolor (getvar "CECOLOR") b (getreal "Height of extruding") ) (setvar "CECOLOR" "1");appoint any colour, that only not "BYLAYER" (REPEAT dlina ;(REPEAT (SETQ sloy (ASSOC 8 (SETQ ima (ENTGET (SSNAME nabor (SETQ i (1+ i))))) ) cvet (if (ASSOC 62 ima) (ASSOC 62 ima) '(62 . 256) ) ) (if (= (cdr (ASSOC 0 ima)) "CIRCLE") (setq c 0) (extrude-y-n ima) ) (if (= c 0) ;(if (progn ;(progn (VL-CMDF "_extrude" (CDR (ASSOC -1 ima)) "" b) (SETQ 3Dob (ENTGET (entlast)) 3Dob (SUBST sloy (ASSOC 8 3Dob) 3Dob) 3Dob (SUBST cvet (ASSOC 62 3Dob) 3Dob) ) (entmod 3Dob) ) ;)progn ) ;)if ) ;)REPEAT (setvar "CECOLOR" oldcolor) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun extrude-y-n (ima / spisversh dlina a b) (setq spisversh (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) ima) ) dlina (1- (length spisversh)) a -1 c 0 ) (if (or (= (cdr (assoc 70 ima)) 1) ;(if1 (equal (nth 0 spisversh) (nth dlina spisversh)) ) (progn ;(progn (repeat dlina ;(repeat1 (setq a (1+ a) b -1 ) (repeat dlina ;(repeat2 (setq b (1+ b)) (if ;(if2 (and (> (abs (- a b)) 1) (or (/= a 0) (/= b (1- dlina))) (or (/= b 0) (/= a (1- dlina))) ) (if ;(if3 (inters (nth a spisversh) (nth (1+ a) spisversh) (nth b spisversh) (nth (1+ b) spisversh) ) (setq c 1) ) ;)if3 ) ;)if2 ) ;)repeat2 ) ;)repeat1 ) ;)progn (setq c 1) ) ;)if1 )
Solved! Go to Solution.