Jump to content

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


Recommended Posts

Posted

image.png.ab330e78a57ed8387fe09fae2ba54a4f.pngHere is a polyline, where I want to add vertical construction line to all vertex. Is it possible?

Posted (edited)

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
Posted (edited)

Are you trying to draw some form of cross or long section, with values ? 

Edited by BIGAL
Posted
2 hours ago, BIGAL said:

Are you trying to draw some form of cross or long section, with values ? 

Yes, creating road profile.

Posted
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 ❤️

Posted
17 minutes ago, faizur said:

Thanks Man, its work perfectly ❤️

:beer:

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