Jump to content

is there any way to generate vertical construction line on all vertex of selected polyline with lisp?


faizur

Recommended Posts

Give this a try:

(defun c:foo (/ s)
  ;; RJP » 2022-09-09
  ;; Generate vertical xlines on polyline vertexes
  (if (setq s (ssget '((0 . "LWPOLYLINE"))))
    (progn (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
	     (foreach p	(vl-remove-if '(lambda (x) (/= 10 (car x))) (entget e))
	       (entmakex (list '(0 . "XLINE")	      '(100 . "AcDbEntity")  '(67 . 0)
			       '(8 . "XLINE")	      '(100 . "AcDbXline")   p
			       '(11 0.0 1.0 0.0)
			      )
	       )
	     )
	   )
	   ;; Make layer not plot and color 128,128,128
	   (entmod (append (entget (tblobjname "LAYER" "XLINE")) '((290 . 0) (420 . 8421504))))
    )
  )
  (princ)
)

 

2022-09-09_09-32-53.gif

Edited by ronjonp
  • Like 3
Link to comment
Share on other sites

10 hours ago, ronjonp said:

Give this a try:

(defun c:foo (/ s)
  ;; RJP » 2022-09-09
  ;; Generate vertical xlines on polyline vertexes
  (if (setq s (ssget '((0 . "LWPOLYLINE"))))
    (progn (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
	     (foreach p	(vl-remove-if '(lambda (x) (/= 10 (car x))) (entget e))
	       (entmakex (list '(0 . "XLINE")	      '(100 . "AcDbEntity")  '(67 . 0)
			       '(8 . "XLINE")	      '(100 . "AcDbXline")   p
			       '(11 0.0 1.0 0.0)
			      )
	       )
	     )
	   )
	   ;; Make layer not plot and color 128,128,128
	   (entmod (append (entget (tblobjname "LAYER" "XLINE")) '((290 . 0) (420 . 8421504))))
    )
  )
  (princ)
)

 

2022-09-09_09-32-53.gif

Thanks Man, its work perfectly ❤️

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