Get civil objects function civil 3d 2015
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
All,
Because I just installed civil 3d 2015 with the VBA 7.1 enabler installed I thought I’d use a few routines I had made several years ago in VBA to speed up the drawing creation when I found out the get civil objects function fails at 10.4. I read in the reference library was for civil 3d 2015 was 10.4.
Is there a newer a newer way to retrieve the civil objects ?
I connected the Autodesk Civil Engineering 10.4 UI Land Object library
And the Autodesk Civil Engineering 10.4 Land Object library as weel as the Autocad 2015 type library
I thought this would be all I needed to use a trusted routine I had used for years in many versions of civil 3D.
Thanks you,
John
This is the old function I’ve used for years:
Function GetBaseCivilObjects() As Boolean
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
' NOTE - Always specify the version number.
Const sAppName = "AeccXUiLand.AeccApplication.10.4"
Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
If (g_oCivilApp Is Nothing) Then
MsgBox "Error creating " & sAppName & ", exit."
GetBaseCivilObjects = False
Exit Function
End If
Set g_oDocument = g_oCivilApp.ActiveDocument
Set g_oAeccDatabase = g_oDocument.Database
GetBaseCivilObjects = True
End Function