Mitch Ellis Posted 5 hours ago Posted 5 hours ago (edited) (defun c:PLD (/ ent obj i p1 p2) (vl-load-com) (if (setq ent (car (entsel "\nSelect Polyline to Dimension: "))) (progn (setq obj (vlax-ename->vla-object ent)) (if (= (vla-get-ObjectName obj) "AcDbPolyline") (progn (setvar "cmdecho" 0) (command "._undo" "_begin") (setq i 0) ;; Loop through vertices (repeat (fix (- (vlax-curve-getEndParam obj) 1)) (setq p1 (vlax-curve-getPointAtParam obj i) p2 (vlax-curve-getPointAtParam obj (1+ i))) ;; Create aligned dimension (command "_.dimaligned" "_none" p1 "_none" p2 "_none" (polar p1 (+ (angle p1 p2) (/ pi 2)) 1.0)) (setq i (1+ i)) ) (command "._undo" "_end") (setvar "cmdecho" 1) ) (princ "\nSelected object is not a LightWeight Polyline.") ) ) ) (princ) ) (princ "\nType 'DimPlineSegments' to run.") Edited 1 hour ago by SLW210 Added Code Tags!! Quote
SLW210 Posted 1 hour ago Posted 1 hour ago In the future please place your code in Code Tags. (<> in the editor toolbar) 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.