×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VBA Viewport to ModelSpace coordinates..

VBA Viewport to ModelSpace coordinates..

VBA Viewport to ModelSpace coordinates..

(OP)
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..

RE: VBA Viewport to ModelSpace coordinates..

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.

RE: VBA Viewport to ModelSpace coordinates..

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close