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. See the answer in context.
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.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!