SHI5AG89 Posted September 7, 2023 Posted September 7, 2023 I have a problem... I need to make a routine for myself and my co-workers.. ok here is the situation. We will have a polyline created from a series of points, where we need to plot dimensions perpendicular to the proposed line stating the difference between the proposed and existing. It is something like this: An auto dimension lisp will help us a lot as we will have lots of dimensions in our daily routine. Thanks a lot in advance... TEST1.dwg Quote
Emmanuel Delay Posted September 19, 2023 Posted September 19, 2023 (edited) I made something. But you do need to - either make the red polyline 1 closed polyline - or cut the grey polyline in single side polylines. The grey and red polylines mush match one to one. See my upload as example. Option 1 will cause problems in the corners. Option 2 is probably more preferred. - command ADBP, for Auto Dimensions Between Polylines - select grey polyline, then select red polyline. (first set the layer to whatever layer you want the dimensions to be drawn on) (vl-load-com) ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-get-the-z-coordinate-of-3d-polyline/td-p/2435197 ;; Poly-Pts ;;; returns a list of the polyline vertices WCS coordinates ;;; Argument: a polyline (ENAME or VLA-OBJECT) (defun poly-pts (p / n l) (setq n (fix (vlax-curve-getEndParam p))) (or (vlax-curve-IsClosed p) (setq n (1+ n))) (repeat n (setq l (cons (vlax-curve-getPointAtParam p (setq n (1- n))) l)) ) ) (defun draw_DIMALIGNED (p13 p14 p10 / ) (command "_.DIMALIGNED" p13 p14 p10) (entlast) ) ;; command ADBP for Auto Dimensions Between Polylines (defun c:ADBP ( / pl1 pl2 pts p13 p14) (setq pl1 (car (entsel "\nSelect polyline 1 (with the many endpoints): "))) (setq pl2 (car (entsel "\nSelect polyline 2 (red polyline): "))) (setq pts (poly-pts pl1)) (foreach p13 pts (setq p14 (vlax-curve-getClosestPointTo (vlax-ename->vla-object pl2) p13)) ;; draw DIMALIGNED (draw_DIMALIGNED p13 p14 p14) ) ) TEST1.dwg Edited September 19, 2023 by Emmanuel Delay Quote
SHI5AG89 Posted October 10, 2023 Author Posted October 10, 2023 Dear Emmanuel Delay Thanks a lot... This really works well with option 2. Thanks a lot again. 1 Quote
SHI5AG89 Posted August 24 Author Posted August 24 Dear sir On continuation to the above ADBP routine Will there be any option for automatic prefix - plus or minus values to be displayed. temp.dwg 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.