Print Page | Close Window

using a selection

Printed From: CAD Forum
Category: EN
Forum Name: AutoCAD
Forum Description: Discussion about AutoCAD and AutoCAD LT, viewers, DWG and DWF formats, Design Review, AutoCAD 360, add-ons
URL: https://www.cadforum.cz/forum_en/forum_posts.asp?TID=47
Printed Date: 31.May.2026 at 18:10


Topic: using a selection
Posted By: vetlel
Subject: using a selection
Date Posted: 13.Aug.2007 at 16:51
Hello all,
I have written a macro many years ago that uses surfaces in a user selectable layer, and processes these surfaces through loads of complicated code.

Seeing it is years ago, and i got a little rusty in the mean time:

Is it possible for a macro to use the selection you made on the screen in autocad instead of a layer?

I hope my question is clear...

Any pointers would be greatly appreciated

Patrick.



Replies:
Posted By: Vladimir Michl
Date Posted: 13.Aug.2007 at 17:07
Was it a LISP macro?
 
The object selection function - (ssget) - has a lot of options allowing to select interactively, by layer, or by other properties, plus combinations of these.
 
E.g.:
(ssget '((0 . "CIRCLE"))) -- selects all circles in user selected objects
(ssget "_X" '((0 . "CIRCLE"))) -- selects all circles in the whole drawing
(ssget "_X" '((8 . "MYLAYER"))) -- selects all objects in the MYLAYER layer
(ssget "_W") -- starts a plain window-selection
etc.


-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: vetlel
Date Posted: 13.Aug.2007 at 17:45
Mmmm, lisp? lost me there.

It is some code written for autocad 2002 (MDT6)
Here is a small part of the code i have:
<code>

                    intCodes(0) = 0
                    varCodeValues(0) = "assurface"
                    ' Layer selection
                    intCodes(1) = 8
                    varCodeValues(1) = ComboBoxlayer.Text
                    surfacesSS.Select acSelectionSetAll, , , intCodes, varCodeValues
</code>

What it does now, is that it selects all the entities that correspond with certain criterias in the layer you tell it to look.

I would like it to do the same but now not looking in a certain layer, but selecting within a selection you made in autocad (when it turns blue)

Hope i explained myself a little better now...


Posted By: Vladimir Michl
Date Posted: 13.Aug.2007 at 18:04

Aha - not LISP but VBA.

You can try:

SurfacesSS.SelectOnScreen



-------------
Vladimir Michl (moderator)
ARKANCE - https://arkance.world" rel="nofollow - https://arkance.world - Autodesk Platinum Partner


Posted By: vetlel
Date Posted: 13.Aug.2007 at 18:11
Cheers!
I came around that, but for some reason it didn't work.
But at least i know i am on the right track now...

I will keep you posted how things turn out.



Print Page | Close Window