SectionManagerAddBox Method |
Namespace: VIZCore3D.NET.Manager
public Section AddBox( bool partSection, float margine = 0f )
// VIZCore3D.NET Control private VIZCore3D.NET.VIZCore3DControl vizcore3d; private void Example1() { if (vizcore3d.Model.IsOpen() == false) return; List<VIZCore3D.NET.Data.Node> nodes = vizcore3d.Object3D.FromFilter(VIZCore3D.NET.Data.Object3dFilter.SELECTED_TOP); if (nodes.Count == 0) return; VIZCore3D.NET.Data.BoundBox3D boundBox = vizcore3d.Object3D.GetBoundBox(nodes); VIZCore3D.NET.Data.Section section = vizcore3d.Section.AddBox(false); vizcore3d.Section.SetBoxSize(section.ID, boundBox); vizcore3d.View.FitToView(boundBox.GetCenter()); } private void Example2() { if (vizcore3d.Model.IsOpen() == false) return; List<VIZCore3D.NET.Data.Node> nodes = vizcore3d.Object3D.FromFilter(VIZCore3D.NET.Data.Object3dFilter.SELECTED_TOP); if (nodes.Count == 0) return; VIZCore3D.NET.Data.Section section = vizcore3d.Section.AddBox(true); vizcore3d.View.FitToView(section.BoundBox.GetCenter()); }