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: 

Using intersectwith on figure and alignment

1 REPLY 1
Reply
Message 1 of 2
eadonan
330 Views, 1 Reply

Using intersectwith on figure and alignment

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

 

 

 

1 REPLY 1
Message 2 of 2
Partha.Sarkar
in reply to: eadonan

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".

http://adndevblog.typepad.com/infrastructure/2013/01/convert-civil-3d-surveyfigure-to-polyline-objec...

 

Hope this helps.

 

Thanks,



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