Getting a list of all possible Surfaces

Getting a list of all possible Surfaces

Anonymous
Not applicable
1,487 Views
1 Reply
Message 1 of 2

Getting a list of all possible Surfaces

Anonymous
Not applicable

Hi Guys,

 

I'm re-writing old VBA code used in Civil that was written back when surfaces were separate files. As a result, I need a new way of accessing a surface programmatically, as before the code found and edited surfaces by searching the working directory folder.

 

I guess my question is, how can I generate a list of surfaces in a drawing, that allows the user to select a surface name from the list and perform analyses on the point-set of that surface.

 

Cheers

0 Likes
Accepted solutions (1)
1,488 Views
1 Reply
Reply (1)
Message 2 of 2

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

>> how can I generate a list of surfaces

If late-binding is ok then you can use that code snippet, depending on the version of Civil 3D you are using you might need to change the application version (12.0 is for Civil 3D 2018)

 

   Dim tSurf As Object
   Dim tAeccApp As Object
   Set tAeccApp = ThisDrawing.Application.GetInterfaceObject("AeccXUILand.AeccApplication.12.0")
   For Each tSurf In tAeccApp.ActiveDocument.Surfaces
      Debug.Print tSurf.Name
   Next

 -alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes