Working in ACAD2012 via the COM object. Need guidence on how to change from a user defined coordinate system back to the WCS.
W7, VS 2012
This is what I am trying to do, but it fails.
AcadApp.ActiveDocument.ActiveUCS = AcadApp.ActiveDocument.UserCoordinateSystems.Item("World")
Any suggestions are appreciated.
There is no such UCS that is named "world".
To reset it to world, you can create a new UCS with appropriate coordinate system and set it as active.
Dim org(0 To 2) As Double Dim oucs As AcadUCS Dim xpt(0 To 2) As Double xpt(0) = 1 Dim ypt(0 To 2) As Double ypt(1) = 1 oucs = acadDoc.UserCoordinateSystems.Add(org, xpt, ypt, "wcs") acadDoc.ActiveUCS = oucs
You are right. But, the COM API is quite limited in what it can do.
I do not see any way to set it to World using the COM API other than creating a UCS that matches the WCS coordinate system.
If there is not specific reason for using the COM API, simply setting the "Editor.CurrentUserCoordinateSystem" to an identity matrix would set it to World.
Access a broad range of knowledge to help get the most out of your products and services.