Author Topic: Seeing info of selection sets  (Read 6188 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
Seeing info of selection sets
« on: February 19, 2010, 01:18:59 PM »
Alright, this is a stupid question but for the life of me I can't remember how to view the info after making a selection set.
So I have the following code:

Code: [Select]
(setq dwgblocks (ssget "X" '((2 . "*"))))
because I'm simply trying to select all the blocks in a drawing so I can explode them all.

But I know this is selecting everything including the stuff in paperspace, and I only want the stuff in modelspace.
So, first off, how can I view this information from the selection set ??
Secondly, does anyone have an idea for how I can select just the blocks in modelspace ??

Thanks in advance.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Seeing info of selection sets
« Reply #1 on: February 19, 2010, 01:27:09 PM »
ssnamex will list the selection set properties.  Read help for all the information.

To get certain entities, use there dxf codes.  For blocks, inserts, use dxf code 0 and insert.

To get items in a certain tab, use code 410 and that spaces name.

Hope that helps.

ps... code 2 gets names of entities, that have names.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Seeing info of selection sets
« Reply #2 on: February 19, 2010, 01:56:49 PM »
There is a lot of information here on
Explode Blocks
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Hangman

  • Swamp Rat
  • Posts: 566
Re: Seeing info of selection sets
« Reply #3 on: February 19, 2010, 04:29:39 PM »
...
ps... code 2 gets names of entities, that have names.
T,
I was to the understanding I could use ... '((2 . "*")) to get blocks and just use the wildcard to select all the blocks in the drawing.  I know it made a selection set for me, but I couldn't for the life of me figure out how to read it.  :D
But if this is not the case, how would you suggest selecting all the blocks in a drawing in model space only to be exploded ??
I'm converting a boat load of drawings from Microstation to CAD so I need to change ALL the attributes, text styles, colors, layers, etc.   We're spending hours on something that should take a mere minutes.
By the way T, it's good to see you again, I've been out of the loop for the past year.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Seeing info of selection sets
« Reply #4 on: February 19, 2010, 04:32:28 PM »
Select All Blocks (Inserts):

Code: [Select]
(ssget "_X" '((0 . "INSERT")))

Hangman

  • Swamp Rat
  • Posts: 566
Re: Seeing info of selection sets
« Reply #5 on: February 19, 2010, 05:08:26 PM »
Select All Blocks (Inserts):

Code: [Select]
(ssget "_X" '((0 . "INSERT")))
OK, it selects some objects, I still do not know what it is putting in the selection set though.
When I run the command to explode the blocks, I get the following error:
Quote
Command: (command ".explode" blocks "")
.explode
Select object:
The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.

The object is not in current space.
Now, I have one block in Paper space (a title block), the rest are in model space.  These in model space are the ones I want to explode.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Seeing info of selection sets
« Reply #6 on: February 19, 2010, 05:33:05 PM »
Current Layout:

Code: [Select]
(ssget "_X" (list (cons 0 "INSERT")
                  (cons 410 (getvar 'CTAB))))

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Seeing info of selection sets
« Reply #7 on: February 19, 2010, 05:45:59 PM »
How are you defining 'blocks
in this  (command ".explode" blocks "")



See if this helps ;
Code: [Select]
(setq SelectedBlocks(ssget "_X" '((0 . "INSERT") )))
(kdub:ss->entlist SelectedBlocks)


(setq SelectedBlocksInCurrentSpace (ssget "_X"
                                        (list (cons 0 "INSERT")
                                              (cons 410 (getvar 'CTAB))
                                        )
                                 )
)
(kdub:ss->entlist SelectedBlocksInCurrentSpace)

Code: [Select]
(foreach ent (kdub:ss->entlist SelectedBlocksInCurrentSpace)
         (command ".explode" ent )
)

Code: [Select]
(defun kdub:ss->entlist (ss / i returnval)
  (if (and ss (< 0 (sslength ss)))
    (progn (setq i 0)
           (repeat (sslength ss)
             (setq returnval (cons (ssname ss i) returnval)
                   i         (1+ i)
             )
           )
    )
  )
  (if returnval
    (reverse returnval)
    nil
  )
)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Hangman

  • Swamp Rat
  • Posts: 566
Re: Seeing info of selection sets
« Reply #8 on: February 19, 2010, 05:59:15 PM »
Kerry,
my definition is simply:
Code: [Select]
(setq blocks (ssget "_X" '((0 . "INSERT"))))So, let me throw in the  (list (cons ...  )) and I'll let you know.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Seeing info of selection sets
« Reply #9 on: February 19, 2010, 06:58:55 PM »
There is no need to explode each entity by itself, so I would use the code Lee posted, and pass that selection set to the explode command, and then keep going until there is no blocks left.

Good to see you too Hangman.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Seeing info of selection sets
« Reply #10 on: February 19, 2010, 07:07:26 PM »
There is no need to explode each entity by itself, so I would use the code Lee posted, and pass that selection set to the explode command, and then keep going until there is no blocks left.

Good to see you too Hangman.

I couldn't get that to work Tim. Only exploded the first item in the selection set ... or that seemed to be the case.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Seeing info of selection sets
« Reply #11 on: February 19, 2010, 07:12:36 PM »
Set QAFLAGS to 1 perhaps?

< Note:- this should only be changed within the routine, and then reset when the routine completes >
« Last Edit: February 19, 2010, 08:14:34 PM by Lee Mac »

Hangman

  • Swamp Rat
  • Posts: 566
Re: Seeing info of selection sets
« Reply #12 on: February 19, 2010, 07:15:36 PM »
There is no need to explode each entity by itself, so I would use the code Lee posted, and pass that selection set to the explode command, and then keep going until there is no blocks left.

Good to see you too Hangman.

I couldn't get that to work Tim. Only exploded the first item in the selection set ... or that seemed to be the case.

I couldn't get it to work either.  It asks for the name of the block to be exploded.  I'm assuming it's because the list is created but I'm not sure.
Question along these lines then:   Can I filter the selection to only blocks with text in them ??  And would that look something like this ??
Code: [Select]
(setq dwgblocks (ssget "_X" '((0 . "INSERT")(0 . "MText,Text")))) Thanks guys.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hangman

  • Swamp Rat
  • Posts: 566
Re: Seeing info of selection sets
« Reply #13 on: February 19, 2010, 07:17:20 PM »
Set QAFLAGS to 1 perhaps?

What is QAFLAGS ??  I can't find it in the system variables or the in help file for that matter.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hangman

  • Swamp Rat
  • Posts: 566
Re: Seeing info of selection sets
« Reply #14 on: February 19, 2010, 07:23:17 PM »
Well, whatever QAFLAGS is, it didn't do the trick.
I received a return value of:  0   Nothing exploded, no other prompt.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~