Box

A box in 3D space. The box is defined by its two corners.

Example

application = cf.Application.GetInstance()
project = application:NewProject()

corner = cf.Point(0,0,0)
Rectangle1 = project.Contents.Geometry:AddRectangle(corner, 1, 1)

    -- Retrieve the 'BoundingBox' of the rectangle

boundingBox = Rectangle1.Faces["Face1"].BoundingBox

    -- Access the 'Width' of the rectangle's 'BoundingBox'

width = boundingBox.Width

    -- Access the corner of the 'BoundingBox' furthest from the origin

boundingBoxCorner = boundingBox.Corner2

Usage locations

The Box object can be accessed from the following locations:

Property List

Centre
The centre of the box. (Read only Point)
Corner1
The corner of the box closest to the origin. (Read only Point)
Corner2
The second corner of the box farthest from the origin. (Read only Point)
Depth
The depth of the box (how long it is along the Y axis). (Read only number)
Height
The Height of the box (how long it is along the Z axis). (Read only number)
Type
The object type string. (Read only string)
Width
The width of the box (how long it is along the X axis). (Read only number)

Property Details

Centre
The centre of the box.
Type
Point
Access
Read only
Corner1
The corner of the box closest to the origin.
Type
Point
Access
Read only
Corner2
The second corner of the box farthest from the origin.
Type
Point
Access
Read only
Depth
The depth of the box (how long it is along the Y axis).
Type
number
Access
Read only
Height
The Height of the box (how long it is along the Z axis).
Type
number
Access
Read only
Type
The object type string.
Type
string
Access
Read only
Width
The width of the box (how long it is along the X axis).
Type
number
Access
Read only