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
Thanks
Ray C.
This is what I am trying to do, but it fails.
AcadApp.ActiveDocument.ActiveUCS = AcadApp.ActiveDocument.UserCoordinateSystems.Item("World")
Any suggestions are appreciated.
Ray C.
Hello Ray,
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
Regards,
Balaji
Hi Balaji!
But this is not real WCS but only UCS with name "wcs". I think that it's a different things.
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Hi Alex,
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.
Regards,
Balaji