Author Topic: How do selections work  (Read 3214 times)

0 Members and 1 Guest are viewing this topic.

hyposmurf

  • Guest
How do selections work
« on: January 28, 2006, 04:30:53 PM »
Dont have a clue yet how to create a lisp to do what I want to do, but Im hoping to understand some of the basics of selections.In order to grab similar objects from a drawing such as those on a certain layer,colour,linetype etc. Ive seen some lisps that do this by adding objects to selection sets.But can you just do this without creating a selection set,just have autocad search its database and then select the items.Like for instance the QSELECT command will do this,no need to create your selection sets or groups.Problem with the QSELECT, is that its slow to open and run through all the parameters you need.Id like to be able to run something similar to it at the command line.Could then run a number of different lisps or macros for each type of selection.

paulmcz

  • Bull Frog
  • Posts: 202
Re: How do selections work
« Reply #1 on: January 28, 2006, 04:46:13 PM »
This will select all red circles in entire drawing and asign to variable "a".

Code: [Select]
(setq a (ssget "x" '((0 . "circle")(62 . 1))))

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How do selections work
« Reply #2 on: January 28, 2006, 05:11:30 PM »
To be precise, that is not semantically correct.

using filter (62 . 1) indicates color property set to 1<acred> . If the object color is BYLAYER on a RED layer it will not be filtered.

.. I realise the distinction seems minor, but the difference can be irritating when selections do not happen as you'd "expect" 
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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How do selections work
« Reply #3 on: January 28, 2006, 05:23:26 PM »
Without knowing the level of your current knowledge, it's difficult answer your "I'd like ... "
I think you'd need to create a selection set, then use "Prev" for selection in commands .. Yes ?

There's a fair bit to it, so,
Have a look in the Help file at :

ssget
Selection Set Handling
Selection Set Filter Lists 
Relational Tests
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.

paulmcz

  • Bull Frog
  • Posts: 202
Re: How do selections work
« Reply #4 on: January 28, 2006, 05:34:18 PM »
To be precise, that is not semantically correct.

using filter (62 . 1) indicates color property set to 1<acred> . If the object color is BYLAYER on a RED layer it will not be filtered.

.. I realise the distinction seems minor, but the difference can be irritating when selections do not happen as you'd "expect" 

I agree!

hyposmurf

  • Guest
Re: How do selections work
« Reply #5 on: January 28, 2006, 05:46:44 PM »
Without knowing the level of your current knowledge, it's difficult answer your "I'd like ... "
I think you'd need to create a selection set, then use "Prev" for selection in commands .. Yes ?

There's a fair bit to it, so,
Have a look in the Help file at :

ssget
Selection Set Handling
Selection Set Filter Lists 
Relational Tests

My current knowledge of all things lisp related is quite honestly poor :-).I can modify lisps and can sometimes work out whats going in each lisp.Im slowly picking up the very basics but its not a fast process.Thanks for those Kerry I'll go and have a look. :wink:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: How do selections work
« Reply #6 on: January 28, 2006, 06:50:01 PM »
'Smurf,

also, have a play with the SSX command .. and have a look at the source in the ACAD support folder ..
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How do selections work
« Reply #7 on: January 28, 2006, 07:28:25 PM »
hyposmerf
Go Here   http://www.smadsen.com/
and in the left column look under "Selections"
See "By Code" & "Filters"
There is a lot of information on using ssget.
It is a powerful tool when you learn to use the filters.
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.

David Bethel

  • Swamp Rat
  • Posts: 656
Re: How do selections work
« Reply #8 on: January 30, 2006, 01:57:18 PM »
Hypo,

Here's one I've have used for ages, it allows for selectiobn sets with filters and then editing by dxf group code of a selection set.

http://www.davidbethel.com/cadtutor/ssedit.lsp

It is based on native R12 entity types but can be pretty powerful ( read dangerous )  -David
R12 Dos - A2K

uncoolperson

  • Guest
Re: How do selections work
« Reply #9 on: January 30, 2006, 02:18:39 PM »
if you're wanting things to be selected and passed between this and that without passing a selection set variable deally look into
Code: [Select]
(sssetfirst gripset [pickset])