CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.
Joined: 14.Jul.2014
Location: United States
Using: AutoCAD Electrical 2014 Status: Offline
Points: 25
Topic: SS Get and Lisp Question Posted: 17.Oct.2014 at 16:18
Hell everyone.
I currently have the following lisp file:
(defun C:get_att()
(if (setq ss (ssget "_F" '((7 2.5) (13.5 2.5)) '((0 . "INSERT")))) (progn (setq en (ssname ss 0))
(setq enlist(entget en)) ;- Get the DXF group codes
(setq blkType(cdr(assoc 0 enlist))) ;- Save the type of entity
(if (= blkType "INSERT") ;- If the entity type is an Insert entity
(progn
(if(= (cdr(assoc 66 enlist)) 1) ;- See if the attribute flag equals one (if so, attributes follow)
(progn
(setq en2(entnext en)) ;- Get the next sub-entity
(setq enlist2(entget en2)) ;- Get the DXF group codes
(setq enlist3(cdr(assoc 1 enlist2)))
(while (/= (cdr(assoc 0 enlist2)) "SEQEND") ;- Start the while loop and keep ;- looping until SEQEND is found.
(princ "\n ") ;-Print a new line
(princ enlist2) ;- Print the attribute DXF group codes
(setq en2(entnext en2)) ;- Get the next sub-entity
(setq enlist2(entget en2)) ;- Get the DXF group codes
)
)
) ;- Close the if group code 66 = 1 statement
)
) ;- Close the if block type = "ATTRIB" statement
)
) ;- Close the if an Entity is selected statement
)
The lisp above gathers many useful pieces of information from the block that it intersects. I use this information later on in variables.
At the beginning of the lisp the ss get function is utilized. Instead of the way it is working right now, I would like to use the following code for the ss get function.
The lisp above scans for all the layers that are off and returns the names of these layers in a list format.
So in conclusion, I would like the ss get function to scan for all the layers that are turned off and exclude those layers from my selection. Using that list I would like to use this exact function
So to clear things up. First the lisp file will scan for the layers that are turned off. Once it knows this list I want it to exclude all the layers in that list (the ones that are off) and use it along with this function:
(if (setq ss (ssget "_X" '((2 . "SYSTEM_SP_Q"))))
Thank you in advance for anyone who takes the time to read all of this.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum