Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Start and end point of alignment API Visual Basic . NET

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
668 Views, 3 Replies

Start and end point of alignment API Visual Basic . NET

Hello, 

 

I need to determine and extract the coordinates of the start and end point of the alignment.

 

Can someone help me with an example .net code.

 

Thank you very much.

 

Best regards.

 

Mauro Vega

 

AutoCAD Civil 3D 2018.1

Intel Core i7-6700HQ CPU 2.6 GHZ

32 GB RAM 2133 MHz

NVIDIA Quadro M3000M

Windows 10 Pro 64 Bits

Tags (1)
3 REPLIES 3
Message 2 of 4
Jeff_M
in reply to: Anonymous

I don't do VB, so no example. However, the Alignment Object inherits from the AutoCAD Curve object, so it's properties can be used on the alignment. A Curve object has the StartPoint and EndPoint properties which is what you are looking for.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 4
sybold
in reply to: Anonymous

this should get you on your way,

 

            '' autocad
            Dim doc As Document = Core.Application.DocumentManager.MdiActiveDocument
            Dim db As Database = doc.Database
            Dim ed As Editor = doc.Editor
            Dim trans As Transaction = db.TransactionManager.StartTransaction

            '' civil
            Dim cdoc As CivilDocument = CivilApplication.ActiveDocument

            '' select alignment
            Dim promptentop As New PromptEntityOptions(vbLf + "select alignment")
            promptentop.SetRejectMessage("no alignment")
            promptentop.AddAllowedClass(GetType(Alignment), True)
            promptentop.AllowNone = False
            Dim promptentres As PromptEntityResult = ed.GetEntity(promptentop)
            If promptentres.Status <> PromptStatus.OK Then
                ed.WriteMessage(vbLf + "error, no alignment")
            End If
            Dim alm As Alignment = trans.GetObject(promptentres.ObjectId, OpenMode.ForRead)

            '' alignment stuff
            Dim start As Point3d = alm.StartPoint
Message 4 of 4
Anonymous
in reply to: sybold

Hello Sybold,

 

Thank you very much, you are very kind.

 

This was just what I needed.

 

Best regards.

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report