C# Could be a bug when extracting Surface Points/Edges/Triangles on a Smoothed TinSurface

C# Could be a bug when extracting Surface Points/Edges/Triangles on a Smoothed TinSurface

efren.abellaPWZWF
Participant Participant
225 Views
2 Replies
Message 1 of 3

C# Could be a bug when extracting Surface Points/Edges/Triangles on a Smoothed TinSurface

efren.abellaPWZWF
Participant
Participant

I have a DataShortcut TinSurface placed into my host drawing.

Extracting its Points or Triangles or Triangle Edges *excludes* the point-Smoothing-definitions.

But doing it manually is ok.

Examples:
TinSurfaceVertex[] verts = surf.GetVerticesInsidePolylines(idsPln);

OR 

var tri = surf.FindTriangleAtXY(vtx.Location.X, vtx.Location.Y);

 

Anyone had this experience ? I hope Autodesk would look into it.

 

Cheers,
Efren

0 Likes
226 Views
2 Replies
Replies (2)
Message 2 of 3

SoaresASBCAD
Collaborator
Collaborator

What you're are describing is consistent with a known limitation (or bug, depending on the Civil 3D version) when working with Data Shortcut (DREF) TinSurface objects through the Civil 3D .NET API.

What's happening

When you query a referenced

the API often returns the raw TIN geometry stored in the referenced surface. Operations that modify the display or derived geometry—such as point smoothing—are frequently not reflected in the data exposed by these API methods.

In contrast, when Civil 3D performs a manual extraction (for example, via the UI), it uses the internal surface engine after the full surface definition has been evaluated, so the extracted data includes smoothing where applicable.

Why this occurs

A Data Shortcut surface is a read-only reference. The managed API exposes only a subset of the evaluated surface state. Several surface operations—including smoothing, watershed analysis, and some display refinements—are computed internally and are not always represented by the objects returned through methods like:

GetVertices()

GetVerticesInsidePolylines()

GetTriangles()

FindTriangleAtXY()

GetEdges()

This discrepancy has been reported by developers across multiple Civil 3D releases.

Things to verify

Before concluding it's an API issue, check:

Is the surface actually rebuilt after smoothing?

Does the same code behave correctly on a native (non-DREF) surface?

Does the behavior change after promoting the Data Shortcut surface to a local surface?

If the problem disappears after promoting the surface, it's strong evidence that the limitation is specific to DREF surfaces rather than the smoothing operation itself.

Possible workarounds

Depending on your workflow, you could:

Promote the Data Shortcut surface before querying its geometry.

Extract the smoothed surface to a local surface and query that instead.

If you only need the final geometry, use the manual extraction workflow and process the resulting local surface.

Recommendation

If you've confirmed that:

the UI extraction includes the smoothed points,

the .NET API omits them for the same referenced surface, and

the behavior is reproducible,

then this is worth reporting to Autodesk as an API inconsistency. A minimal reproducible example (a DREF surface with point smoothing applied and a short code sample demonstrating the difference) would make it much easier for the Civil 3D development team to investigate.

ASoares
0 Likes
Message 3 of 3

BlackBox_
Advisor
Advisor

@efren.abellaPWZWF wrote:

I have a DataShortcut TinSurface placed into my host drawing.

Extracting its Points or Triangles or Triangle Edges *excludes* the point-Smoothing-definitions.

But doing it manually is ok.

Examples:
TinSurfaceVertex[] verts = surf.GetVerticesInsidePolylines(idsPln);

OR 

var tri = surf.FindTriangleAtXY(vtx.Location.X, vtx.Location.Y);

 

Anyone had this experience ? I hope Autodesk would look into it.

 

Cheers,
Efren


There is no limitation getting at the triangles for surfaces with or without smoothing.

 

See the GetOutputTriangles() extraction technique used here:

https://forums.autodesk.com/t5/civil-3d-customization-forum/tinvolumesurface-getting-cut-fill-volume...

 

Cheers


"How we think determines what we do, and what we do determines what we get."

Chris (BlackBox) Bradley
Managing Partner / Developer / Civil Designer
Quux Software | Sincpac C3D | Style Explorer

0 Likes