Hi all,
I'm trying to insert a reference of an already existing dynamic block, but when I use the following code the inserted block reference loses all the properties (in fact, if I debug it the block has isDynamicBlock set to False).
Code:
Using blockRef As New BlockReference(insertPoint, curBlock)
ms.AppendEntity(blockRef)
' ts is the already opened transaction
ts.AddNewlyCreatedDBObject(blockRef, True)
Dim dynBlockDef As BlockTableRecord = TryCast(blockRef.DynamicBlockTableRecord.GetObject(OpenMode.ForRead), BlockTableRecord)
' The following part never gets executed because the block reference is not dynamic.
For Each prop As DynamicBlockReferenceProperty In blockRef.DynamicBlockReferencePropertyCollection
Select Case prop.PropertyName
Case "lenght"
prop.Value = length
Case "width"
prop.Value = width
End Select
Next
End Using
What am I missing? I can't find anything that can help me on the net, only ways to access the properties of and already placed dynamic block reference.