Hi Tiago,
These 2 Functions worked for me in 2008. I have both 2007 & 2008 installed
which necessitates adding the version number to the Application string.
Provided you've set the correct references this should work for you, too.
These really don't do much, other than load the ActiveX (COM) API for both
the core Civil Application and the Pipe Application.
Yes, these are setting Global variables that hold the Civil & Pipe
application, Document, & Database objects.
Good Luck! And feel free to keep asking questions.
Function GetCivilObjects()
' Function to set up the Civil 3D application, document and database object
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
Dim sAppName As String
sAppName = "AeccXUiLand.AeccApplication.5.0"
Set g_oCivilApp = oApp.GetInterfaceObject(sAppName)
If g_oCivilApp Is Nothing Then
MsgBox "Error creating " & sAppName & ", exit."
GetCivilObjects = False
Exit Function
End If
Set g_oAeccDoc = g_oCivilApp.ActiveDocument
Set g_oAeccDb = g_oAeccDoc.Database
End Function
Function GetPipeObjects()
' Function to set up the Civil 3D Pipe application, document and database
object
' NOTE: use the pipe application to get the pipe settings
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
Dim sAppName As String
sAppName = "AeccXUiPipe.AeccPipeApplication.5.0"
Set g_oCivilPipeApp = oApp.GetInterfaceObject(sAppName)
If g_oCivilPipeApp Is Nothing Then
MsgBox "Error creating " & sAppName & ", exit."
GetCivilObjects = False
Exit Function
End If
Set g_oAeccPipeDoc = g_oCivilPipeApp.ActiveDocument
Set g_oAeccPipeDb = g_oAeccPipeDoc.Database
End Function
wrote in message news:5705535@discussion.autodesk.com...
Thanks for your replies, my doubt is there...i allready had gone to VBAIDE,
to references and loaded the Libraries needed, i also had some stuff from
C3D 2007 that i unloaded, then uninstalled it, since i have 2008 now.When i
try to export to Excel it sends me to debug and shows a message that there's
an error with the library file and shows me that the C3D 2007 Libs are
missing.I don't know VBasic, i can read what the program is doing and
understand a litlle how is funcioning, i had in school QBasic and Pascal so
i have some pointers in programming but they don't serve much in VB.So:
and if you could try to explain to me what the programing is doing in each
line of code i would appreciate it, is he defining variables, setting them
to libraries, etc...
Thanks in advance, and sorry for beeing such a noob in this,
Tiago Vasconcelos
Message was edited by: tvasconcelos