How to modify this code for cross dimensions ( sample image attached ,dimension marked in red ) ?
[open] (defun c:test (/ coords poly2)
(setq cords (Poly-Pts (vlax-ename->vla-object
(car (entsel "\nFirst poly:"))
)
)
poly2 (vlax-ename->vla-object (car (entsel "\nSecond poly:")))
)
(foreach x cords
(vl-cmdf "dimaligned"
x
(vlax-curve-getclosestpointto poly2 x)
x
)
)
)
;;; Poly-Pts (gile)
;;; Returns the vertices list of any type of polyline (WCS coordinates)
;;;
;;; Argument
;;; pl : a polyline (ename or vla-object)
(defun Poly-Pts (pl / pa pt lst)
(vl-load-com)
(setq pa (if (vlax-curve-IsClosed pl)
(vlax-curve-getEndParam pl)
(+ (vlax-curve-getEndParam pl) 1)
)
)
(while (setq pt (vlax-curve-getPointAtParam pl (setq pa (- pa 1))))
(setq lst (cons pt lst))
)
) [/close]