63alfred Posted October 31, 2017 Posted October 31, 2017 My error the code for the above should be: (defun c:profiles5ft (/ ent1 ent2 i len pt p1 ptlst1 ptlst2 ptlst3 ptlst4) (vl-load-com) (set'one 5) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")) (if (and (setq ent2 (car (entsel "\nSelect Second Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst1 (cons (polar pt (angle pt p1) (/ (distance pt p1) one.)) ptlst1))) (setq ptlst1 (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst1))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst1)))) ptlst1)))))) (set'two 2.5) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")) (if (and (setq ent2 (car (entsel "\nSelect Second Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst2 (cons (polar pt (angle pt p1) (/ (distance pt p1) two.)) ptlst2))) (setq ptlst2 (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst2))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst2)))) ptlst2)))))) (set'three 1.66) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")) (if (and (setq ent2 (car (entsel "\nSelect Second Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst3 (cons (polar pt (angle pt p1) (/ (distance pt p1) three.)) ptlst3))) (setq ptlst3 (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst3))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst3)))) ptlst3)))))) (set'four 1.25) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE")) (if (and (setq ent2 (car (entsel "\nSelect Second Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent2))) "*POLYLINE")) (progn (setq i -1 len (/ (vla-get-Length (vlax-ename->vla-object ent1)) 100.)) (while (setq pt (vlax-curve-getPointatDist ent1 (* (setq i (1+ i)) len))) (setq p1 (vlax-curve-getClosestPointto ent2 pt t) ptlst4 (cons (polar pt (angle pt p1) (/ (distance pt p1) four.)) ptlst4))) (setq ptlst4 (apply 'append (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst4))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-VBDouble (cons 0 (1- (length ptlst4)))) ptlst4)))))) (princ)) Quote
nicolecita Posted May 21, 2020 Posted May 21, 2020 Hi, is there a CPoly equivalent for Autocad for Mac? Thank you! Quote
Ilir Posted July 21, 2022 Posted July 21, 2022 Lee, can you create a LISP for me: polyline, .040 thick, dashed, 4 cliks, layer 0, green color. I will use it as AVB membrane. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.