鼠标单击获取图块属性名称为何总是不成功?
代码如下,手机打的,可能略有错误,麻烦各位帮忙看一下,感觉这个功能应该实现起来很简单啊,为什么取不到呢,谢谢大家了我的想法是通过SelectionAtPoint方法把图块加进选择集
然后通过GetAttributes获取属性名称
现在ObjectName已经明确是BlockReference了
HasAttributes也是True
但是名称就是取不进varAttributes里
这是为什么呢…?
Private Sub CommandButton1_Click()
Me.Hide
inputp=ThisDrawing.Utility.Getpoint(,"getpoint")
Dim ssetObj As AcadSelectionSet
Dim ent as Object
Dim varAttributes As Variant
Dim I As Integer
Set ssetObj = ThisDrawing.SelectionSets.Add("temp")
ssetObj.SelectionAtPoint inputp
For Each ent In ssetObj
Msgbox ent.ObjectName
Msgbox ent.HasAttributes
varAttributes = ent.GetAttributes
For I = LBound(varAttributes) To UBound(varAttributes)
Msgbox varAttributes(I)
Next
Next
End Sub
自己搞定了 要取tagstring属性 手机打哪么多代码?人才!!!
页:
[1]