Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Number of objects selected?

16 REPLIES 16
Reply
Message 1 of 17
Anonymous
9917 Views, 16 Replies

Number of objects selected?

I'm looking for a LISP function that can tell me how many objects I've
selected.

Example: I have a drawing with 134 squares and 35 circles. I select all the
shapes except the 35 circles. It would be nice if Autocad could tell me that
I've selected a total of 134 objects.

Can it be done?

Thanx.

-M
16 REPLIES 16
Message 2 of 17
Anonymous
in reply to: Anonymous

i've no solution with lisp, but a tip for getting that with standard acad.
if you have opened the properties-window, you always have the number of
selected objects on top of your properties-windows within a combobox, if you
open/click the combobox you get the sum of selected entites for each
entity-type.

- alfred -


"Eowyn" schrieb im Newsbeitrag
news:EC7ACBA09CE8B63DA5197C15B4CA2083@in.WebX.maYIadrTaRb...
> I'm looking for a LISP function that can tell me how many objects I've
> selected.
>
> Example: I have a drawing with 134 squares and 35 circles. I select all
the
> shapes except the 35 circles. It would be nice if Autocad could tell me
that
> I've selected a total of 134 objects.
>
> Can it be done?
>
> Thanx.
>
> -M
>
>
Message 3 of 17
Anonymous
in reply to: Anonymous

Why do you need a lisp ? when you do a selection in AutoCAD, it does tell you
how many objects you selected. So what's your point ?

Eowyn a écrit :

> I'm looking for a LISP function that can tell me how many objects I've
> selected.
>
> Example: I have a drawing with 134 squares and 35 circles. I select all the
> shapes except the 35 circles. It would be nice if Autocad could tell me that
> I've selected a total of 134 objects.
>
> Can it be done?
>
> Thanx.
>
> -M
Message 4 of 17
Anonymous
in reply to: Anonymous

No lisp needed. Try using the SELECT command.

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> I'm looking for a LISP function that can tell me how many objects I've
> selected.
>
> Example: I have a drawing with 134 squares and 35 circles. I select all
the
> shapes except the 35 circles. It would be nice if Autocad could tell me
that
> I've selected a total of 134 objects.
Message 5 of 17
Anonymous
in reply to: Anonymous

When I have a large, detailed drawing - it would be an advantage to select
object and still have them selected when using the zoom and pan tools. Using
the properties-window works fine as long as I can mark every object without
zooming/pan'ing/anything - but most often that woun't work because of the
number of details in the drawing.

To ask it in a different manner - is there a way to keep objects selected
while moving around in the drawing?

-M

"Alfred NESWADBA" skrev i melding
news:6ABDD89D5A06060F3981E71F9AA6B212@in.WebX.maYIadrTaRb...
> i've no solution with lisp, but a tip for getting that with standard acad.
> if you have opened the properties-window, you always have the number of
> selected objects on top of your properties-windows within a combobox, if
you
> open/click the combobox you get the sum of selected entites for each
> entity-type.
>
> - alfred -
>
>
> "Eowyn" schrieb im Newsbeitrag
> news:EC7ACBA09CE8B63DA5197C15B4CA2083@in.WebX.maYIadrTaRb...
> > I'm looking for a LISP function that can tell me how many objects I've
> > selected.
> >
> > Example: I have a drawing with 134 squares and 35 circles. I select all
> the
> > shapes except the 35 circles. It would be nice if Autocad could tell me
> that
> > I've selected a total of 134 objects.
> >
> > Can it be done?
> >
> > Thanx.
> >
> > -M
> >
> >
>
>
Message 6 of 17
Anonymous
in reply to: Anonymous

At the command line, you could type:

(setq ss (ssget))

select your objects, do your panning, zooming, etc...

Then at any other "select objects" prompts just type:

!ss

to pass the selection set to the new command. To be a little fancier, you
might want to add '(setq ss (ssget)) to a toolbar button.

HTH,

- Andrew Levan

"Eowyn" wrote in message
news:75B0A90F18FD85EFA5EFF66652CFD5E1@in.WebX.maYIadrTaRb...
> When I have a large, detailed drawing - it would be an advantage to select
> object and still have them selected when using the zoom and pan tools.
Using
> the properties-window works fine as long as I can mark every object
without
> zooming/pan'ing/anything - but most often that woun't work because of the
> number of details in the drawing.
>
> To ask it in a different manner - is there a way to keep objects selected
> while moving around in the drawing?
>
> -M
>
> "Alfred NESWADBA" skrev i melding
> news:6ABDD89D5A06060F3981E71F9AA6B212@in.WebX.maYIadrTaRb...
> > i've no solution with lisp, but a tip for getting that with standard
acad.
> > if you have opened the properties-window, you always have the number of
> > selected objects on top of your properties-windows within a combobox, if
> you
> > open/click the combobox you get the sum of selected entites for each
> > entity-type.
> >
> > - alfred -
> >
> >
> > "Eowyn" schrieb im Newsbeitrag
> > news:EC7ACBA09CE8B63DA5197C15B4CA2083@in.WebX.maYIadrTaRb...
> > > I'm looking for a LISP function that can tell me how many objects I've
> > > selected.
> > >
> > > Example: I have a drawing with 134 squares and 35 circles. I select
all
> > the
> > > shapes except the 35 circles. It would be nice if Autocad could tell
me
> > that
> > > I've selected a total of 134 objects.
> > >
> > > Can it be done?
> > >
> > > Thanx.
> > >
> > > -M
> > >
> > >
> >
> >
>
>
Message 7 of 17
Anonymous
in reply to: Anonymous

Also-

Have you tried issuing your zoom, pan, etc. instructions transparently?

Example:
Select objects:'zoom
>>Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window] :

Select objects: 'pan
>>Press ESC or ENTER to exit, or right-click to display shortcut menu.

HTH,
-Andrew Levan


"Eowyn" wrote in message
news:75B0A90F18FD85EFA5EFF66652CFD5E1@in.WebX.maYIadrTaRb...
> When I have a large, detailed drawing - it would be an advantage to select
> object and still have them selected when using the zoom and pan tools.
Using
> the properties-window works fine as long as I can mark every object
without
> zooming/pan'ing/anything - but most often that woun't work because of the
> number of details in the drawing.
>
> To ask it in a different manner - is there a way to keep objects selected
> while moving around in the drawing?
>
> -M
>
> "Alfred NESWADBA" skrev i melding
> news:6ABDD89D5A06060F3981E71F9AA6B212@in.WebX.maYIadrTaRb...
> > i've no solution with lisp, but a tip for getting that with standard
acad.
> > if you have opened the properties-window, you always have the number of
> > selected objects on top of your properties-windows within a combobox, if
> you
> > open/click the combobox you get the sum of selected entites for each
> > entity-type.
> >
> > - alfred -
> >
> >
> > "Eowyn" schrieb im Newsbeitrag
> > news:EC7ACBA09CE8B63DA5197C15B4CA2083@in.WebX.maYIadrTaRb...
> > > I'm looking for a LISP function that can tell me how many objects I've
> > > selected.
> > >
> > > Example: I have a drawing with 134 squares and 35 circles. I select
all
> > the
> > > shapes except the 35 circles. It would be nice if Autocad could tell
me
> > that
> > > I've selected a total of 134 objects.
> > >
> > > Can it be done?
> > >
> > > Thanx.
> > >
> > > -M
> > >
> > >
> >
> >
>
>
Message 8 of 17
Anonymous
in reply to: Anonymous

I'm sure this question is asked before and probably solutions presented.
Check google. I assume this problem exists for those using digitizers or
traditional mice, or trying to use toolbars or commands for panning and
zooming.
I've never seen this problem cause I use a trackball with scroll wheel and
it does exactly that, you can select and zoom and pan to your hearts
content without losing your selections. I cant' imagine any other way of
working after using this tool.
I assume even a mouse with scroll wheel would do this.
good luck
Mark
Message 9 of 17
Anonymous
in reply to: Anonymous

No trouble here 😉

--
-Jason

Member of the Autodesk Discussion Forum Moderator Program


> I assume this problem exists for those using digitizers
Message 10 of 17
Anonymous
in reply to: Anonymous

Do some research on the redraw function. You will find what you need.

"Eowyn" wrote

> To ask it in a different manner - is there a way to keep objects selected
> while moving around in the drawing?
>
Message 11 of 17
Anonymous
in reply to: Anonymous

(setq ss (ssget "X" '((0 . "~CIRCLE")))
n (sslength ss))
(alert (strcat "You have selected " (itoa n) " objects."))
___

"Eowyn" wrote in message
news:EC7ACBA09CE8B63DA5197C15B4CA2083@in.WebX.maYIadrTaRb...
> I'm looking for a LISP function that can tell me how many objects I've
> selected.
>
> Example: I have a drawing with 134 squares and 35 circles. I select all
the
> shapes except the 35 circles. It would be nice if Autocad could tell me
that
> I've selected a total of 134 objects.
>
> Can it be done?
>
> Thanx.
>
> -M
>
>
Message 12 of 17
Anonymous
in reply to: Anonymous

Clarification needed...
When you say "select" do you mean as part of a command, or do you mean gripping?

--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ


"Eowyn" wrote in message
news:EC7ACBA09CE8B63DA5197C15B4CA2083@in.WebX.maYIadrTaRb...
> I'm looking for a LISP function that can tell me how many objects I've
> selected.
>
> Example: I have a drawing with 134 squares and 35 circles. I select all the
> shapes except the 35 circles. It would be nice if Autocad could tell me that
> I've selected a total of 134 objects.
>
> Can it be done?
>
> Thanx.
>
> -M
>
>
Message 13 of 17
Anonymous
in reply to: Anonymous

This might interest you:Its a simple (and not-very-professional)program
that lists how many of each type of entity you select
. I use it when I receive a dwg from somebody else,and want to freeze
one of his layers. For example, I wnat to make sure that his layer
called Dims has nothing but dimensions on it.
You might want to try this:use the select command, then run this lisp
on the previous selection, then get on with your work. A bit
awkward,but hey, its better than nuttin'.

Eowyn wrote:
>
> I'm looking for a LISP function that can tell me how many objects I've
> selected.
>
Message 14 of 17
Anonymous
in reply to: Anonymous

This is a roundabout way of doing it. But, if the object you are trying to count is a closed object, you can use the Region command to turn it into a region. Once you do this, the screen will say how many regions were generated. Simply undo if you do not wish for your objects to become regions.

Message 15 of 17
roland.r71
in reply to: Anonymous

Smiley LOL ROFL

 

oldPost.jpg

 

The (A) correct answer being:

(if (setq ss (ssget "_I"))(sslength ss))

Your 'solution' is pretty exotic, I'll give you that.

... but ok, Welcome to the forum! Smiley Wink

Message 16 of 17
Anonymous
in reply to: Anonymous

i am using simple method, select the object and just say delete then see the command box it will show  you how many object deleted, after make 'undo'😁

Message 17 of 17
Kent1Cooper
in reply to: Anonymous

The simplest way of all [now*] is to simply have the Properties palette up.  [I do all the time anyway.]  If you have things selected, it reports directly how many:

SelectedQuantity.PNG

The "All" indicates that there's more than one object type among the selection -- if they're all of one kind, it will show that directly.  If it's All, and you pick the pull-down, it breaks it down and tells you how many of each of the different object types involved.

 

* This may not have been available in 2002 when this thread originated.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups