.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing from a user defined Coordinate System back to the WCS

5 REPLIES 5
Reply
Message 1 of 6
SRayC
467 Views, 5 Replies

Changing from a user defined Coordinate System back to the WCS

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.

5 REPLIES 5
Message 2 of 6
mzakiralam
in reply to: SRayC
Message 3 of 6
SRayC
in reply to: mzakiralam

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.

Message 4 of 6
Balaji_Ram
in reply to: SRayC

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

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Message 5 of 6

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
Expert Elite Member

Message 6 of 6
Balaji_Ram
in reply to: SRayC

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

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost