I need help getting the crossing point for a survey figure relative to an alignment. I'm trying to use the IntersectWith on my active alignment. I'm able to see my figure in debug mode so, I think I've got access to each survey figure. I think I need to cast the figure as a com object to a acad entity using directcast, but that's where it's going bad. When using the ofigure.GetObjectId it returns an integer value and it fails in VS Express 2010 in the DirectCast when trying to pass the objectId.
The error (if I'm setting this up correctly) :integer cannot be converted to objectid
'Get figure crossing point Dim ofigures As AeccSurveyFigures = oSurveyProject.Figures 'Dim figEnt As Autodesk.AutoCAD.DatabaseServices.Entity Dim intPoint As New Point3dCollection() For i = 1 To ofigures.Count - 1 Dim ofigure As AeccSurveyFigure = ofigures.Item(i) Dim figObjectId = ofigure.GetObjectId Dim figEntity As Autodesk.AECC.Interop.Survey.AeccSurveyFigure = DirectCast(m_trans.GetObject(figObjectId, OpenMode.ForRead), Autodesk.AutoCAD.DatabaseServices.Entity) m_alignment.IntersectWith(figEntity, Intersect.OnBothOperands, intPoint, IntPtr.Zero, IntPtr.Zero) Next
Hi eadonan,
I didn't try to debug your code here to see where it is going wrong, however, I have another suggestion of getting the basecurve from SurveyFigure and use that in m_alignment.IntersectWith() call.
See the following Blog post on - "Convert Civil 3D SurveyFigure to Polyline object".
Hope this helps.
Thanks,