Click or drag to resize

SectionManagerAddBox Method

Add SectionBox

Namespace:  VIZCore3D.NET.Manager
Assembly:  VIZCore3D.NET (in VIZCore3D.NET.dll) Version: 2.8.24.1104 (2.8.24.1104)
Syntax
C#
public Section AddBox(
	bool partSection,
	float margine = 0f
)

Parameters

partSection
Type: SystemBoolean
PartSection
margine (Optional)
Type: SystemSingle
Margine

Return Value

Type: Section
Section
Examples
C#
// 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());
}
See Also