示例#1
0
        private void ApplyClippingPlanes(UIDocument uiDocument, View3D view)
        {
            using var trans = new Transaction(uiDocument.Document);
            if (trans.Start($"Apply view point clipping planes in '{view.Name}'") != TransactionStatus.Started)
            {
                return;
            }

            Log.Information("Retrieving viewpoint clipping planes " +
                            "and converting them into an axis aligned bounding box ...");
            AxisAlignedBoundingBox boundingBox = GetViewpointClippingBox();

            if (!boundingBox.Equals(AxisAlignedBoundingBox.Infinite))
            {
                Log.Information("Found axis aligned clipping planes. Setting resulting section box ...");
                view.SetSectionBox(ToRevitSectionBox(boundingBox));
                view.IsSectionBoxActive = true;
            }

            trans.Commit();
        }