Civil 3D表面处理帮助!
本人';我想在Civil 3D 2008中寻求一些帮助,以实现曲面创建过程的自动化;我很笨,所以这不是#039;这是一个像我想象的那样简单明了的过程I';我已经使用开发人员对示例代码进行了一些研究#039;s导轨,但可以';我什么都没做
如果有人能提供一些帮助,我';我非常感谢
我设想这段代码的作用是:要求用户选择要素线#1(FL1)
2)要求用户选择特征线Ş2(FL2)
3)创建一个新的三角网曲面,名称为Bldg 001(数字随着每个附加曲面的增加而增加)但我不';我不理解a)什么是参考,或者b)如何解决2011年的问题;s完整代码I';m当前使用:
Sub test()
Dim oApp As AeccApplication
Dim oDoc As AeccDocument
Dim oSurfs As AeccSurfaces
Set oApp = Application.GetInterfaceObject("AeccXUiLand.AeccApplication.7.0")
Set oDoc = oApp.ActiveDocument
Set oSurfs = oDoc.Surfaces
Dim Tindata As New AeccTinCreationData
Tindata.Description = "Building Surface from CPP Building datum" 'SET SURFACE DESCRIPTION
Tindata.Layer = "Surface Bldgs" 'SET SURFACE LAYER
Tindata.BaseLayer = "Surface Bldgs" 'NOT SURE WHAT THIS DOES
Tindata.Style = "Building Surfaces" 'SET SURFACE STYLE
Dim osurf As AeccSurface
Dim iCount As Integer
For Each osurf In oSurfs
If osurf.Name Like "BLDG ###" Then
Dim iTmp As Integer
iTmp = CInt(Right(osurf.Name, 3))
If iTmp > iCount Then iCount = iTmp
End If
Next
Dim sCurName As String
Dim oEnt1 As AcadEntity
Dim oEnt2 As AcadEntity
Dim vPick As Variant
Dim oEnts(0) As AcadEntity
Do Until Err.Number0
iCount = iCount + 1
sCurName = "BLDG " & Format(iCount, "000")
On Error GoTo ResumeHere
ThisDrawing.Utility.GetEntity oEnt1, vPick, vbCr & "Select inside pline: "
Dim sOtype As String
sOtype = UCase(oEnt1.ObjectName)
If Not ((sOtype Like "*POLY*") Or (sOtype Like "*FEATURE*")) Then
Err.Raise -4444444, , "Incorrect object type selected!"
GoTo ResumeHere
''Remove the ElseIf section when the API allows Featurelines
ElseIf sOtype Like "*FEATURE*" Then
Err.Raise -4444445, , "Featurelines not currently supported, explode and try again!"
GoTo ResumeHere
End If
ThisDrawing.Utility.GetEntity oEnt2, vPick, vbCr & "Select outside pline: "
sOtype = UCase(oEnt2.ObjectName)
If Not ((sOtype Like "*POLY*") Or (sOtype Like "*FEATURE*")) Then
Err.Raise -4444444, , "Incorrect object type selected!"
GoTo ResumeHere
''Remove the ElseIf section when the API allows Featurelines
ElseIf sOtype Like "*FEATURE*" Then
Err.Raise -4444445, , "Featurelines not currently supported, explode and try again!"
GoTo ResumeHere
End If
Tindata.Name = sCurName
Dim oTinSurf As AeccTinSurface
Set oTinSurf = oSurfs.AddTinSurface(Tindata)
Set oEnts(0) = oEnt1
oTinSurf.Breaklines.AddStandardBreakline oEnts, "Interior Breakline", 0.5
Set oEnts(0) = oEnt2
oTinSurf.Breaklines.AddStandardBreakline oEnts, "Exterior Breakline", 0.5
oTinSurf.Boundaries.Add oEnt2, "Exterior Boundary", aeccBoundaryOuter, True, 0.5
ResumeHere:
Select Case Err.Number
Case Is = -4444444
MsgBox Err.Description
Case Is = -4444445
MsgBox Err.Description
Case Else
' MsgBox Err.Description ''uncomment to test for the error thrown, comment out to run normally
End Select
Loop
End Sub
谁能解释一下我';我又失踪了?
您使用的是64位版本的2011吗?如果是这样,则C3D互操作don#039;t在安装过程中注册。本人';我将把REG文件附加到这篇文章,你可以运行它来安装它们。如果没有,请忽略此部分…
在VBAIDE中,转到“工具”菜单,选择“参考”,取消选择与Civil有关的任何内容,向下滚动到Civil 8.0库,然后选择2个与土地相关的项目。 谢谢Jeff_M-成功了
I';我现在只运行32位,但到本周末应该会在一台64位Win7的新机器上运行,这样REG文件就会派上用场。 有人告诉我,对于C3D 2011 x64,简单地加载VBA模块会大大降低整个程序的速度 ;您可能最终需要将例程转换为.NET。
页:
[1]