Jump to content

Auto Dimensions between polyline and a proposed line


SHI5AG89

Recommended Posts

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:

image.thumb.png.58e3ca35c7e6214f2051a5ae4a437acc.png

 

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

Link to comment
Share on other sites

  • 2 weeks later...

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 by Emmanuel Delay
Link to comment
Share on other sites

  • 3 weeks later...

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...