WorkplaneCollection

A collection of workplanes in the model.

Example

app = cf.GetApplication()
project = app:NewProject()

    -- Add two saved workplanes to the collection
    
wp1 = project.Workplanes:Add(cf.Point(1, 1, 1), cf.Point(1, 0, 0), cf.Point(0, 0, 1))
wp2 = project.Workplanes:Add(cf.Point(0, 0, -1), cf.Point(0, 1, 0), cf.Point(0, 0, 1))

    -- Get the current default workplane

wpDefault = project.Workplanes:GetDefault()

Usage locations (collections)

The following objects contain the WorkplaneCollection collection:

Property List

Count
The number of Workplane items in the collection. (Read only number)
Type
The object type string. (Read only string)

Method List

Add (properties table)
Create a workplane using a table of properties. (Returns a Workplane object.)
Add (origin Coordinate, uvector Coordinate, vvector Coordinate)
Create a workplane with the given parameters. (Returns a Workplane object.)
Add (label string, origin Coordinate, uvector Coordinate, vvector Coordinate)
Create a workplane with the given parameters. (Returns a Workplane object.)
Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
GetDefault ()
Get the current default workplane. (Returns a Workplane object.)
Item (index number)
Returns the Workplane at the given index. (Returns a Workplane object.)
Item (label string)
Returns the Workplane with the given label. (Returns a Workplane object.)
Items ()
Returns a table of Workplane. (Returns a List of Workplane object.)
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated. (Returns a boolean object.)

Index List

[number]
Returns the Workplane at the given index in the collection. (Read Workplane)
[string]
Returns the Workplane with the given name in the collection. (Read Workplane)

Property Details

Count
The number of Workplane items in the collection.
Type
number
Access
Read only
Type
The object type string.
Type
string
Access
Read only

Method Details

Add (properties table)
Create a workplane using a table of properties.
Input Parameters
properties(table)
The table of properties defining the workplane.
Return
Workplane
The new workplane.
Add (origin Coordinate, uvector Coordinate, vvector Coordinate)
Create a workplane with the given parameters.
Input Parameters
origin(Coordinate)
Origin coordinate.
uvector(Coordinate)
U vector direction.
vvector(Coordinate)
V vector direction.
Return
Workplane
The workplane.
Add (label string, origin Coordinate, uvector Coordinate, vvector Coordinate)
Create a workplane with the given parameters.
Input Parameters
label(string)
The label for the workplane.
origin(Coordinate)
Origin coordinate.
uvector(Coordinate)
U vector direction.
vvector(Coordinate)
V vector direction.
Return
Workplane
The workplane.
Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the Workplane.
Return
boolean
The success of the check.
GetDefault ()
Get the current default workplane.
Return
Workplane
The current default workplane.
Item (index number)
Returns the Workplane at the given index.
Input Parameters
index(number)
The index of the Workplane.
Return
Workplane
The Workplane at the given index.
Item (label string)
Returns the Workplane with the given label.
Input Parameters
label(string)
The label of the Workplane.
Return
Workplane
The Workplane with the given label.
Items ()
Returns a table of Workplane.
Return
List of Workplane
A table of Workplane.
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated.
Input Parameters
label(string)
The base name.
Return
boolean
The generated unique name label for Workplane.