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

insert filtered and modified entities from external dwg

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
E3DE
312 Views, 2 Replies

insert filtered and modified entities from external dwg

Hi,

I'm porting old objectarx plugin to .net.

I need to read external dwg, filtering some entities by layer, change layer to entities, and then insert only the filtered entities into current dwg.

Souces entities can be also blockreference and can have xrecord attacched.

 

In old c++ program this was the step:

1) readdwg to new database from source dwg

2) loop on blocktable record and filter entities id in object id collections and change layer

3) using wblock with object id collections to another temp db

4) insert temp db in current dwg whith db.Insert(xform, tempdb)

 

After these steps in c++ plugin (autocad 2011), in current dwg i have all single filtered entities from source dwg.

 

After porting in c# (autocad 2013) i have dirrente behaviour in step 4:

 

If i use Insert declination like in c++:

Database.Insert(new Matrix3d(), tempdb, true);

i have single entities except blockreference (but there are block definitions in dwg)

 

If i use:

Database.Insert(blockName, tempdb, true);

and then insert the blockName as reference i see al source entities (including blockreference), but i have all inside a block,

and this is not my goal, i need single entities and i don't want to explode block.

 

what is the problem?

 

thank you very much

2 REPLIES 2
Message 2 of 3
mcicognani
in reply to: E3DE

You may find useful this example from Kean's blog http://through-the-interface.typepad.com/through_the_interface/2006/08/import_blocks_f.html

Maybe you need to treat BlockReferences separately.

Message 3 of 3
E3DE
in reply to: mcicognani

thank you!

 

at this point i prefer use Insert(blockname, db) that creare a complete insert with blockreferences,

and then iterating and modify (scale) the nested blockreferences.

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