-
-
Notifications
You must be signed in to change notification settings - Fork 172
Description
Hi @DomCR,
When I create a block from entities in a drawing and later explode the block back into the drawing, the ARC entities are not restored correctly. The exploded arcs do not match the original source geometry.
I have attached:
- Code snippet used for block creation/explosion
- Input/source drawing file
- Output drawing file after explosion
Kindly review and let me know if this is a known issue or if any fix/workaround is available. Please advise if additional logs or files are required for debugging.
string TEMPpath = @"D:\Tools Development\ACAD\Arc Issues\EMPTY.dwg";
String Docpath = @"D:\Tools Development\ACAD\Arc Issues\Layout_Of_Electronic.dwg";
String outpath1 = @"D:\Tools Development\ACAD\Arc Issues\OUTPUT.dwg";
CadDocument template = DwgReader.Read(TEMPpath, onNotification);
var insertpoint = new XYZ(25, 250, 0.0);
var blockInsert = InsertBlock(Docpath, insertpoint);
//var base2 = new XYZ();
Insert InsertBlock(string path, XYZ insertpoint)
{
CadDocument doc = DwgReader.Read(Docpath, onNotification);
BlockRecord newBlock = doc.ModelSpace.Clone() as BlockRecord;
newBlock.Name = "NEW BLOCK";
var blockInsert = new ACadSharp.Entities.Insert(newBlock)
{
InsertPoint = insertpoint // Set the insertion point
};
return blockInsert;
}
template.Entities.Add(blockInsert);
var blockent = blockInsert.Explode();
foreach (var ent in blockent)
{
var clone = ent.Clone() as Entity;
template.ModelSpace.Entities.Add(clone);
}
template.BlockRecords.Remove(blockInsert.Block.Name);
DwgWriter.Write(outpath1, template);