VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

selected item

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
163 Views, 6 Replies

selected item

hi

is it possible through vba to determine if only one item is selected.... i
wish to use the BeginDoubleClick event to display a dialog box, if the item
selected is a part of a specific group

thanks in advance

cheers

mark
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

I am assuming you have already figured out how to work around the problem
with the PickfirstSelectionSet clearing when your macro starts. I you
haven't, post back here, and I will show you one way.

Now regarding your specific question, just check the Count property of the
PickfirstSelectionSet.

If ThisDrawing.PickfirstSelectionSet.Count = 1 Then
'Only one object is selected
End if

Do you also need help in determining if the object is part of a specific
group?

Chuck

"Mark Dubbelaar" wrote in message
news:E52A515A6571E9B58D18688B5BB4845E@in.WebX.maYIadrTaRb...
> hi
>
> is it possible through vba to determine if only one item is selected.... i
> wish to use the BeginDoubleClick event to display a dialog box, if the
item
> selected is a part of a specific group
>
> thanks in advance
>
> cheers
>
> mark
>
>
Message 3 of 7
Anonymous
in reply to: Anonymous

Chuck,
can you please post the method you mentioned to prevent clearing...?

thanks
Kevin

"Chuck Gabriel" wrote in message
news:B39D8681A5CEDB82D6862D91E15F3F04@in.WebX.maYIadrTaRb...
> I am assuming you have already figured out how to work around the problem
> with the PickfirstSelectionSet clearing when your macro starts. I you
> haven't, post back here, and I will show you one way.
>
> Now regarding your specific question, just check the Count property of the
> PickfirstSelectionSet.
>
> If ThisDrawing.PickfirstSelectionSet.Count = 1 Then
> 'Only one object is selected
> End if
>
> Do you also need help in determining if the object is part of a specific
> group?
>
> Chuck
>
> "Mark Dubbelaar" wrote in message
> news:E52A515A6571E9B58D18688B5BB4845E@in.WebX.maYIadrTaRb...
> > hi
> >
> > is it possible through vba to determine if only one item is selected....
i
> > wish to use the BeginDoubleClick event to display a dialog box, if the
> item
> > selected is a part of a specific group
> >
> > thanks in advance
> >
> > cheers
> >
> > mark
> >
> >
>
>
Message 4 of 7
Anonymous
in reply to: Anonymous

Call your macro from Visual Lisp using the vla-runmacro function.

The syntax is:

(vla-runmacro (vlax-get-acad-object) "MyProject.dvb!MyMacro")

This will prevent the PickFirstSelectionSet from being cleared before you
can use it in your macro.

Note: This will also load your project if it is not already loaded.

"Kevin Terry" wrote in message
news:7CCE1639B6A0DF2ABA8AD58D3F741196@in.WebX.maYIadrTaRb...
> Chuck,
> can you please post the method you mentioned to prevent clearing...?
>
> thanks
> Kevin
>
> "Chuck Gabriel" wrote in message
> news:B39D8681A5CEDB82D6862D91E15F3F04@in.WebX.maYIadrTaRb...
> > I am assuming you have already figured out how to work around the
problem
> > with the PickfirstSelectionSet clearing when your macro starts. I you
> > haven't, post back here, and I will show you one way.
> >
> > Now regarding your specific question, just check the Count property of
the
> > PickfirstSelectionSet.
> >
> > If ThisDrawing.PickfirstSelectionSet.Count = 1 Then
> > 'Only one object is selected
> > End if
> >
> > Do you also need help in determining if the object is part of a specific
> > group?
> >
> > Chuck
> >
> > "Mark Dubbelaar" wrote in message
> > news:E52A515A6571E9B58D18688B5BB4845E@in.WebX.maYIadrTaRb...
> > > hi
> > >
> > > is it possible through vba to determine if only one item is
selected....
> i
> > > wish to use the BeginDoubleClick event to display a dialog box, if the
> > item
> > > selected is a part of a specific group
> > >
> > > thanks in advance
> > >
> > > cheers
> > >
> > > mark
> > >
> > >
> >
> >
>
>
Message 5 of 7
Anonymous
in reply to: Anonymous

Does vl-vbarun exhibit the same behavior as vla-runmacro with respect to
PickFirstSelectionSet?

Steve

"Chuck Gabriel" wrote in message
news:9E465FCB614AFFE1A52D454E07EFB36C@in.WebX.maYIadrTaRb...
> Call your macro from Visual Lisp using the vla-runmacro function.
>
> The syntax is:
>
> (vla-runmacro (vlax-get-acad-object) "MyProject.dvb!MyMacro")
>
> This will prevent the PickFirstSelectionSet from being cleared before you
> can use it in your macro.
>
> Note: This will also load your project if it is not already loaded.
>
> "Kevin Terry" wrote in message
> news:7CCE1639B6A0DF2ABA8AD58D3F741196@in.WebX.maYIadrTaRb...
> > Chuck,
> > can you please post the method you mentioned to prevent clearing...?
> >
> > thanks
> > Kevin
> >
> > "Chuck Gabriel" wrote in message
> > news:B39D8681A5CEDB82D6862D91E15F3F04@in.WebX.maYIadrTaRb...
> > > I am assuming you have already figured out how to work around the
> problem
> > > with the PickfirstSelectionSet clearing when your macro starts. I you
> > > haven't, post back here, and I will show you one way.
> > >
> > > Now regarding your specific question, just check the Count property of
> the
> > > PickfirstSelectionSet.
> > >
> > > If ThisDrawing.PickfirstSelectionSet.Count = 1 Then
> > > 'Only one object is selected
> > > End if
> > >
> > > Do you also need help in determining if the object is part of a
specific
> > > group?
> > >
> > > Chuck
> > >
> > > "Mark Dubbelaar" wrote in message
> > > news:E52A515A6571E9B58D18688B5BB4845E@in.WebX.maYIadrTaRb...
> > > > hi
> > > >
> > > > is it possible through vba to determine if only one item is
> selected....
> > i
> > > > wish to use the BeginDoubleClick event to display a dialog box, if
the
> > > item
> > > > selected is a part of a specific group
> > > >
> > > > thanks in advance
> > > >
> > > > cheers
> > > >
> > > > mark
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 6 of 7
Anonymous
in reply to: Anonymous

No.


"Steve Howatt" wrote in message
news:1BA13122DF994F67BC2144FAEFB5E67B@in.WebX.maYIadrTaRb...
> Does vl-vbarun exhibit the same behavior as vla-runmacro with respect to
> PickFirstSelectionSet?
>
> Steve
>
> "Chuck Gabriel" wrote in message
> news:9E465FCB614AFFE1A52D454E07EFB36C@in.WebX.maYIadrTaRb...
> > Call your macro from Visual Lisp using the vla-runmacro function.
> >
> > The syntax is:
> >
> > (vla-runmacro (vlax-get-acad-object) "MyProject.dvb!MyMacro")
> >
> > This will prevent the PickFirstSelectionSet from being cleared before
you
> > can use it in your macro.
> >
> > Note: This will also load your project if it is not already loaded.
> >
> > "Kevin Terry" wrote in message
> > news:7CCE1639B6A0DF2ABA8AD58D3F741196@in.WebX.maYIadrTaRb...
> > > Chuck,
> > > can you please post the method you mentioned to prevent clearing...?
> > >
> > > thanks
> > > Kevin
> > >
> > > "Chuck Gabriel" wrote in message
> > > news:B39D8681A5CEDB82D6862D91E15F3F04@in.WebX.maYIadrTaRb...
> > > > I am assuming you have already figured out how to work around the
> > problem
> > > > with the PickfirstSelectionSet clearing when your macro starts. I
you
> > > > haven't, post back here, and I will show you one way.
> > > >
> > > > Now regarding your specific question, just check the Count property
of
> > the
> > > > PickfirstSelectionSet.
> > > >
> > > > If ThisDrawing.PickfirstSelectionSet.Count = 1 Then
> > > > 'Only one object is selected
> > > > End if
> > > >
> > > > Do you also need help in determining if the object is part of a
> specific
> > > > group?
> > > >
> > > > Chuck
> > > >
> > > > "Mark Dubbelaar" wrote in message
> > > > news:E52A515A6571E9B58D18688B5BB4845E@in.WebX.maYIadrTaRb...
> > > > > hi
> > > > >
> > > > > is it possible through vba to determine if only one item is
> > selected....
> > > i
> > > > > wish to use the BeginDoubleClick event to display a dialog box, if
> the
> > > > item
> > > > > selected is a part of a specific group
> > > > >
> > > > > thanks in advance
> > > > >
> > > > > cheers
> > > > >
> > > > > mark
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 7 of 7
Anonymous
in reply to: Anonymous

Please let me clarify. The PickfirstSelectionSet clearing behavior I
described probably would not affect code running in an event (like Mark is
doing) anyway. It becomes an issue when you have a macro that you run from
the command line (via lisp) in which you want a selection prompt to be
skipped by way of using the PickfirstSelectionSet.

I hope that made sense.

Chuck

"Chuck Gabriel" wrote in message
news:B7C2C0596F7E18139F16E0FC19162E3A@in.WebX.maYIadrTaRb...
> No.
>
>
> "Steve Howatt" wrote in message
> news:1BA13122DF994F67BC2144FAEFB5E67B@in.WebX.maYIadrTaRb...
> > Does vl-vbarun exhibit the same behavior as vla-runmacro with respect to
> > PickFirstSelectionSet?
> >
> > Steve

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

Post to forums  

Autodesk Design & Make Report

”Boost