Scion Posted December 6, 2015 Posted December 6, 2015 I have few hundreds of autocad drawings which are maps. My customer changed his coordinate system for maps and wants me to change all the old maps to new coordinate system. He didn't accept that I define new UCS for those maps but insists that I must move and rotate all the objects in the map to new position in World UCS. Bigger problem than moving and rotate all objects was elevation numbers which were normal acad text objects containing earth surface elevation as number. I made a VBA program and solved those problems with it. But a new problem came out. Every drawing has 10 to 40 layouts and now every viewport in those layouts points at wrong place in model space. I have been trying to work out how to fix it with VBA but without success. So is here anybody who can help me with this problem? Quote
BIGAL Posted December 6, 2015 Posted December 6, 2015 (edited) This may be a way the variable Viewctr is the center pt of a viewport so read all viewports first and then translate to new co-ords and reset the zoom center for each layout then do your move plan. Note Viewctr changes as you go to each viewport. Use zoom c newcpt must be in model space. lisp (command "zoom" "c" newpt "") Note provided you have not zoomed in the viewport the scale should be correct Almost forget need to check that viewport is not locked. Not tested a lisp version (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ) (foreach tabname plotabs (setvar "ctab" tabname) (command "mspace") (setq cpt (getvar "viewctr")) (setq cpt (list (+ x (car cpt))(+ y (cadr cpt))(+ z (caddr cpt)))) (command "z" "c" cpt "") ) Edited December 7, 2015 by BIGAL Quote
tombu Posted December 10, 2015 Posted December 10, 2015 I have few hundreds of autocad drawings which are maps. My customer changed his coordinate system for maps and wants me to change all the old maps to new coordinate system. He didn't accept that I define new UCS for those maps but insists that I must move and rotate all the objects in the map to new position in World UCS. Bigger problem than moving and rotate all objects was elevation numbers which were normal acad text objects containing earth surface elevation as number. I made a VBA program and solved those problems with it. But a new problem came out. Every drawing has 10 to 40 layouts and now every viewport in those layouts points at wrong place in model space. I have been trying to work out how to fix it with VBA but without success. So is here anybody who can help me with this problem? Next time just wblock the entire drawing after you define the new UCS. In the new drawing, the world coordinate system (WCS) is set parallel to the user coordinate system (UCS). http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-F26FC1CE-45C9-4C85-9DB9-19B6A597D87B Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.