Selected Objects
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Selected Objects

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
srinivasan
Guest





Posted: Fri Jan 07, 2005 5:50 pm    Post subject: Selected Objects Reply with quote

Hello all

Is there any way to find the list of objects selected in command.

Thanks in advance.
Sri

Back to top
Oberer
Guest





Posted: Fri Jan 07, 2005 6:48 pm    Post subject: Re: Selected Objects Reply with quote

if you're searching for a particular object type, you may try the TypeOf(<object>) test.

Sub test()
On Error Resume Next
Dim oSS As AcadSelectionSet
Dim oEnt As AcadEntity
Set oSS = ThisDrawing.SelectionSets.Add("TEST1")
oSS.SelectOnScreen

For Each oEnt In oSS
Debug.Print oEnt.ObjectName
Next oEnt

End Sub
Back to top
srinivasan
Guest





Posted: Sat Jan 08, 2005 9:49 am    Post subject: Re: Selected Objects Reply with quote

Thanks for the reply.

Actually what i need is to get the objects
which had been selected for editing comands like
move,copy etc.

The stage where i need is
Command:Copy
Select objects : user selecting objects
Select objects :

I need to know programatically the objects selected by the
user through any of the events.Is this possible.

Sri

Back to top
Oberer
Guest





Posted: Mon Jan 10, 2005 5:50 pm    Post subject: Re: Selected Objects Reply with quote

srinivasan ,
you may want to check out the begin command event...
Back to top
Ledi
Guest





Posted: Tue Jan 11, 2005 10:06 am    Post subject: Re: Selected Objects Reply with quote

dim SSET as acadselectionset
Set SSET = ThisDrawing.PickfirstSelectionSet

this should work for you
Back to top
srinivasan
Guest





Posted: Tue Jan 11, 2005 10:06 am    Post subject: Re: Selected Objects Reply with quote

Hi Oberer

The begin command event fires as soon as i am start the command,the selection comes only after this step.

regards
Sri
Back to top
srinivasan
Guest





Posted: Tue Jan 11, 2005 5:46 pm    Post subject: Re: Selected Objects Reply with quote

Thanks Ledi

But the problem is i am not getting the selection count with
Pickfirst selection since it always returns me a count 0.

Regards
Sri
Back to top
Ledi
Guest





Posted: Tue Jan 11, 2005 8:48 pm    Post subject: Re: Selected Objects Reply with quote

with pickfirstselectionset you only get objects that are selected on screen! If no objects are selected then count is going to be 0.
Back to top
srinivasan
Guest





Posted: Wed Jan 12, 2005 9:43 am    Post subject: Re: Selected Objects Reply with quote

Yes but only after giving command i am going to select object.
Therefore i think pickfirst selection cannot be used.

Regards
Sri
Back to top
Ledi
Guest





Posted: Wed Jan 12, 2005 10:03 am    Post subject: Re: Selected Objects Reply with quote

you can select first and then write command in commnad line ;)

you tried with thisdrawing.activeselectionset?
Back to top
Kevin Terry
Guest





Posted: Wed Jan 12, 2005 7:38 pm    Post subject: Re: Selected Objects Reply with quote

you have to wrap your vba routine with a lisp call like this:

(defun c:Macro_Name ()
(vla-runmacro (vlax-get-acad-object) "Macro_Name")
(princ)
)


Kevin

"srinivasan" <nospam@address.withheld> wrote in message
news:7054855.1105505063937.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
Yes but only after giving command i am going to select object.
Therefore i think pickfirst selection cannot be used.

Regards
Sri
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB