Points in Survey Database

Points in Survey Database

Anonymous
Not applicable
1,056 Views
5 Replies
Message 1 of 6

Points in Survey Database

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
1,057 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

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.

0 Likes
Message 3 of 6

Anonymous
Not applicable
Accepted solution

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

Message 4 of 6

Anonymous
Not applicable

Did you check the blog post ?

Does it help you ?

 

Thanks,

Partha

0 Likes
Message 5 of 6

Anonymous
Not applicable

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.

0 Likes
Message 6 of 6

Anonymous
Not applicable

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

0 Likes