- 积分
- 222
- 明经币
- 个
- 注册时间
- 2004-3-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
通过下面的代码用SetXData怎么也为块加不上延伸数据,请高手帮帮忙,不胜感激
Private Sub Command6_Click()
Dim acadDoc As AcadDocument Dim acadapp As AcadApplication
Dim blockObj As AcadBlock Dim startPoint(0 To 2) As Double Dim endPoint(0 To 2) As Double
Dim AppName As String Dim XData(0 To 1) As Variant Dim XDType(0 To 1) As Integer Dim insertionPnt(0 To 2) As Double
On Error Resume Next Set acadapp = GetObject(, "AutoCAD.Application") If Err Then Err.Clear Set acadapp = CreateObject("AutoCAD.Application") End If acadapp.Visible = 1 Set acadDoc = acadapp.ActiveDocument
insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0# Set blockObj = acadDoc.Blocks.Add(insertionPnt, "New_Block")
startPoint(0) = 1 startPoint(1) = 1 startPoint(2) = 0 endPoint(0) = 5 endPoint(1) = 5 endPoint(2) = 0
Call blockObj.AddLine(startPoint, endPoint)
AppName = "Pline" XDType(0) = 1001 XData(0) = AppName XDType(1) = 1000 XData(1) = "wo hui cheng gong"
Call blockObj.SetXData(XDType, XData)
End Sub |
|