Visual Basic Customization

Reply
*Dan
Message 1 of 10 (72 Views)

Possible? Select a specific PS Viewport...

72 Views, 9 Replies
06-23-2005 08:43 AM
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Paul Richardson
Message 2 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-23-2005 09:39 AM in reply to: *Dan
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Paul Richardson
Message 3 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-23-2005 09:45 AM in reply to: *Dan
for the view...

Dim view As AcadView
For Each view In ThisDrawing.Views
Debug.Print view.Name
Next view

"Paul Richardson" wrote in message
news:4883412@discussion.autodesk.com...
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Dan
Message 4 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-24-2005 10:50 AM in reply to: *Dan
Thank you for the input.

If I run the following code, "*Active" is returned. I need some way to make
sure a specific Viewport is active, and then set a named view.
Or even simpler, how would one cycle through each viewport?

Any help is greatly appreciated.

Dan

If I have 5 viewports in paperspace, how would I make changes to the bottom
right viewport for example.
"Paul Richardson" wrote in message
news:4883412@discussion.autodesk.com...
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Paul Richardson
Message 5 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-24-2005 10:53 AM in reply to: *Dan
>Or even simpler, how would one cycle through each viewport?
Is what I posted not what you want?

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

"Dan" wrote in message
news:4884916@discussion.autodesk.com...
Thank you for the input.

If I run the following code, "*Active" is returned. I need some way to make
sure a specific Viewport is active, and then set a named view.
Or even simpler, how would one cycle through each viewport?

Any help is greatly appreciated.

Dan

If I have 5 viewports in paperspace, how would I make changes to the bottom
right viewport for example.
"Paul Richardson" wrote in message
news:4883412@discussion.autodesk.com...
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Dan
Message 6 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-27-2005 11:36 AM in reply to: *Dan
Thanks for the input.
Not sure if I am being clear or not.

If I have 5 viewports in paperspace, the code below just provide the name
"*Active".

This does not help me select the 5th viewort in the bottom righ-hand corner.

I am not sure how to go about it.

Thanks,
Dan
"Paul Richardson" wrote in message
news:4884930@discussion.autodesk.com...
>Or even simpler, how would one cycle through each viewport?
Is what I posted not what you want?

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

"Dan" wrote in message
news:4884916@discussion.autodesk.com...
Thank you for the input.

If I run the following code, "*Active" is returned. I need some way to make
sure a specific Viewport is active, and then set a named view.
Or even simpler, how would one cycle through each viewport?

Any help is greatly appreciated.

Dan

If I have 5 viewports in paperspace, how would I make changes to the bottom
right viewport for example.
"Paul Richardson" wrote in message
news:4883412@discussion.autodesk.com...
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Paul Richardson
Message 7 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-27-2005 12:52 PM in reply to: *Dan
Dan, If you want paperspace viewports
use.

Dim pvport As AcadPViewport
For Each pvport In ThisDrawing.PaperSpace
Debug.Print pvport.ObjectName
Next pvport

Don't see a name property thougt. Don't know
if you can transfer the name of a saved view when
restoring as a paperspace viewport.

Paul
"Dan" wrote in message
news:4886298@discussion.autodesk.com...
Thanks for the input.
Not sure if I am being clear or not.

If I have 5 viewports in paperspace, the code below just provide the name
"*Active".

This does not help me select the 5th viewort in the bottom righ-hand corner.

I am not sure how to go about it.

Thanks,
Dan
"Paul Richardson" wrote in message
news:4884930@discussion.autodesk.com...
>Or even simpler, how would one cycle through each viewport?
Is what I posted not what you want?

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

"Dan" wrote in message
news:4884916@discussion.autodesk.com...
Thank you for the input.

If I run the following code, "*Active" is returned. I need some way to make
sure a specific Viewport is active, and then set a named view.
Or even simpler, how would one cycle through each viewport?

Any help is greatly appreciated.

Dan

If I have 5 viewports in paperspace, how would I make changes to the bottom
right viewport for example.
"Paul Richardson" wrote in message
news:4883412@discussion.autodesk.com...
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*Dan
Message 8 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-27-2005 12:59 PM in reply to: *Dan
still no go....
"Paul Richardson" wrote in message
news:4886388@discussion.autodesk.com...
Dan, If you want paperspace viewports
use.

Dim pvport As AcadPViewport
For Each pvport In ThisDrawing.PaperSpace
Debug.Print pvport.ObjectName
Next pvport

Don't see a name property thougt. Don't know
if you can transfer the name of a saved view when
restoring as a paperspace viewport.

Paul
"Dan" wrote in message
news:4886298@discussion.autodesk.com...
Thanks for the input.
Not sure if I am being clear or not.

If I have 5 viewports in paperspace, the code below just provide the name
"*Active".

This does not help me select the 5th viewort in the bottom righ-hand corner.

I am not sure how to go about it.

Thanks,
Dan
"Paul Richardson" wrote in message
news:4884930@discussion.autodesk.com...
>Or even simpler, how would one cycle through each viewport?
Is what I posted not what you want?

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

"Dan" wrote in message
news:4884916@discussion.autodesk.com...
Thank you for the input.

If I run the following code, "*Active" is returned. I need some way to make
sure a specific Viewport is active, and then set a named view.
Or even simpler, how would one cycle through each viewport?

Any help is greatly appreciated.

Dan

If I have 5 viewports in paperspace, how would I make changes to the bottom
right viewport for example.
"Paul Richardson" wrote in message
news:4883412@discussion.autodesk.com...
I think you want to be saving a vport not a view. Now
restoring this vport in a paperspace layout and retrieve
with this idea.

Dim vport As AcadViewport
For Each vport In ThisDrawing.Viewports
Debug.Print vport.Name
Next vport

gl
Paul
"Dan" wrote in message
news:4883288@discussion.autodesk.com...
I have written code to create a named view, then set that named view. I do
not see a method to select a specific viewport in PS.

If I have 5 viewports, how do I choose between them using VBA code?

Thanks for the insight,
Dan
*MP
Message 9 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-27-2005 01:19 PM in reply to: *Dan
This does not help me select the 5th viewort in the bottom righ-hand corner.

I am not sure how to go about it.

Thanks,
Dan

you're getting closer to answering your own question

The whole problem is how to *You* determine which viewport you want?
First off, which tab is it on?
Next, which viewport on that tab?
Now you say you want the one in the bottom right-hand corner.
assuming you know the coordinates of that viewport you can select it via a
selection set window as an example of one way to locate that particular
viewport

another way would be to iterate the viewports on that tab and check the
coordinates of each one in turn looking for a match to some pre-determined
criteria

another way would be to attach xdata to your viewports to tag them in some
way meaningful to yourself or your program.

etc

hth
Mark
*Dan
Message 10 of 10 (72 Views)

Re: Possible? Select a specific PS Viewport...

06-27-2005 03:10 PM in reply to: *Dan
Thanks for the leads Mark.

I have never attached xdata yet, so I will do some research.

Dan

As far as cycling through the viewports with tab,
"MP" wrote in message
news:4886416@discussion.autodesk.com...
This does not help me select the 5th viewort in the bottom righ-hand corner.

I am not sure how to go about it.

Thanks,
Dan

you're getting closer to answering your own question

The whole problem is how to *You* determine which viewport you want?
First off, which tab is it on?
Next, which viewport on that tab?
Now you say you want the one in the bottom right-hand corner.
assuming you know the coordinates of that viewport you can select it via a
selection set window as an example of one way to locate that particular
viewport

another way would be to iterate the viewports on that tab and check the
coordinates of each one in turn looking for a match to some pre-determined
criteria

another way would be to attach xdata to your viewports to tag them in some
way meaningful to yourself or your program.

etc

hth
Mark

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community