AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
Anonymous
288 Views, 3 Replies

Add Cogo Points

I am getting error with the code below.
Ultimately, I would like to add cogo points, by entering them in command line, in the database as well as in the drawing.
Can anyone correct my code?
Thanks.

Sub points_add()

Dim Coordinates(0 To 2) As Double
Dim newpoint As AeccCogoPoint

Coordinates(1) = ThisDrawing.Utility.GetDistance(, "ENTER NORTHING: ")
Coordinates(0) = ThisDrawing.Utility.GetDistance(, "ENTER EASTING: ")
Coordinates(2) = ThisDrawing.Utility.GetDistance(, "ENTER ELEVATION: ")

newpoint = Object.Add(Coordinates, kCoordinateFormatENZ)

End Sub

LDD 2006
Civil Design 2006
Windows 2000
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

A few more questions:

Can I define the "Point Number"?
Can I define the "Description"?

Thanks a lot.
Message 3 of 4
Anonymous
in reply to: Anonymous

What is your "Object"?

Did you look at the example code in the LDT Developer help?

Here's a snip......

Sub Example_Add_CogoPoints()

' This function adds a new CogoPoint to the CogoPoints collection.
Dim cogoPnts As AeccCogoPoints
Dim newCogoPnt As AeccCogoPoint
Set cogoPnts = AeccApplication.ActiveProject.CogoPoints

' Get a point
Dim newPnt As Variant
newPnt = ThisDrawing.Utility.GetPoint(, "Select point location: ")

' Add CogoPoint
Set newCogoPnt = cogoPnts.Add(newPnt, kCoordinateFormatXYZ)

MsgBox "The Number for the new CogoPoint is: " & newCogoPnt.Number,
vbInformation, "Add Example"

End Sub

wrote in message news:5425140@discussion.autodesk.com...
I am getting error with the code below.
Ultimately, I would like to add cogo points, by entering them in command
line, in the database as well as in the drawing.
Can anyone correct my code?
Thanks.

Sub points_add()

Dim Coordinates(0 To 2) As Double
Dim newpoint As AeccCogoPoint

Coordinates(1) = ThisDrawing.Utility.GetDistance(, "ENTER NORTHING: ")
Coordinates(0) = ThisDrawing.Utility.GetDistance(, "ENTER EASTING: ")
Coordinates(2) = ThisDrawing.Utility.GetDistance(, "ENTER ELEVATION: ")

newpoint = Object.Add(Coordinates, kCoordinateFormatENZ)

End Sub

LDD 2006
Civil Design 2006
Windows 2000
Message 4 of 4
Anonymous
in reply to: Anonymous

The description is easy, just modify the RawDescription property of the
newPoint.

For the point number, that's a bit trickier. You must use the
NextPointNumber property of the CogoPoints collection to set it to the
number you want your next point to have. BUT, you must check to make sure
that number is available, or an error will be thrown.

wrote in message news:5425166@discussion.autodesk.com...
A few more questions:

Can I define the "Point Number"?
Can I define the "Description"?

Thanks a lot.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report