我正在编一个类似块属性编辑的东西
遇到问题请帮忙
程序运行总是显示
“对象不支持属性或方法“
源代码如下:
Private Sub CommandButton24_Click() Dim returnObj As Object Dim basePnt As Variant Dim elemod As Object
'On Error Resume Next Me.Hide
ThisDrawing.Utility.GetEntity returnObj, basePnt, "请选择属性块进行编辑" MSFlexGrid1.Clear MSFlexGrid1.Rows = 1 MSFlexGrid1.TextMatrix(0, 1) = "标记" MSFlexGrid1.TextMatrix(0, 2) = "提示" MSFlexGrid1.TextMatrix(0, 3) = "值" i = 1 If returnObj.ObjectName = "AcDbBlockReference" Then For Each elemod In returnObj (此处显示问题?????????????)
If elemod.ObjectName = "AcDbAttributeDefinition" Then varAttributes = setqd.GetAttributes MSFlexGrid1.AddItem (i) MSFlexGrid1.Row = i MSFlexGrid1.Col = 1 MSFlexGrid1.Text = elemod.TagString MSFlexGrid1.CellAlignment = 0 MSFlexGrid1.Row = i MSFlexGrid1.Col = 2 MSFlexGrid1.Text = elemod.PromptString MSFlexGrid1.CellAlignment = 0 MSFlexGrid1.Row = i MSFlexGrid1.Col = 3 MSFlexGrid1.Text = elemod.TextString MSFlexGrid1.CellAlignment = 0 i = i + 1 End If Next Else x = MsgBox("你选择的不是图块,请从新选择", vbOKOnly, "提示") End If
Me.Show
End Sub |