Why Whole Drawing Shifted by +3.875",+2.875" After Using (command "view" "top")?

Why Whole Drawing Shifted by +3.875",+2.875" After Using (command "view" "top")?

Anonymous
Not applicable
537 Views
2 Replies
Message 1 of 3

Why Whole Drawing Shifted by +3.875",+2.875" After Using (command "view" "top")?

Anonymous
Not applicable

Somehow I find that everything in a drawing shifted by +3.875" in X, and +2.875" in Y after I have used the following command:

 

(command "view" "top")

 

I find the same strange result if I use the same command through AutoCAD menu (View --> 3D Views --> Top).

 

You can use the attached drawing to see the strange effect.  Open it and locate the green dot that is at (0,0) coordinates near the lower right corner of the main area of the drawing.  You should see that the coordinates of the green dot is (0,0).  And then issue (command "view" "top").  Check the coordinates of the green dot again.  When I do this in my computer, I find that the coordinates of the green dot has shifted to (0.378,2.378).

 

Why does this happen?

 

The reason why I use that command is that I have a program that needs to process many drawings in a batch fashion. I don't know which view a drawing is being shown when my program is processing it.  Therefore, I want the drawing to be in a "known" view to avoid any complication to the rest of the program.

 

I try at least several other drawings.  And I find all of them have various degree of the same problem.  The only difference is how much everything on the drawing are shifted.

 

By the way, I see the same problem with that drawing using AutoCAD-2012 and AutoCAD-2014.

 

Thanks in advance for any explanation or suggestion.

 

Jay Chan

0 Likes
Accepted solutions (1)
538 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

The Circle is at 0,0 only in some other-than-World Coordinate System.  Look at the UCS icon [not indicating World], and look at the Circle's entity data or Center VLA Property, which show WCS values and will confirm them as non-integers there, whereas List and the Properties box will show current-UCS values.  Going to Top View changes it to the WCS [see changed UCS icon indication].  Nothing has moved -- only the point of view has been changed.  Much of the content is also almost 100' down in the Z direction, and other content at assorted other elevations.  Do you have routines that change the UCS and don't change it back?  Do you use a drawing template file that isn't in the WCS?

 

EDIT:  I'm not sure why you're doing View -> Top when it's already looking straight down from above, but assuming you're sometimes starting from a different viewing angle, if you want to switch view direction without changing the UCS as View does, try ViewsNoZoom.lsp, available here.  It contains multiple commands -- the one you would want in this case is called VOO [= View, Orthogonal, Overhead].  Its main purpose is to avoid the Zoom to the Extents that happens in View and UCS changes, for which it uses a different approach [DVIEW] than restoring named Views or changing the UCS, and consequently isn't affected by whether a UCS is saved along with a View definition.

Kent Cooper, AIA
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for pointing out exactly what causes the coordinates 'seems" to shift.

 

Yes, (command "view' "top") forces the drawing from UCS to WCS.  Yes, the "seemingly shifted" coordinates of the green dot are actually the coordinates in term of WCS, and they have not been shifted, and this is not an error.  I would not have figured this out if you didn't tell me.

 

I have fixed this problem by NOT using (command "view" "top").  I really don't need to use it in that part of my program anyway because that specific type of drawing can only have plan-view and nothing else.

 

The reason why the WCS not equal to UCS has to do with this drawing was actually generated from the layout-tab of a large drawing.  Therefore, the WCS of this drawing is in term of the size of the viewport in the layout tab of that large drawing.  My program has re-scaled this drawing and has set the UCS of this drawing to match the large drawing.  This all works fine -- until the program uses (command "view" "top"), and inadvertently changed back to WCS.

 

The size of the viewport in the layout tab in the large drawing happens to be in letter-size (11"x8").  That's explains why the WCS of the green dot is (3.875",3.375").

 

This all makes sense to me now.

 

Also thanks for offering of your program to change the view of the drawing without using (command "view" "top").  I will take a look of it soon after this post.  I may not use it right now.  But this may come in handy.

 

Jay Chan

0 Likes