Jump to content

Extrude polylines based on numbers of inside


tahta07

Recommended Posts

 
 
Hello.
In my drawing, 
there are many blocks around and it says how many floors they are inside. 
I want to extrude these blocks. 
But since they are so numerous, it takes a long time to do it one by one. 
I'm looking for a lisp to extrude these blocks according to the numbers written in them.
It also works to select polylines based on the numbers inside
I'm sorry for my bad english.

http://prntscr.com/yz55au

 

Edited by tahta07
Link to comment
Share on other sites

Here's a start:

(defun c:foo (/ i n p s sp)
  ;; RJP » 2021-02-12
  (if (setq s (ssget ":L" '((0 . "*POLYLINE"))))
    (progn (setq sp (vlax-ename->vla-object (cdr (assoc 330 (entget (ssname s 0))))))
	   (vl-cmdf "_.UNDO" "Be")
	   (setvar 'cmdecho 0)
	   (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
	     (setq p nil)
	     (repeat (fix (setq i (vlax-curve-getendparam e)))
	       (setq p (cons (vlax-curve-getpointatparam e i) p))
	       (setq i (1- i))
	     )
	     (if (and (setq i (ssget "_WP" p '((0 . "TEXT"))))
		      (> (setq n (atof (cdr (assoc 1 (entget (setq i (ssname i 0))))))) 0)
		 )
	       ;; Vl extrusion is not as editable?
	       (progn ;; (setq r (car (vlax-invoke sp 'addregion (list (vlax-ename->vla-object e)))))
		      ;; (vlax-invoke sp 'addextrudedsolid r (* 3 n) 0.)
		      (vl-catch-all-apply 'vl-cmdf (list "_.extrude" e "" (* 3 n)))
	       )
	     )
	   )
	   (vl-cmdf "_.UNDO" "End")
	   (setvar 'cmdecho 1)
    )
  )
  (princ)
)

 

  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
On 4/7/2021 at 5:30 PM, ronjonp said:

Glad to help 🍻

Sir

could you help me again?

 

Lisp works very well but it doesn't exturude 3DPOLYLINE  How can I exturude both 3dpolyline and polyline

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