.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to manipulate current active row of a Block property Table parameter in a block reference?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
shricharana_bharadwaj
168 Views, 1 Reply

How to manipulate current active row of a Block property Table parameter in a block reference?

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.

shricharana_bharadwaj_0-1720785724734.png

 

 

I need to change the active row in the block reference. How can I do that in .NET API with C#? 

shricharana_bharadwaj_1-1720785785728.png

 

I've attached an example drawing.

Thanks in advance for any help.

1 REPLY 1
Message 2 of 2

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.

Post to forums  

Forma Design Contest


AutoCAD Beta