Importing CADInsert

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
rtec
Posts: 12
Joined: 12 Sep 2016, 23:48

Importing CADInsert

Post by rtec » 13 Sep 2016, 00:21

HI,
How to import a specific insert from a CADImage.
I tried using selectedCadInsert.Converter.Iterate, but it is iterating through all the entities in the cadimage not just entities in the insert.

Thanks
Ravi

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: Importing CADInsert

Post by support » 16 Sep 2016, 20:30

Hello Ravi,

CADInsert.Converter.Iterate method iterates through all the entities in the drawing, because CADInsert.Converter actually refers to the current CADImage.Converter. You can use foreach loop to iterate through the entities in a corresponding block. For example:

Code: Select all

using CADImport
...

CADEntityCollection entities = new CADEntityCollection();
foreach (CADEntity ent in selectedCadInsert.Block.Entities)
{
    entities.Add(ent);
}
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

rtec
Posts: 12
Joined: 12 Sep 2016, 23:48

Re: Importing CADInsert

Post by rtec » 21 Sep 2016, 19:17

so I need to manually do the rotation, scaling and offset to get exact location of each entity in the block and it gets little more complicated in case of multilevel inserts.

-Ravi

Post Reply