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
Solved! Go to Solution.
Solved by Partha.Sarkar. Go to Solution.
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.
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 -
Hope this helps!
Thanks,
Partha
Did you check the blog post ?
Does it help you ?
Thanks,
Partha
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.
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