mstg007 发表于 2013-9-24 13:51:02

VBA - Civil3D 2012

我一直在这条线上出错。有什么想法吗?
函数 GetPipeObjects()
' 函数设置 Civil 3D Pipe 应用程序、文档和数据库对象
' 注意:使用管道应用程序获取管道设置
Dim oApp As AcadApplication
Set oApp = ThisDrawing.Application
Dim sAppName As String
sAppName = “AeccXUiPipe.AeccPipeApplication”
Set g_oCivilPipeApp = oApp.GetInterfaceObject(sAppName)
如果g_oCivilPipeApp Is Nothing 则
      MsgBox “Error create ” & sAppName & “, exit.”
GetCivilObjects = False
Exit Function
End if
Set g_oAeccPipeDoc = g_oCivilPipeApp.ActiveDocument
Set g_oAeccPipeDb = g_oAeccPipeDoc.Database

End Function
感谢您的帮助!
**** Hidden Message *****

Jeff_M 发表于 2013-9-24 14:30:25

C3D2012需要通过AeccPipeApplication传递的版本号。AeccPipeApplication.9.0"

mstg007 发表于 2013-9-24 14:47:27

杰夫。
说实话,我看到了你关于这个的大部分帖子......我真的非常感谢你的反馈。一切按预期工作。

mstg007 发表于 2013-9-24 15:30:28

又一个好玩的问题!
我有如下所示的代码:
Dim oExcelBook As Excel。工作簿

Dim dataNWPipeName As String

start excel
file hhcalcs = " C:\ P2X \ storm . xls "

Set oExcelBook = g _ oExcelApp。workbooks . Open(file hhcalcs)' g _ oExcelApp。Workbooks.Add
如果oExcelBook为Nothing,则
MsgBox "创建Excel文档时出错,退出。"
Exit Sub
End If
' Dictionary objects to hold column name and positions
Set dict pipe = New Dictionary
Set dict structure = New Dictionary
' make a New sheet for structures
如何指定要使用的excel文件,而不是对其进行硬编码?

Jeff_M 发表于 2013-9-24 15:46:22

你可以要求用户输入一个字符串的路径,布鲁里溃疡

mstg007 发表于 2013-9-24 16:31:25

你能查一下你的pm吗?
页: [1]
查看完整版本: VBA - Civil3D 2012