Selecting a Viewport

Selecting a Viewport

Anonymous
Not applicable
202 Views
2 Replies
Message 1 of 3

Selecting a Viewport

Anonymous
Not applicable
Another question from a beginning VB programmer. I want to select a viewport on screen. However, I don't want it to be in a SelectionSet object. Rather, I want to refer to it as a Viewport object. I don't know if I asked this question correctly. For example, I want to refer to it as:
ThisDrawing.Viewport.Item("vp1") As AcadViewport
Rather than:
ThisDrawings.SelectionSets.Item("ss1") As AcadSelectionSet

Thanks, Will Massie, Sause Brothers
0 Likes
203 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
You only two choices for interactive selection: SelectOnScreen or GetEntity.

If you use SelectOnScreen, you can use a filter to disqualify anything that
isn't a viewport. Having done that, you now know that your selection
contains only viewports so you can safely call viewports methods against the
generic ss.Item(x).

If you use GetEntity, you can declare the variable you'll be passing to
GetEntity as an AcadPViewport or any other specific type of drawing entity.
This is a neat little trick because it throws an exception if the user picks
anything other than that kind of object. A simple error trap will allow you
to intercept the problem and prompt the user for another object.

--
"If you want to be somebody else change your mind"
http://www.acadx.com
http://vbxtender.sourceforge.net
0 Likes
Message 3 of 3

Anonymous
Not applicable
Viewports don't have names, but they do have handles,
so if you have a viewport at one point, and want to
refer to it at some other point, you could store its
handle in a variable and then use HandleToObject().

You could do the same with ObjectIDs but they're not
persistent.

"sausewill" wrote in message
news:f1011f6.-1@WebX.maYIadrTaRb...
> Another question from a beginning VB programmer. I want to select a
viewport on screen. However, I don't want it to be in a SelectionSet object.
Rather, I want to refer to it as a Viewport object. I don't know if I asked
this question correctly. For example, I want to refer to it as:
> ThisDrawing.Viewport.Item("vp1") As AcadViewport
> Rather than:
> ThisDrawings.SelectionSets.Item("ss1") As AcadSelectionSet
> Thanks, Will Massie, Sause Brothers
>
>
0 Likes