.NET

Reply
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 1 of 5 (184 Views)

Block and it’s reference (block to reference pointer)

184 Views, 4 Replies
05-03-2012 11:16 AM

I have a block: “Block_A”. I am trying to determine if a block reference of the block exist.

 

Currently I would iterate every block Reference in the Block Table, and then dig deep into each block ref . . . . .

 

I was wondering if I could just take “Block_A” and see if it has reference and where the references are. Perhaps this is just wishful thinking but I was hoping for a faster way to obtain the references then to iterate thousands of blocks in each table record.

 

Thank you,

 

-Jay

Board Manager
StephenPreston
Posts: 368
Registered: ‎05-22-2006
Message 2 of 5 (180 Views)

Re: Block and it’s reference (block to reference pointer)

05-03-2012 11:34 AM in reply to: junoj

So you want to find all the BlockReferences associated with a particular BlockTableRecord? If so, BlockTableRecord.GetBlockReferenceIds() is the function you're looking for.

Cheers,

Stephen Preston
Autodesk Developer Network
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 3 of 5 (170 Views)

Re: Block and it’s reference (block to reference pointer)

05-03-2012 01:19 PM in reply to: StephenPreston

Thank you Stephen.

Moderator
Alexander.Rivilis
Posts: 1,398
Registered: ‎04-09-2008
Message 4 of 5 (155 Views)

Re: Block and it’s reference (block to reference pointer)

05-04-2012 06:15 AM in reply to: StephenPreston

Stephen!

It is true only for "non-dynamic" block's. Other words if blockreference of dynamic block was modified then its ObjectID was not returned with BlockTableRecord.GetBlockReferenceIds().

It is possible get all ObjectID of anonymous BlockTableRecord's which corresponds to main BlockTableRecord with help of method BlockTableRecord.GetAnonymousBlockIds(), and then for each  anonymous BlockTableRecord method BlockTableRecord.GetBlockReferenceIds() return all BlockReference: http://forums.autodesk.com/t5/NET/Keeping-track-of-Dynamic-Blocks/m-p/2306838#M11171


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 5 of 5 (144 Views)

Re: Block and it’s reference (block to reference pointer)

05-04-2012 07:51 AM in reply to: Alexander.Rivilis

Thank you Alexander that's very good to know too. Spasibo.

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