Chat
Frequently Asked Questions
You won't believe what is possible in terms of programming... It doesn't matter in which area you use AutoCAD, BricsCAD or ZWCAD! Do they have particularly complex tasks or just repetitive simple tasks that are very time-consuming overall? Give us a call or email us - we can certainly help you! From small tools to full-blown programs till to the 'finish Button.'
Creates a support point list (all GC 10) of a 2D/3D polyline to be selected.
Code:
(defun C:plist ( / ename en entl flag vlist pt Elev) (defun LI_item (n alist)(cdr (assoc n alist))) (setq ename (car(entsel))) (setq vlist '() entl (entget ename) en (LI_item 0 entl) ) ;_ end of setq (cond ((= en "LWPOLYLINE") (setq vlist '() Elev (LI_item 38 entl) ) ;_ end of setq (foreach pt entl (if (= (car pt) 10) (setq vlist (cons (list (cadr pt) (caddr pt) Elev) vlist)) ) ;_ end of if ) ;_ end of foreach ) ((= en "SPLINE") (setq vlist (LI_mitem 11 entl)) ) ((= en "POLYLINE") (setq ename (entnext ename) entl (entget ename) en (LI_item 0 entl) vlist '() ) ;_ end of setq (while (= en "VERTEX") (setq flag (LI_item 70 entl)) (if (and (zerop (logand flag 1)) (zerop (logand flag 2)) (zerop (logand flag 8)) ) ;_ end of and (setq pt (LI_item 10 entl) vlist (cons pt vlist) ) ;_ end of setq ) ;_ end of if (setq ename (entnext ename) entl (entget ename) en (LI_item 0 entl) ) ;_ end of setq ) ;_ end of while ) ((= en "LINE") (setq vlist (list (LI_item 10 entl) (LI_item 11 entl))) ) ) ;_ end of cond (if vlist (reverse vlist) nil ) ;_ end of if ) ;_ end of defun