.NET

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

How to change UCS in the code

157 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
New Member
François Gansoinat
Posts: 1
Registered: ‎10-18-2006
Message 2 of 2 (157 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community