Jump to content

Recommended Posts

Posted (edited)

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
Posted

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

Posted

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
Posted

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

Posted
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!!

Posted
23 hours ago, Siddu said:

@ronjonp Its working!! Thank you!!

Glad to help 🍻

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