.NET

Reply
Distinguished Contributor
wesbird
Posts: 359
Registered: ‎12-05-2003
Message 1 of 2 (160 Views)

How to change UCS in the code

160 Views, 1 Replies
04-02-2006 04:07 PM
I must lost my mind. This is should be simple. please forgive me.
In AutoCAD, we can type UCS, new, then create a new UCS whatever you want.
In C#, How I can do it?
I found how to create a UcsTableRecord just like create a new layer. but I have no idea to set the UCS I just created current.
At autocad command line, I can type UCS, Restore, and then the name of UCS.
In VBA, ThisDrawing.ActiveUCS = ... do the job.
I would not use SendCommandToString.
Is there any thing I am missing?



Thank you
Wes Message was edited by: weslleywang
Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
New Member
François Gansoinat
Posts: 1
Registered: ‎10-18-2006
Message 2 of 2 (160 Views)

Re: How to change UCS in the code

10-18-2006 01:24 AM in reply to: wesbird
Public Sub ChangeUcsByLine(ByVal lineObj As AcadLine, ByVal strName As String)

'Fait un offset de la ligne pour trouver l'axe Y
Dim offsetObj As Object
offsetObj = lineObj.Offset(10)
Dim offsetLineObj As AcadLine = offsetObj(0)

docObj.UserCoordinateSystems.Add(lineObj.StartPoint, lineObj.EndPoint, offsetLineObj.StartPoint, strName)
docObj.ActiveUCS = docObj.UserCoordinateSystems.Item(strName)

offsetLineObj.Delete()

End Sub
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.