
Autocad Contour Lisp
Additional Autocad contour lisp selection SketchUp Import for AutoCAD SketchUp Import 2013 is a free plug-in that offers you two ways to get SKP files into your AutoCAD drawings.
It does not work well in this lisp code. The label displayed twice in close polyline. I should label one in close polyline. (defun c:CLB (/ ss i ed p) (vl-load-com) (prompt ' nSelect Contour. ') (if (setq ss (ssget ':L' '((0.
'LWPOLYLINE')))) (repeat (setq i (sslength ss)) (setq ed (entget (ssname ss (setq i (1- i))))) (foreach x (list (car (setq p (vl-remove-if '((x) (/= (car x) 10)) ed))) (last p)) (entmakex (list '(0. 'CONTOUR LABEL') (cons 1 (rtos (cdr (assoc 38 ed)) 2 3)) (cons 40 (getvar 'textsize')) x );_ end of list );_ end of entmakex );_ end of foreach );_ end of repeat );_ end of if (princ) );_ end of defun. Hi Sanju, try this code (vl-load-com) (defun c:ContoursLabel (/ ss i en p0 p1) (if (and (princ ' nSelect Contours, ') (setq ss (ssget ':L' '((0. '*POLYLINE')))) (not (command '_.-LAYER' '_N' 'Contour_RL' '_C' 6 ' ')) ) (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i))) p0 (vlax-curve-getStartPoint en) p1 (vlax-curve-getEndPoint en)) (foreach x (if (equal p0 p1 ) (list p0) (list p0 p1)) (entmakex (list '(0. 'Contour_RL') (cons 1 (rtos (nth 2 x) 2 3)) (cons 40 2) (cons 10 x)))))) (princ) ). (vl-load-com) (defun c:ContoursLabel (/ ss i en p0 p1) (if (and (princ ' nSelect Contours, ') (setq ss (ssget ':L' '((0. '*POLYLINE')))) (not (if (tblobjname 'LAYER' 'Contour_RL') nil (command '_.-LAYER' '_N' 'Contour_RL' '_C' 6 ' '))) ) (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i))) p0 (vlax-curve-getStartPoint en) p1 (vlax-curve-getEndPoint en)) (foreach x (if (equal p0 p1 ) (list p0) (list p0 p1)) (entmakex (list '(0.
'Contour_RL') (cons 1 (rtos (nth 2 x) 2 3)) '(40. 2) (cons 50 (/ pi 4)) (cons 10 x)))))) (princ) ). (vl-load-com) (defun c:ContoursLabel (/ ss i en p0 p1) (if (and (princ ' nSelect Contours, ') (setq ss (ssget ':L' '((0. '*POLYLINE')))) (not (if (tblobjname 'LAYER' 'Contour_RL') nil (command '_.-LAYER' '_N' 'Contour_RL' '_C' 6 ' '))) ) (repeat (setq i (sslength ss)) (setq en (ssname ss (setq i (1- i))) p0 (vlax-curve-getStartPoint en) p1 (vlax-curve-getEndPoint en)) (foreach x (if (equal p0 p1 ) (list p0) (list p0 p1)) (entmakex (list '(0. 'Contour_RL') (cons 1 (rtos (nth 2 x) 2 3)) '(40. 2) (cons 50 (/ pi 4)) (cons 10 x)))))) (princ) ). Tetradj dlya zakrepleniya znanij 2 klass kanashevich matematika 1. My version: (defun c:Test (/ _t ss i sn st nd);; Tharwat;; (defun _t (p s) (entmake (append '((0.
'Contour_RL') (40. 0.785398) (7. 'Standard') (71. 0) ) (list (cons 1 (rtos s 2 3)) (cons 10 p) (cons 11 p) ) ) ) ) (princ ' nSelect Polylines:') (if (setq ss (ssget '((0. 'POLYLINE')))) (repeat (setq i (sslength ss)) (setq sn (ssname ss (setq i (1- i))) st (vlax-curve-getstartpoint sn) nd (vlax-curve-getendpoint sn) ) (if (vlax-curve-isclosed sn) (_t nd (caddr nd)) (mapcar '_t (list st nd) (mapcar 'caddr (list st nd)) ) ) ) ) (princ) ). Wrote: Since I'm still not come to taste mapcar and lambda, so tell me what is your attitude better if not just different. I am sorry BeekeeCZ, I did not mean any offense when I shared / posted my attempt in this thread.