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

Replace Block Record

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
EfremenkoDO
957 Views, 4 Replies

Replace Block Record

Hi all! I look for answers on my question 'How I can replace or redefine block record?'.

I tried the following:

1. Get all the block references

2. Clone it

3. Save to new DateBase

4. Erase old Block REferences and Block Record

5. Copy block references from new DataBase

 

But it doesn't work. Do you have any ideas?

 

P.S. If you wаnt, then I can write some code

4 REPLIES 4
Message 2 of 5
hgasty1001
in reply to: EfremenkoDO

Hi,

 

What do You mean with "But it doesn't work"?, you have a workflow with 5 steps, in which one the program fails?, and yes, please post the relevant code.

 

Gaston Nunez

Message 3 of 5

You're doing a lot of unneccessary work there, with the copying back and forth to a new database.  I have a working routine that goes like this.

 

1. Open the old BlockTableRecord

2. Get the BlockReferenceIds from the BTR
3. Rename the old BTR (I assume you want the new block to have the same name, or this isn't neccessary)

4. Create the new BlockTableRecord.

5. Loop through the BlockReferenceIds and point the BlockTableRecord property to the new ID, and check for attribute aditions or removals.

Dave O.                                                                  Sig-Logos32.png
Message 4 of 5

Thank you!

Message 5 of 5
jokiller70
in reply to: EfremenkoDO

Any chance of getting the code for this?

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