.NET

.NET

Reply
Active Contributor
30 Posts
2 Kudos
Registered: ‎05-15-2012
Post 1 of 7
Accepted Solution

Access BlockPropertiesTable from a BlockReference

405 Views, 6 Replies
09-19-2012 09:23 PM

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.

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

ADN Support Specialist
685 Posts
80 Kudos
Registered: ‎06-02-2009
Post 2 of 7

Re: Access BlockPropertiesTable from a BlockReference

09-28-2012 04:28 AM 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

Active Contributor
30 Posts
2 Kudos
Registered: ‎05-15-2012
Post 3 of 7

Re: Access BlockPropertiesTable from a BlockReference

09-28-2012 06:17 AM 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! :smileyhappy:

ADN Support Specialist
685 Posts
80 Kudos
Registered: ‎06-02-2009
Post 4 of 7

Re: Access BlockPropertiesTable from a BlockReference

09-28-2012 06:32 AM 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

Active Contributor
30 Posts
2 Kudos
Registered: ‎05-15-2012
Post 5 of 7

Re: Access BlockPropertiesTable from a BlockReference

09-28-2012 06:33 AM 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)

Active Contributor
30 Posts
2 Kudos
Registered: ‎05-15-2012
Post 6 of 7

Re: Access BlockPropertiesTable from a BlockReference

09-28-2012 06:34 AM in reply to: philippe.leefsma

Thank you, i'll check this out.

Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 7 of 7

Re: Access BlockPropertiesTable from a BlockReference

09-28-2012 05:37 PM 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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post