I am an experienced programmer who is learning how to write custom C# nodes for Dynamo for Civil 3D.
I am trying to use a surface as a parameter but I am getting the following error.
Autodesk.DesignScript.Geometry.Surface but was called with Autodesk.Civil.DynamoNodes.TinSurface
I was wondering where do I reference the Autodesk.Civil.DynamoNodes.TinSurface type or if it is possible to cast TinSurface to Surface or if there is an assembly or NuGet package I need?
I was wondering where do I reference the Autodesk.Civil.DynamoNodes.TinSurface type?
You refer to it in the zero touch node. Make sure it takes in an Autodesk.Civil.DynamoNodes.TinSurface instead of the Autodesk.Designscript.Geometry.Surface.
if it is possible to cast TinSurface to (Dynamo)Surface or if there is an assembly or NuGet package I need?
Not directly because they are different. What you can do is create a Dynamo Polysurface from a TINsurface. A Tinsurface is more like an PolySurface than a Surface.
Depending on what you want the node to do, decide if you take in a TINSurface, Civil Surface or a Dynamo Surface and refer the right type in the sero touch node
Constructing Dynamo Polysurface from a Civil TINSurface
The Dynamo objects are wrappers around the API objects, you can access to the them calling the property “InternalDBObject” for example.
Where is the assembly for Autodesk.Civil.DynamoNodes.TinSurface as it doesn’t seem to be built in to the ones I have already referenced?
Also, is there a good place that documents all Autodesk API’s ?
Actually, nevermind… I found the DLL files.
Yep, the AutocadNodes.dll and the Civil3DNodes.dll containt the Nodes and wrappers you see in Dynamo.
As Paolo also pointed out, the Dynamo TinSurface object is a Wrapper around the Civil3D API TinSurface.
You can Convert a Dynamo TINSurface to a Civil TINSurface api Object by using the InternalDBObject property of the Dynamo TINSurface.
Sadly there is not 1 location where all the API Documentation is stored. I use the following linkes for the API’s
Civil 3D API