明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1380|回复: 0

怎样为Block用SetXData设置延伸数据(请帮忙看看我的程序错在哪里)

[复制链接]
发表于 2004-3-16 11:09:00 | 显示全部楼层 |阅读模式
通过下面的代码用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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-28 08:31 , Processed in 0.166907 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表