- 积分
- 764
- 明经币
- 个
- 注册时间
- 2004-6-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-6-9 12:07:00
|
显示全部楼层
Dim basePnt As Variant Dim elemod As Object Dim pickblk As Object On Error Resume Next Me.Hide
ThisDrawing.Utility.GetEntity returnObj, basePnt, "请选择属性块进行编辑" Dim con() Dim xxx As Integer Dim yyy As Integer Dim zzz As Integer MSFlexGrid1.Clear MSFlexGrid1.Rows = 1 MSFlexGrid1.TextMatrix(0, 1) = "标记" MSFlexGrid1.TextMatrix(0, 2) = "提示" MSFlexGrid1.TextMatrix(0, 3) = "值"
'temp = False
If returnObj.ObjectName = "AcDbBlockReference" Then varAttributes = returnObj.GetAttributes ReDim con(UBound(varAttributes), 2) For i = LBound(varAttributes) To UBound(varAttributes) con(i, 0) = varAttributes(i).TagString 'con(i, 1) = elemod.PromptString con(i, 2) = varAttributes(i).TextString yyy = i Next i Set pickblk = ThisDrawing.Blocks(returnObj.Name) For Each elemod In pickblk If elemod.ObjectName = "AcDbAttributeDefinition" Then For xxx = 0 To yyy If con(xxx, 0) = elemod.TagString Then con(xxx, 1) = elemod.PromptString Exit For End If Next xxx End If Next elemod MSFlexGrid1.Rows = yyy + 2 For i = 0 To yyy MSFlexGrid1.Row = i + 1 MSFlexGrid1.Col = 1 MSFlexGrid1.Text = con(i, 0) MSFlexGrid1.CellAlignment = 0 MSFlexGrid1.Col = 2 MSFlexGrid1.Text = con(i, 1) MSFlexGrid1.CellAlignment = 0 MSFlexGrid1.Col = 3 MSFlexGrid1.Text = con(i, 2) MSFlexGrid1.CellAlignment = 0 Next i
Else
MsgBox "你选择的不是图块,请从新选择", vbOKOnly, "提示" End If
Me.Show |
|