• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD Civil 3D

    Reply
    *GLC

    VBA code causes Fatal Error with Grid Volume Surfaces in dwg

    67 Views, 1 Replies
    04-11-2004 09:01 PM
    Hi, 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 -------------- Option Explicit Public g_oCivilApp As AeccApplication Public g_oAeccDoc As AeccDocument Public g_oAeccDb As AeccDatabase Public g_StyCount As Integer Public doObjectData As Boolean Sub getCivilObjects() 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 End Sub Sub SurfaceUtilities() 'NOTE this causes as FATAL ERROR when the drawing contains a grid volume surface Debug.Print vbCrLf + " SURFACE UTILITIES" Debug.Print " -----------------" getCivilObjects 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..." End Sub
    Please use plain text.
    *Brian Hailey

    Re: VBA code causes Fatal Error with Grid Volume Surfaces in dwg

    04-12-2004 06:59 AM in reply to: *GLC
    Hi GLC, 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. Brian
    Please use plain text.