你试过测试属性的非动态属性吗?
AcadAttributeReference对象,可见属性?
比如。。。。。。
- Private Function IsAttVis(objID As Long, attName As String) As Boolean
- 'You'll want to get the object ID and Attribute name to pass it to this function
- Dim objEnt As AcadEntity
- Dim objRef As AcadBlockReference
- Dim objAttRef As AcadAttributeReference
- Set objEnt = ThisDrawing.ObjectIdToObject(objID)
- If TypeOf objEnt Is AcadBlockReference Then
- Set objRef = objEnt
- Set objEnt = Nothing
- For Each objEnt In objRef
- If TypeOf objEnt Is objAttRef Then
- Set objAttRef = objEnt
-
- If objAttRef.ObjectName = attName Then
-
- If objAttRef.Visible = True Then
- IsAttVis = True
- Else
- IsAttVis = False
- End If
-
- End If
-
- Set objAttRef = Nothing
- End If
-
- Next
-
- Set objRef = Nothing
- End If
-
- Set objEnt = Nothing
- End Function
以上内容未经测试,因此objEnt继承权可能会失败——我不记得它是否会以这种方式工作。 |