Hi,
I recently learned about Block Property Table and how to get them from a block table record. Thanks to @ActivistInvestor.
Now that I can access the Block property table, I'll have to change current active value in a block reference that contains a block property table.
I have a block which has a length and a width parameter linked in a block property table. And the "Block property must match a row in the table" is set to true.
I need to change the active row in the block reference. How can I do that in .NET API with C#?
I've attached an example drawing.
Thanks in advance for any help.
Solved! Go to Solution.
Solved by shricharana_bharadwaj. Go to Solution.
So, as I found out, it turned out to be very simple. Just need to give index of the table as the property value. I had assumed it was more complicated than this.
BlockReference br = (BlockReference)tr.GetObject(selectedBlockId, OpenMode.ForWrite);
DynamicBlockReferencePropertyCollection col = br.DynamicBlockReferencePropertyCollection;
foreach (DynamicBlockReferenceProperty prop in col)
{
if (prop.PropertyName == "Block Table1")
{
prop.Value = (short)3;
}
}
Can't find what you're looking for? Ask the community or share your knowledge.