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
Solved! Go to Solution.
Solved by mcicognani. Go to Solution.
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.
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.