TheSwamp

Code Red => .NET => Topic started by: surveyor_randy on May 30, 2014, 10:44:00 AM

Title: Survey Figures - cannot find Basecurve method?
Post by: surveyor_randy on May 30, 2014, 10:44:00 AM
This is a Civil 3D question.

I'm trying to use the Basecurve method of the surveyfigure object and it isn't there.  I get a error message saying that "basecurve is not a member of Autodesk.AECC.Interop.Survey.AeccSurveyFigure"

Code: [Select]
Dim survFig As AeccSurveyFigure = TryCast(TR.GetObject(Res1.ObjectId, OpenMode.ForWrite), AeccSurveyFigure)
Dim baseCurve As Curve = survFig.Basecurve()

I'm referencing:
accoremgd
acdbmgd
acmgd
Autodesk.AEC.Interop.Base
Autodesk.AEC.Interop.UIBase
Autodesk.AECC.Interop.Roadway
Autodesk.AECC.Interop.UiRoadway
Autodesk.AECC.Interop.Survey
Autodesk.AECC.Interop.UiSurvey

What am I missing.  I'm not an expert programmer and couldn't tell you the difference between COM and .NET.  I'm sure one of you gurus will know right away what my issue is.  I really appreciate any help someone can provide.  Thanks guys!
Title: Re: Survey Figures - cannot find Basecurve method?
Post by: Jeff_M on May 30, 2014, 11:04:21 AM
BaseCurve is a property, you are using it like a method. This should work (although I don't speak VB too well):
Dim baseCurve As Curve = survFig.Basecurve

I'm pretty sure you can do something like this, too (it works in C#, not sure of the context in VB):
Dim survFig As Curve = TryCast(TR.GetObject(Res1.ObjectId, OpenMode.ForWrite), Curve)

Oh, as I was changing that last line I realized you are casting the Figure as an Aecc object, which is COM, so will not work any way as BaseCurve is a property of the managed API SurveyFigure object.

Title: Re: Survey Figures - cannot find Basecurve method?
Post by: surveyor_randy on May 30, 2014, 11:58:27 AM
Great!  Thank you very much Jeff!

It seems I was missing references to AecBaseMgd.dll and AeccDBMgd.dll

You got me on the right track!  :-)