frenkas Posted September 15, 2011 Share Posted September 15, 2011 Hello, Simple question. Is it possible to get dynamic properties from AcadBlock not AcadBlockRefference? As I didn't find any solution, I implemented this function: Private Function ExistsDynPr(bb As AcadBlock, PropName As String) As Boolean Dim oProps As Variant Dim oDblkProp As AcadDynamicBlockReferenceProperty ', ap As AcadDynamicBlockReferenceProperty Dim I As Integer, pp(0 To 2) As Double, abr As AcadBlockReference Set abr = ThisDrawing.ModelSpace.InsertBlock(pp, bb.Name, 1, 1, 1, 0) 'bandom iterpti [laikinai] ExistsDynPr = False If abr.IsDynamicBlock Then oProps = abr.GetDynamicBlockProperties For I = 0 To UBound(oProps) Set oDblkProp = oProps(I) If oDblkProp.PropertyName = PropName Then ExistsDynPr = True abr.Delete Exit Function End If Next End If abr.Delete End Function Is there any side effects or risks of inserting block? If no I'll stick to this function, though I think it's not very nice solution. Quote Link to comment Share on other sites More sharing options...
meyerforhire Posted January 4, 2012 Share Posted January 4, 2012 Could you do something like: Dim objEnt as AcadEntity For Each objEnt in AcadBlock If TypeOf objEnt is AcadDynamicBlockReferenceProperty Then ExistsDynPr = true Next I think that should work without having to insert. Quote Link to comment Share on other sites More sharing options...
meyerforhire Posted January 12, 2012 Share Posted January 12, 2012 I think I steered you wrong. I attempted to cycle through the dyn props of an AcadBlock and couldn't get an acknowledgement that any AcadDynamicBlockReferenceProperties were included in the AcadEntityObject inside the AcadBlock. I tried to cycle through a bunch of blocks and delete all of the dynamic properties--I'm fed up with em'. Users love them, but there really hard to keep track of using vba. Check out the post I made a week or so ago titled "Dynamic Block Properties Quandry." It doesn't look like ACAD can keep track of the cohesive in a manner either--at least that I've found. No one has answered me back on that question I posted. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.