Getting bounding box of any geometry object in Visual Studio C#


I would like to declare generic geometry custom parameter in C# visual studio.
And the retrieve input data in order to calculate its bounding box (be it mesh, curve or brep).

    protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager) {
        pManager.AddGeometryParameter("Geo", "G", "Geometry",GH_ParamAccess.item);

    protected override void SolveInstance(IGH_DataAccess DA) {
       //What kind of object AddGeometryParameter is ?

To what type I should retrieve geometry object in solve instance to get bounding box?

GeometryBase or IGH_GeometricGoo, Iā€™m not sure now.

I think you can just use IGH_GeometricGoo. Then you can do .BoundingBox(); on the GeometricGoo.

Thank you both, works well:)

1 Like