Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Viewport to ModelSpace coordinates..

Status
Not open for further replies.

basepointdesignz

Programmer
Jul 23, 2002
566
GB
Hi,

I was just pondering a 'How To' in VBA, for a program I am trying to write..

Can I find out the actual ModelSpace extents of a viewport in PaperSpace? What I'm trying to mean is; say you have a viewport in a PaperSpace layout - can i have VBA find out the ModelSpace bounding box or similar coordiantes of the view you can see in the viewport? Anyone still with me?

Ok, here's another way of explaining it. I want the program to:

1: Ask User to select a viewport..
2: Create a modelspace view of exactly what you can see in the viewport..
3: Add a hyperlink to the viewport, leading to the newly created modelspace view..

So, it will make navigating through drawings a lot easier, especially for other people picking up someone else's drawing half way through..

Any ideas..



Cheers,

Paul
basepointdesignzltd..
P4 3.0Ghz / 2GB RAM
XP Pro SP2
Sapphire X1950 512MB Dual-DVi Graphics Card..
 
Well I could help you out if you were using Vlisp...

The viewport has properties that allow you to extract what the view in MS is. Something like center cooordinates, width & height. I haven't tried to see how an irregular viewport works.
 
There is either a 'bug' in all the code Ive seen to extract this data, or there's something missing.

All the code Ive tried is *slightly off* when mapping to modelspace. The code that I *have* run that seems to work fine actually draws a rectangle in paperspace, does the equivalent of a "chspace" command, and gets the coordinates of the rectangle.

The drawing of the rectangle in MS marks the drawing as 'dirty', which later calls a prompt to save, even if you erase the rectangle. I since moved on to other projects, but now wonder if had set an "Undo" mark before running this routine, and then run the undo back, if it would have left the document in a pristine state.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top