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: 

Points in Survey Database

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Edoc13
597 Views, 5 Replies

Points in Survey Database

COM is new to me.

I have an instance of "AutoCAD.Application.19"

I have an InterfaceObject of "AeccXUiSurvey.AeccSurveyApplication.10.0"

I verified that a Survey Database/Project is open (not using COM).

 

From here I'm lost. I like to be able to read and write to all points within the Survey Database.

Could someone provide an example?

TIA

5 REPLIES 5
Message 2 of 6
Edoc13
in reply to: Edoc13

Here is some code of where I stand.

 

Using doclock As DocumentLock = docCol.MdiActiveDocument.LockDocument()
    Using m_trans As Transaction = m_Database.TransactionManager.StartTransaction()
        Dim oApp As AcadApplication = DirectCast(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, AcadApplication)
        Dim aeccSurveyApp As AecUiSurvey.AeccSurveyApplication = DirectCast(oApp.GetInterfaceObject(m_sSurveyAppId), AecUiSurvey.AeccSurveyApplication)
        Dim aeccSurveyDoc As AecUiSurvey.AeccSurveyDocument = DirectCast(aeccSurveyApp.ActiveDocument, AecUiSurvey.AeccSurveyDocument)
       
  Dim SurveyProj As Autodesk.Civil.SurveyProject = Autodesk.Civil.ApplicationServices.CivilApplication.SurveyProjects.GetCurrentProject 'Verified on Dialog Load

        Dim foo As AecSurvey.AeccSurveyPoints = aeccSurveyDoc. (*** HELP NEEDED HERE! ***)
  
    End Using
End Using

 

Any help would be appreciated.

Message 3 of 6
Partha.Sarkar
in reply to: Edoc13

Hi,

 

Here is a sample VB.NET code snippet :

 

       

Dim oSurveyProjects AsAeccSurveyProjects = CType(oAeccSurveyDB.Projects, AeccSurveyProjects)

       

' get the 1st Project from the Survey Projects collection

       

Dim oSurveyProject AsAeccSurveyProject = oSurveyProjects.Item(0)

       

IfNot (oSurveyProject IsNothing) Then

         

' Get the Project Name

           ed.WriteMessage(vbCrLf +

"Projcet Name : " + " " + oSurveyProject.Name.ToString())

         

' IAeccSurveyProject:: GetPointByNumber

         

' Gets the Survey Point instance with the input point number.

         

Dim oSurveyPoint AsAeccSurveyPoint = oSurveyProject.GetPointByNumber(1)

         

' Check the Point Properties Name, Easting, Northing & Elevation

          ed.WriteMessage(vbCrLf +

"Point Name : " + oSurveyPoint.Name.ToString() )

          ed.WriteMessage(vbCrLf +

"Easting : " + oSurveyPoint.Easting.ToString() + " " +

                         

"Northing : " + oSurveyPoint.Northing.ToString() + " " +

                         

"Elevation : " + oSurveyPoint.Elevation.ToString())

       

EndIf  

 

 

For your benefit, I have published the following blog post with a complete code sample at our IM DevBlog -

 

http://adndevblog.typepad.com/infrastructure/2013/08/accessing-survey-database-points-using-autocad-...

 

Hope this helps!

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 4 of 6

Did you check the blog post ?

Does it help you ?

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 5 of 6
Edoc13
in reply to: Partha.Sarkar

Thanks.

It put me on the right track for what I need to do.

 

I'm assuming I can only read points from the Survey Database and not write to it.

If so, I'll create a workaround using PointGroups and then take action manually i.e. not by API.

Message 6 of 6
Partha.Sarkar
in reply to: Edoc13

I am glad to know that was helpful to you!

 

There is no API exposed yet to create points in Survey database.

 

FYI - COGO points and associated features are fully exposed in .NET API and if you want to create COGO points using API, that's possible. You can refer to our IM DevBlog for code samples if you need.

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report