0 Members and 1 Guest are viewing this topic.
(defun c:cPoly (/ ent1 ent2 i len pt p1 ptlst) (vl-load-com) (if (and (setq ent1 (car (entsel "\nSelect First Polyline: "))) (wcmatch (cdr (assoc 0 (entget ent1))) "*POLYLINE") (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) ptlst (cons (polar pt (angle pt p1) (/ (distance pt p1) 2.)) ptlst))) (setq ptlst (apply (function append) (mapcar (function (lambda (x) (list (car x) (cadr x)))) ptlst))) (vla-AddLightWeightPolyline (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))) (variant (vlax-safearray-fill (safearray vlax-VBDouble (cons 0 (1- (length ptlst)))) ptlst))))) (princ))