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

Access BlockPropertiesTable from a BlockReference

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
JF_005
745 Views, 6 Replies

Access BlockPropertiesTable from a BlockReference

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.

6 REPLIES 6
Message 2 of 7
philippe.leefsma
in reply to: JF_005

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

Message 3 of 7
JF_005
in reply to: philippe.leefsma

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

Message 4 of 7
philippe.leefsma
in reply to: JF_005

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

Message 5 of 7
JF_005
in reply to: philippe.leefsma

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)

Message 6 of 7
JF_005
in reply to: philippe.leefsma

Thank you, i'll check this out.

Message 7 of 7
DiningPhilosopher
in reply to: JF_005

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost