Robert
How about the SETCFG & GETCFG functions? I still use these to store preferred printer device names on networked CAD stations.
|
Robert
How about the SETCFG & GETCFG functions? I still use these to store preferred printer device names on networked CAD stations.
Ah yes, I had forgotten about those, in my old age.
Here is a niffy offset routine... ex: on current layer - offset a line from another layer and make it reside on current layer code: Got this from a freeware site
;Offset -- Improved offset command (offsets to current layer)
(defun C:OO ( / Ent1 list1 )
(setvar "cmdecho" 1)
(setvar "aunits" 4)
(setvar "unitmode" 0)
(setvar "PLINEGEN" 0)
(setvar "maxsort" 2000)
(setvar "trimmode" 1)
(setvar "projmode" 1)
(setq list1 "")
(setq Ent1 (getvar "offsetdist"))
(command ".OFFSET")
(while (< 0 (getvar "CMDACTIVE"))
(command pause)
(if (not (equal ent1 (entlast))) (progn
(setq ent1 (entlast))
(setq list1 (entget ent1))
(setq list1 (subst
(cons 8 (getvar "CLAYER")) (assoc 8 list1) list1))
(entmod list1)
)))
(princ)
)
(if C:Offset
(command "UNDEFINE" "OFFSET"))
(princ)
Richard,
Nice Job. Very clever the way you preserved the use of Through.
Here are my revisions to your routine.
Code:(defun c:ofs (/ usrcmd prm dist e p clayer) (setq usrcmd (getvar "cmdecho")) (setvar "cmdecho" 0) (setq clayer (getvar "clayer")) (princ "\nOffset Object\n") ;; if first time through set to default value (if (null *zyz_off*)(setq *zyz_off* 2)) (if (= 'real (type *zyz_off*)) (setq dist (rtos *zyz_off*)) (setq dist *zyz_off*) ) (initget 68 "Through") (setq dist (getdist (strcat "Distance to offset or Through <" dist ">:"))) ;; Pressing ENTER uses the previous value (if (null dist) (setq dist *zyz_off*)) (if (= 'real (type dist)) (setq prm "\nSelect side to offset:") (setq prm "\nSelect through point:") ) (setq *zyz_off* dist) (while (setq e (entsel "\nSelect entity to offset:")) (redraw (car e) 3) (if (setq p (getpoint prm)) (command "_.offset" *zyz_off* e p "" "CHANGE" "L" "" "P" "LA" Clayer "")) ) (setvar "cmdecho" usrcmd) (princ) ); defun