Insert block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I am using this code to insert blocks; however, it does not work all the time. Sometimes it skip the next and the blocks are inserted on top of each others
string newFileName = "";
string destinationFile = $"{filePath}Temporal\\";
acadApp.Preferences.Files.SupportPath += $";{destinationFile}";
#region Crear Copias del IOTable
position = positionPoint.Value.Y;
foreach (var item in response.CubeFlexIntegration.DATA)
{
newFileName = $"IOTable{item.Detail_Id}.dwg";
position = position - 0.3;
CreateCopyFileIOTable(filePath, destinationFile, newFileName);
_editor.Command("_insert", $"{newFileName}", $"{positionPoint.Value.X},{position},{positionPoint.Value.Z}",
$"1", $"1", $"0");
EditBlockAtt($"IOTable{item.Detail_Id}", "IO", item.Oj);
EditBlockAtt($"IOTable{item.Detail_Id}", "BAC_ID", item.BAC_ID);
EditBlockAtt($"IOTable{item.Detail_Id}", "REF", item.Reff);
EditBlockAtt($"IOTable{item.Detail_Id}", "DEVICE", item.Device);
EditBlockAtt($"IOTable{item.Detail_Id}", "IN_USE_BY", item.In_Use_By);
}