Example Code for Custom Bounding Box API - Intergraph Smart 3D - Reference Data - Hexagon PPM

Intergraph Smart 3D Hangers and Supports Reference Data

Language
English
Product
Intergraph Smart 3D
Subproduct
Hangers and Supports
Search by Category
Reference Data
Smart 3D Version
13

The following examples show how to use the BBX API in C# .NET. This code is used by the sample BBX supports defined on the PipeHgrAssemblies,Ingr.SP3D.Content.Support.Rules.Assy_BBX sheet in the HS_Assembly.xls workbook. This worksheet is available on the customer support web site.

Example 1

//Vertical Plane Normal Along Route - Z Axis Towards Structure

globalZ = BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.GlobalZ);
GlobalZ = my_IJHgrBBXHlpr.GetVectorAlong(BBXVec_GlobalZ)
//Get Global Z

//Project Route X-Axis into Horizontal Plane

bbX = BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.AlongRoute, globalZ);

//Project Vector Orthogonal to Route into the BBX Plane

bbZ = BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.OrthogonalToRoute, bbX);

BoundingBoxHelper.CreateBoundingBox(bbZ, bbX, "TestBBX", false, mirror, false, true);

Example 2

//Vertical Plane Normal Along Route - Z Axis Orthogonal to Global CS

BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.GlobalZ); //Get Global Z

//Project Route into Horizontal Plane

bbX = BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.AlongRoute, globalZ);

BoundingBoxHelper.GetVectorForBBXDirection(BoundingBoxDirection.OrthogonalToRoute, bbX);

//Get Horizontal Vector in the BBX Plane (For Orthogonal direction)

bbY = globalZ.Cross(bbX);

//Get Orthogonal Vector in the plane of the BBX (Gz, -Gz, By, -By) depending
// on Angle

if (AngleBetweenVectors(globalZ, bbZ) < Math.Round(Math.PI, 2) / 4)

bbZ = globalZ;

else if (AngleBetweenVectors(bbY, bbZ) > 3 * (Math.Round(Math.PI, 2) / 4))

{

bbZ.X = -globalZ.X;

bbZ.Y = -globalZ.Y;

bbZ.Z = -globalZ.Z;

}

else if (AngleBetweenVectors(bbY, bbZ) < Math.Round(Math.PI, 2) / 4)

bbZ = bbY;

else

bbZ.X = -bbY.X; bbZ.Y = bbY.Y; bbZ.Z = bbY.Z;

BoundingBoxHelper.CreateBoundingBox(bbZ, bbX, "TestBBX", false, mirror, false, true);