.NET

Reply
Distinguished Contributor
SRayC
Posts: 228
Registered: ‎12-10-2003
Message 1 of 6 (217 Views)

Changing from a user defined Coordinate System back to the WCS

217 Views, 5 Replies
02-24-2014 06:48 AM

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.

Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 2 of 6 (213 Views)

Re: Changing from a user defined Coordinate System back to the WCS

02-24-2014 07:09 AM in reply to: SRayC
Distinguished Contributor
SRayC
Posts: 228
Registered: ‎12-10-2003
Message 3 of 6 (205 Views)

Re: Changing from a user defined Coordinate System back to the WCS

02-24-2014 07:59 AM 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.

ADN Support Specialist
Balaji_Ram
Posts: 737
Registered: ‎03-21-2011
Message 4 of 6 (166 Views)

Re: Changing from a user defined Coordinate System back to the WCS

03-06-2014 11:19 PM 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

Moderator
Alexander.Rivilis
Posts: 1,449
Registered: ‎04-09-2008
Message 5 of 6 (148 Views)

Re: Changing from a user defined Coordinate System back to the WCS

03-07-2014 08:16 AM in reply to: Balaji_Ram

Hi Balaji!

But this is not real WCS but only UCS with name "wcs". I think that it's a different things.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

ADN Support Specialist
Balaji_Ram
Posts: 737
Registered: ‎03-21-2011
Message 6 of 6 (124 Views)

Re: Changing from a user defined Coordinate System back to the WCS

03-08-2014 06:54 PM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!