Author Topic: How do I get the xref path of an active viewport?  (Read 2353 times)

0 Members and 1 Guest are viewing this topic.

commodore

  • Newt
  • Posts: 51
How do I get the xref path of an active viewport?
« on: February 27, 2008, 01:18:10 PM »
MEP 2008
I have a View drawing with 2 constructs xref'd into it.
This View drawing is then xref'd into the sheet and then the viewport is then resized to show only a portion of the view drawing.

In the Sheet
When my program runs the viewport has already been selected.
Using anything BUT VB how can I get the path of an xref in an Active viewport?

Currently I am getting the corners of the active viewport and using ssget "c" but it only works on some viewports.I have 2 that the clips are of smaller areas, though they still display objects, ssget "c" will not find anything in the viewport.

I can find all the xref's in the sheet, is there a way to find out what viewports they are in (working the problem backwards)?
Is there a better link between the viewport and the xref it contains that I can get?

Thanks
« Last Edit: February 27, 2008, 02:39:37 PM by commodore »

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I get the xref path of an active viewport?
« Reply #1 on: February 27, 2008, 01:30:03 PM »
First welcome to TheSwamp.

If you are using ssget you need to make sure that they viewports are on screen.  If they are not on screen ssget will not work.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

commodore

  • Newt
  • Posts: 51
Re: How do I get the xref path of an active viewport?
« Reply #2 on: February 27, 2008, 02:43:15 PM »
The viewports are definately on screen and visible when the program runs.

A little more info... On the viewports that fail, if I resize the viewport to make it larger (including more objects), at some point it ssget does eventually find something and the program runs fine.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I get the xref path of an active viewport?
« Reply #3 on: February 27, 2008, 02:51:47 PM »
You may need to post the routine.

Is the viewport view at a difference ucs?  This could be a problem.

You might be able to find some help in this routine that draws a guide of the viewport in model space.

http://www.theswamp.org/index.php?topic=9461.0
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

commodore

  • Newt
  • Posts: 51
Re: How do I get the xref path of an active viewport?
« Reply #4 on: February 27, 2008, 03:24:57 PM »
It appears all the viewports are world ucs.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I get the xref path of an active viewport?
« Reply #5 on: February 27, 2008, 03:30:41 PM »
It appears all the viewports are world ucs.
Maybe post the code and a sample drawing if you can.

Or maybe someone else has some ideas.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

commodore

  • Newt
  • Posts: 51
Re: How do I get the xref path of an active viewport?
« Reply #6 on: February 28, 2008, 08:52:18 AM »
Thank you for trying to help me.
I got the program to work, I did not solve the problem, but rather adapted the program to it.
If the program did not find the viewport xref on the first attempt then it will change the viewport scale so that more of the xref is in the ssget "c" 's window, then find the xref, then change the scale back.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How do I get the xref path of an active viewport?
« Reply #7 on: February 28, 2008, 11:09:26 AM »
Glad you found some way to make it work for you.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.