Jump to content

Plines to Arrows or Lines to Arrows


Siddu

Recommended Posts

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

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

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

Link to comment
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
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...