The code included below works fine until I have a grid volume surface in the
drawing, even if it's not the first surface in the drawing, i.e.
osurfs.item(0). Can someone confirm if this is a defect or if I'm doing
something wrong? Thanks, GLC
Public g_oCivilApp As AeccApplication
Public g_oAeccDoc As AeccDocument
Public g_oAeccDb As AeccDatabase
Public g_StyCount As Integer
Public doObjectData As Boolean
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
Set g_oCivilApp = oApp.GetInterfaceObject("AeccXUiLand.AeccApplication")
Set g_oAeccDoc = g_oCivilApp.ActiveDocument
Set g_oAeccDb = g_oAeccDoc.Database
'NOTE this causes as FATAL ERROR when the drawing contains a grid volume
Debug.Print vbCrLf + " SURFACE UTILITIES"
Debug.Print " -----------------"
Dim oSurfs As AeccSurfaces
Dim oSurf As AeccSurface
Set oSurfs = g_oAeccDoc.Surfaces
Set oSurf = oSurfs.Item(0) 'breakpoint set here
Debug.Print " Surface name - " & oSurf.Name
Debug.Print " Surface type - " & oSurf.Type
Debug.Print " Stylename - " & oSurf.StyleName
Debug.Print vbCrLf + " DONE..."
You seem to be asking a lot of customization questions. You will probably
get a lot of answers if you post your questions in the
autodesk.aec.land-desktop.customization newsgroup. This newsgroup is
focused primarily on the up and coming Civil3D software and, as of now, has
a limited (but very knowledgeable) following.