Visual Basic Customization

Visual Basic Customization

Reply
Contributor
tothpal
Posts: 14
Registered: ‎10-12-2004
Message 1 of 2 (67 Views)

How to create new UCS object?

67 Views, 1 Replies
05-04-2005 02:54 AM
Hi!
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 = ...)

Thanks

Paul


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
fantum
Posts: 313
Registered: ‎12-06-2004
Message 2 of 2 (67 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.
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.