Mitch Ellis Posted 9 hours ago Posted 9 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 5 hours ago by SLW210 Added Code Tags!! Quote
SLW210 Posted 5 hours ago Posted 5 hours ago In the future please place your code in Code Tags. (<> in the editor toolbar) Quote
BIGAL Posted 1 hour ago Posted 1 hour ago (edited) Another way to approach this ";; Loop through vertices" is to get all the vertices and simply use those XY values of the corresponding two points in a repeat. You can check the readabilty of the answer by looking at the angle of the two points, so place answer above or below. There are plenty of label plines out there do a google, "Kent Cooper" has some good ones. may be faster than debugging what you have. setq plent (entsel "\nPick pline")) (if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent)))))) (princ co-ord) Edited 1 hour ago by BIGAL 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.