Access BlockPropertiesTable from a BlockReference

Access BlockPropertiesTable from a BlockReference

Anonymous
Not applicable
1,654 Views
6 Replies
Message 1 of 7

Access BlockPropertiesTable from a BlockReference

Anonymous
Not applicable

I use a block entity that contains a BlockPropertiesTable (not a LookupTable) with dimension constraints and user parameters. I managed to find sample code on how to get the current value of these parameters (

AssocNetwork class), but I don't know how to access the ObjectId of the BlockPropertiesTable from my BlockReference. This would be useful to get a list of all values available for a specific parameter in the table for example.

 

Any help would be much appreciated.

0 Likes
Accepted solutions (1)
1,655 Views
6 Replies
Replies (6)
Message 2 of 7

philippe.leefsma
Alumni
Alumni

Hi JF,

 

Can you please provide a minimal sample file containing your block, so I can take a closer look.

 

Thanks,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 7

Anonymous
Not applicable

Here you go. This is a pipe fitting tee. The primary column of the BlockPropertiesTable lets you chose the fitting nominal pipe size (3/4"-NPT for example).

 

I know I can change the BlockReference property value (current row to display) like this:

 

For Each prop As DynamicBlockReferenceProperty In br.DynamicBlockReferencePropertyCollection
    If prop.PropertyName.ToUpper() = "BLOCK TABLE1" Then
        prop.Value = CShort(2)
    End If
Next

 But this does not give me any info about the the rows and columns of the BlockPropertiesTable entity.

 

Thanks in advance for your help! Smiley Happy

0 Likes
Message 4 of 7

philippe.leefsma
Alumni
Alumni

The API for dynamic block is not very powerful, accessing parameters is basically all you can do, so the information you are looking for is probably not accessible directly.

 

You may want to check the following post, it exposes an approach to discover additional properties, but it involves some personal research on your side:

 

http://adndevblog.typepad.com/autocad/2012/05/accessing-visible-entities-in-a-dynamic-block.html?cid...

 

I hope it helps,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 7

Anonymous
Not applicable

By the way, I code in VB but I don't mind if the solution is in VB or C#. (I'm used to convert from C# to VB)

0 Likes
Message 6 of 7

Anonymous
Not applicable

Thank you, i'll check this out.

0 Likes
Message 7 of 7

DiningPhilosopher
Collaborator
Collaborator
Accepted solution

And, in case the graphics that were not lifted from the original article might help, here's a link:

 

http://forums.autodesk.com/t5/NET/Dynamic-block-question/m-p/2640949#M18132

0 Likes