Jump to content
Siddu

Plines to Arrows or Lines to Arrows

Recommended Posts

Siddu

Dear all,

 

I have multiple Polylines parallel to each other in Cad and I Need to convert those into Arrows or Leaders  (without Text) any Lisp available?

 

Really appreciate for assistance.

 

Thanks,

Siddu 

Edited by Siddu

Share this post


Link to post
Share on other sites
dlanorh

Rather a vague desciption. Post a Before/After drawing (saved as AutoCAD 2012 or earlier for me) so everyone is on the same page.

Share this post


Link to post
Share on other sites
ronjonp

Perhaps something as simple as this?

(defun c:foo (/ r s)
  ;; RJP » 2020-09-15
  (if (setq s (ssget ":L" '((0 . "lwpolyline,line"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (setq r nil)
      (foreach i (reverse (entget e))
	(if (member (car i) '(10 11))
	  (setq r (cons (cons 10 (cdr i)) r))
	)
      )
      (and (entmake (append (list '(0 . "LEADER")
				  '(100 . "AcDbEntity")
				  (assoc 8 (entget e))
				  '(100 . "AcDbLeader")
				  '(3 . "STANDARD")
			    )
			    r
		    )
	   )
	   (entdel e)
      )
    )
  )
  (princ)
)

 

  • Thanks 1

Share this post


Link to post
Share on other sites
BIGAL

Any thing wrong with a linetype ? Will have multi arrows, can make different linetype with spacing to suit.

Share this post


Link to post
Share on other sites
Siddu
19 hours ago, ronjonp said:

Perhaps something as simple as this?


(defun c:foo (/ r s)
  ;; RJP » 2020-09-15
  (if (setq s (ssget ":L" '((0 . "lwpolyline,line"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (setq r nil)
      (foreach i (reverse (entget e))
	(if (member (car i) '(10 11))
	  (setq r (cons (cons 10 (cdr i)) r))
	)
      )
      (and (entmake (append (list '(0 . "LEADER")
				  '(100 . "AcDbEntity")
				  (assoc 8 (entget e))
				  '(100 . "AcDbLeader")
				  '(3 . "STANDARD")
			    )
			    r
		    )
	   )
	   (entdel e)
      )
    )
  )
  (princ)
)

 

@ronjonp Its working!! Thank you!!

Share this post


Link to post
Share on other sites
ronjonp
23 hours ago, Siddu said:

@ronjonp Its working!! Thank you!!

Glad to help 🍻

Share this post


Link to post
Share on other sites

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...