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: 

AeccSurveyFigure Start Point

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Civil3DReminders_com
408 Views, 3 Replies

AeccSurveyFigure Start Point

Is it possible to set the Start Point of an AeccSurveyFigure? I can create and add arcs and lines to the survey figure, but I'm not seeing where I can set the start or end point of it. There is a Start Point property for X and Y, but those are both ReadOnly. I'm also not seeing a way to delete nodes from the survey figure because I could then add a line from the orgin to the start point and then delete the first one.

 

    Public Shared Function CreateSurveyFigureFromPolyline(ByRef polyObjId As ObjectId, ByVal figureName As String) As Handle
        ' Get the AutoCAD Editor
        Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor

        ' Get the Survey Application and AeccSurveyDatabase
        Dim oAcadApp As Autodesk.AutoCAD.Interop.AcadApplication = GetObject(, "AutoCAD.Application")
        Dim oAeccSurveyApp As AeccSurveyApplication = oAcadApp.GetInterfaceObject(ceApp.SurveyAppProgId)
        Dim oAeccSurveyDoc As AeccSurveyDocument = oAeccSurveyApp.ActiveDocument
        Dim oAeccSurveyDB As AeccSurveyDatabase = oAeccSurveyApp.ActiveDocument.Database

        Dim surveyProj As AeccSurveyProject = oAeccSurveyDB.CurrentProject

        If surveyProj IsNot Nothing Then
            ' now we can access the various Props of AeccSurveyProject object           
            Dim newSurvFigure As AeccSurveyFigure = surveyProj.Figures.Create(figureName)
            Dim poly As Polyline = TryCast(polyObjId.GetObject(OpenMode.ForRead), Polyline)

            For i As Integer = 0 To poly.NumberOfVertices - 1
                If poly.GetSegmentType(i) = SegmentType.Arc Then
                    Dim arcS As CircularArc3d = poly.GetArcSegmentAt(i)
                    newSurvFigure.AddArc(arcS.Radius, poly.GetBulgeAt(i), arcS.Center.X, arcS.Center.Y, arcS.EndPoint.X, arcS.EndPoint.Y)
                Else
                    Dim lne As LineSegment3d = poly.GetLineSegmentAt(i)
                    Dim azmith As Double = Math.Atan((lne.EndPoint.X - lne.StartPoint.X) / (lne.EndPoint.Y - lne.StartPoint.Y))
                    newSurvFigure.AddLineByAzimuthDistance(azmith, lne.Length)

                End If
            Next

            newSurvFigure.IsClosed = poly.Closed

            Dim objIdLong As Long = newSurvFigure.AddToDrawing()
            Dim hndle As Handle = New Handle(objIdLong)

            Return hndle
        End If
        Return Nothing
    End Function

 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
3 REPLIES 3
Message 2 of 4

I haven't done much with Figures, but I think you can do what you want with the AeccSurveyFigureNode : http://docs.autodesk.com/CIV3D/2012/ENU/API_Reference_Guide/com/AeccXSurveyLib__IAeccSurveyFigureNod...
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 4

The first AddLine takes you from 0,0 to the location where you want the surveyfigure to start. It then builds off that, so the First Line really isn't a first line. 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
Message 4 of 4

It also looks like all of the information needs to be entered in as meter values, even if you are in a feet units drawing and feet units for the survey database. 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report