Visual Basic Customization

Posts: 14
Registered: ‎10-12-2004
Message 1 of 2 (62 Views)

How to create new UCS object?

62 Views, 1 Replies
05-04-2005 02:54 AM
I want to create a new UCS, but the following code doesn't create the new UCS and doesn't send any error message.
The oUCS object still Nothing after the code run. Can anyone help me if the last line is correct or not? ( Set oUCS = ...)



Dim oUCS As AcadUCS
Dim oDOC as AcadDocument
Dim origin(0 To 2) As Double
Dim xAxisPoint(0 To 2) As Double
Dim yAxisPoint(0 To 2) As Double

origin(0) = 2: origin(1) = 2: origin(2) = 0
xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
yAxisPoint(0) =2: yAxisPoint(1) =3: yAxisPoint(2) = 0

Set oDOC=Autocad.ActiveDocument
Set oUCS = oDOC.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
Distinguished Contributor
Posts: 313
Registered: ‎12-06-2004
Message 2 of 2 (62 Views)

Re: How to create new UCS object?

05-04-2005 05:20 AM in reply to: tothpal
Works for me but the call to the global Autocad.ActiveDocument looks dangerous.

You are not logged in.

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

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