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

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

4 REPLIES 4
Reply
Message 1 of 5
junoj
467 Views, 4 Replies

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

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

4 REPLIES 4
Message 2 of 5
StephenPreston
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
Message 3 of 5
junoj
in reply to: StephenPreston

Thank you Stephen.

Message 4 of 5

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

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 5
junoj
in reply to: Alexander.Rivilis

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

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