这在2007年对我有用,但是,正如Bryco指出的那样,使用这种方法没有智能感知。
- Sub test()
- Dim oBlkRef As AcadBlockReference
- Dim oEnt As AcadEntity
- Dim vPick As Variant
- Dim vDynProps As Variant
- Dim oDynProp As AcadDynamicBlockReferenceProperty
- Dim i As Long
- ThisDrawing.Utility.GetEntity oEnt, vPick, "select block: "
- If TypeOf oEnt Is AcadBlockReference Then
- Set oBlkRef = oEnt
- If oBlkRef.IsDynamicBlock = True Then
- vDynProps = oBlkRef.GetDynamicBlockProperties
- For i = 0 To UBound(vDynProps)
- Set oDynProp = vDynProps(i)
- If oDynProp.PropertyName = "Visibility" Then
- Debug.Print oDynProp.Value
- End If
- Next
- End If
- End If
- End Sub
|