Deleting Selection Set Across Multiple Layouts

Deleting Selection Set Across Multiple Layouts

MrJSmith
Advocate Advocate
9,671 Views
45 Replies
Message 1 of 46

Deleting Selection Set Across Multiple Layouts

MrJSmith
Advocate
Advocate

I have a selection set that contains entities across multiple layouts. I wish to delete them. I have tried the autocad command erase and autolisp's entdel, they only deleted the entities for the layout I was on.

 

The only solution I have come up with (besides cycling through all the layouts) is to set the selection set entities to a layer and force AutoCad to delete that layer.

 

My question is why does AutoCad behave in this way regarding deleting and layouts, and is there a better way than my current method? 

 

Thanks!

0 Likes
Accepted solutions (1)
9,672 Views
45 Replies
Replies (45)
Message 41 of 46

margono_bersinar
Enthusiast
Enthusiast

noted sir, before i checked some lisp in my pc they put "2" for object block that's the reason i think that number shows object type. sorry my mistake. 😁

0 Likes
Message 42 of 46

MrJSmith
Advocate
Advocate

@margono_bersinar I use this function to see what DXF codes selected objects have which can be useful for creating your SSGET functions to target only what you want to.

 

(defun c:info (/)
	(if (setq ss (ssget))
		(progn
			(print ss)
			;Check for multiple selections
			(if (> (sslength ss) 1)
				(foreach x (mapcar 'cadr (ssnamex ss))
					(if (= (vl-symbol-name (type x)) "ENAME")
						(progn
							(print (entget x))
							(princ "\n\n\033")
						)
					)
				)
				(print (entget (ssname ss 0))) ;if one
			)
			(princ)
		)
		(princ "\nNothing Selected!")
	)
	(princ)
) 
0 Likes
Message 43 of 46

margono_bersinar
Enthusiast
Enthusiast

@MrJSmith wrote:

@margono_bersinar I use this function to see what DXF codes selected objects have which can be useful for creating your SSGET functions to target only what you want to.

 

 

(defun c:info (/)
	(if (setq ss (ssget))
		(progn
			(print ss)
			;Check for multiple selections
			(if (> (sslength ss) 1)
				(foreach x (mapcar 'cadr (ssnamex ss))
					(if (= (vl-symbol-name (type x)) "ENAME")
						(progn
							(print (entget x))
							(princ "\n\n\033")
						)
					)
				)
				(print (entget (ssname ss 0))) ;if one
			)
			(princ)
		)
		(princ "\nNothing Selected!")
	)
	(princ)
) 

 


Thank you sir, after several times I tried with several objects I was able to use it. The first time I tried it I was little bit confused by the amount of information that came out. 

0 Likes
Message 44 of 46

MrJSmith
Advocate
Advocate

Yep, you have to know what each entity code number represents. A general list can be found here: https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-3610039E-27D1-4E23-B6D3-7E60B22BB5BD and there are specific codes for each entity type found on the left side.

0 Likes
Message 45 of 46

mruPRQUJ
Advocate
Advocate

Hi there,

 

Is it possible to select a block and delete it in multiple layout? thanks. 🙂

0 Likes