本人';我想在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.Number 0
- 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
谁能解释一下我';我又失踪了?
|