Hello, does anyone have or can easily create lisp code to create a selection set of all objects excluding civil 3D objects?
I would like to have a function to wblock 2D objects to drawing file.
Trevor
|
|
|
Hello, does anyone have or can easily create lisp code to create a selection set of all objects excluding civil 3D objects?
I would like to have a function to wblock 2D objects to drawing file.
Trevor
You would probably need to make two selection sets. The first set would contain all of the objects in the drawing. The second set would then be created based off of a filter of the ObjectName property. You would probably cycle through the first set for each object to check that property. Most, if not all, of the the Civil 3D objects have a ObjectName prefix string of "AECC".
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
[Edit] - Selecting non-AECC objects is not necessarily the same as selecting 2D (non-3D) objects, FWIW.Code:(defun c:Wblock2D (/ ss) (if (setq ss (ssget "_:L" '((0 . "~AECC*")))) (progn (sssetfirst nil ss) (initcommandversion) (command "._wblock") ) ) (princ) )
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
BlackBox thank you!
that is really better and definitely what I need for this, thanks for the code!
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
Good morning BlackBox, I was testing out the code you had provided me and realized that it collects paperspace objects also.
could I ask you to tweak it to not pickup paperspace objects?
Regards
Trevor
Correct; the code above allows the user to graphically select of any non-AECC object.
Given that even AECC objects created in paperspace are automagically moved to modelspace, they cannot be graphically selected from paperspace per-se.
This will preclude selection outside of model tab:
Code:(defun c:Wblock2D (/ ctab ss) (if (and (= "Model" (setq ctab (getvar 'ctab))) (setq ss (ssget "_:L" '((0 . "~AECC*")))) ) (progn (sssetfirst nil ss) (initcommandversion) (command "._wblock") ) (if (not ss) (prompt (strcat "\n** Command not allowed in " ctab " Tab ** \n")) ) ) (princ) )
Cheers
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000
thanks again BlackBox! this is not the first time you have helped me out.
much appreciated!
Kudos
Trevor
"How we think determines what we do, and what we do determines what we get."
Sincpac C3D ~ Autodesk Exchange Apps
Computer Specs:
Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000