.NET

Reply
Active Contributor
JF_005
Posts: 30
Registered: ‎05-15-2012
Message 1 of 7 (344 Views)
Accepted Solution

Access BlockPropertiesTable from a BlockReference

344 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.

ADN Support Specialist
philippe.leefsma
Posts: 562
Registered: ‎06-02-2009
Message 2 of 7 (276 Views)

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
JF_005
Posts: 30
Registered: ‎05-15-2012
Message 3 of 7 (269 Views)

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
philippe.leefsma
Posts: 562
Registered: ‎06-02-2009
Message 4 of 7 (265 Views)

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
JF_005
Posts: 30
Registered: ‎05-15-2012
Message 5 of 7 (264 Views)

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
JF_005
Posts: 30
Registered: ‎05-15-2012
Message 6 of 7 (260 Views)

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
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 7 of 7 (238 Views)

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community