After digging into Bentley dlls with ILSpy and windbg-ing I found a possible solution. It does not open the window for user to set parameters because MyVol has set the property Name. When this is not null or empty then the logic insiede Bentley.Building.Mechanical.CreateAreaFromSolid(...) does not rasie the window MyVol bb = new MyVol(locale._elementoLocale); bb.CreateSolid(); List Bentley.Building.Mechanical.VolumeDefinitions.IVolumeDefinition volDefs = new List IVolumeDefinition (); volDefs.Add(bb); Bentley.Building.Mechanical.MechAddIn.CreateAreasFromVolumeDefinitions("PLANT_AREA", volDefs); Where MyVol is public class MyVol : BaseVolumeDefinition { SmartSolidElement _solid; public MyVol(Element element) { _solid = Utilities.ComApp.SmartSolid.ExtrudeClosedPlanarCurve(element, 1000, 1000, false); this.Name = "aaa1111"; // will avoid to open the form this.VolumeType = Bentley.Building.Mechanical.VolumeDefinitions.VolumeType.Undefined; Utilities.ComApp.ActiveModelReference.AddElement(_solid); Utilities.ComApp.RedrawAllViews(MsdDrawingMode.Normal); } public override int CreateSolid() { return _solid.MdlElementRef(); } }
↧