fix: identify failed Ortho pipe placement boundary

This commit is contained in:
codex
2026-08-04 14:34:15 +03:00
parent 62f470c7ba
commit c97f02c550
@@ -479,15 +479,20 @@ internal sealed class PlantViewportMembershipReader
private static bool TryReadPipePlacement(MdObjectId sourceId, DataLinksManager dataLinks, out GeometrySnapshot geometry) private static bool TryReadPipePlacement(MdObjectId sourceId, DataLinksManager dataLinks, out GeometrySnapshot geometry)
{ {
geometry = new GeometrySnapshot(); geometry = new GeometrySnapshot();
var stage = "GetDatabase";
try try
{ {
var openedByQuery = false; var openedByQuery = false;
var sourceDatabase = sourceId.GetDatabase(false, ref openedByQuery); var sourceDatabase = sourceId.GetDatabase(false, ref openedByQuery);
try try
{ {
stage = "StartTransaction";
using var transaction = sourceDatabase.TransactionManager.StartOpenCloseTransaction(); using var transaction = sourceDatabase.TransactionManager.StartOpenCloseTransaction();
stage = "MakeAcDbObjectId";
var objectId = dataLinks.MakeAcDbObjectId(sourceId.PrjObjectId, sourceDatabase); var objectId = dataLinks.MakeAcDbObjectId(sourceId.PrjObjectId, sourceDatabase);
stage = "OpenPipe";
if (transaction.GetObject(objectId, OpenMode.ForRead) is not Pipe pipe) return false; if (transaction.GetObject(objectId, OpenMode.ForRead) is not Pipe pipe) return false;
stage = "TransformStartPoint";
var point = pipe.StartPoint.TransformBy(sourceId.Xform); var point = pipe.StartPoint.TransformBy(sourceId.Xform);
geometry = new GeometrySnapshot geometry = new GeometrySnapshot
{ {
@@ -503,7 +508,7 @@ internal sealed class PlantViewportMembershipReader
} }
catch (Exception exception) catch (Exception exception)
{ {
RuntimeDiagnostics.Write("OrthoPipePlacementReadFailed", "ERROR", resultStatus: "ORTHO_PIPE_PLACEMENT_UNAVAILABLE", exception: exception); RuntimeDiagnostics.Write("OrthoPipePlacementReadFailed", "ERROR", resultStatus: "ORTHO_PIPE_PLACEMENT_UNAVAILABLE", exception: exception, details: new Dictionary<string, object?> { ["PlacementStage"] = stage });
return false; return false;
} }
} }