Simple Lisp to select everything on layer and explode/join

Simple Lisp to select everything on layer and explode/join

Anonymous
Not applicable
2,368 Views
4 Replies
Message 1 of 5

Simple Lisp to select everything on layer and explode/join

Anonymous
Not applicable

Im dealing with lines and polylines in particular.

Im looking for a small and simple lisp that selects everything on a layer, "ROW", and explode it.

 

Im also looking for a lisp that selects everything on a layer, "ROW" and joins it

0 Likes
Accepted solutions (2)
2,369 Views
4 Replies
Replies (4)
Message 2 of 5

hak_vz
Advisor
Advisor
Accepted solution
(defun c:selrow  nil (setq ss  (ssget "_X" '((8 . "ROW")))))

 

Whenever you have to use  explode or join something in layer "ROW" use command selrow to create selection set.

Then simply start command EXPLODE or JOIN and as a argument to select objects in layer "ROW"  enter !ss and hit enter

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 5

Anonymous
Not applicable
(defun c:exrow  ()
  (setq ss  
      (ssget "_X" '((8 . "*ROW"))
	  )
  )
   (command "explode" "!ss")
)

 

I have to do this command over and over in at least a couple hundred drawings. I wanted to get it into a single command if possible. Can you help me complete the lisp above? 

0 Likes
Message 4 of 5

hak_vz
Advisor
Advisor
Accepted solution
(defun c:exrow  ()
  (setq ss  
      (ssget "_X" '((8 . "*ROW"))
	  )
  )
   (setvar 'qaflags 1)(command "_.explode" ss "")(setvar 'qaflags 0)
   (princ)
)

(defun c:jorow  ()
  (setq ss  
      (ssget "_X" '((8 . "*ROW"))
	  )
  )
   (setvar 'qaflags 1)(command "_.join" ss "")(setvar 'qaflags 0)
   (princ)
)

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

Missing the what if its not "Row" 

(setq ent (entsel "\nPick object for layer "))
(setq lay (cdr (assoc 8 (entget (car ent)))))
(setq ss (ssget (list (cons 8 lay))))
0 Likes