ShapeCollection

A collection of shapes.

Example

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

-- Create an open ring shape
properties = cf.OpenRingShape.GetDefaultProperties()
properties.Label = "OpenRingShape1"
application.Project.Definitions.PeriodicStructures.Shapes:AddOpenRing(properties)

-- Retrieve a shape object from the collection
shape1 = application.Project.Definitions.PeriodicStructures.Shapes[1]

-- Build geometry for the selected shape
openRing1 = shape1:BuildGeometry()

Inheritance

The ShapeCollection object is derived from the Object object.

Property List

Count
The number of Shape items in the collection. (Read only number)
Label
The object label. (Read/Write string)
Type
The object type string. (Read only string)

Method List

AddCross (properties table)
Create a cross shape from a table defining the properties. (Returns a CrossShape object.)
AddCross (armlengthu Expression, armlengthv Expression, stripwidth Expression)
Create a cross shape with the specified arm lenths and strip width. (Returns a CrossShape object.)
AddEllipse (properties table)
Create an ellipse shape from a table defining the properties. (Returns a EllipseShape object.)
AddEllipse (radiusu Expression, radiusv Expression)
Create an ellipse shape with the specified radius U and radius V. (Returns a EllipseShape object.)
AddHexagon (properties table)
Create a hexagon shape from a table defining the properties. (Returns a HexagonShape object.)
AddOpenRing (properties table)
Create an open ring shape from a table defining the properties. (Returns a OpenRingShape object.)
AddOpenRing (outerradius Expression, innerradius Expression, gapangle Expression, startangle Expression)
Create an open ring shape with the specified outer and inner radius, gap and start angle. (Returns a OpenRingShape object.)
AddPlane (properties table)
Create a plane shape from a table defining the properties. (Returns a PlaneShape object.)
AddPlane (width Expression, depth Expression)
Create a plane shape with the specified width and depth. (Returns a PlaneShape object.)
AddRing (properties table)
Create a ring shape from a table defining the properties. (Returns a RingShape object.)
AddRing (outerradius Expression, innerradius Expression)
Create a ring shape with the specified outer and inner radius. (Returns a RingShape object.)
AddSpiralCross (properties table)
Create a spiral cross shape from a table defining the properties. (Returns a SpiralCrossShape object.)
AddSpiralCross (armlength Expression, edgelength Expression, spirallength Expression, stripwidth Expression)
Create a spiral cross shape with the specified arm, edge and spiral length and strip width. (Returns a SpiralCrossShape object.)
AddSplitRing (properties table)
Create an split ring shape from a table defining the properties. (Returns a SplitRingShape object.)
AddSplitRing (outerradius Expression, innerradius Expression, gapangle Expression, startangle Expression)
Create a split ring shape with the specified outer and inner radius, gap and start angle. (Returns a SplitRingShape object.)
AddStripCross (properties table)
Create a strip cross shape from a table defining the properties. (Returns a StripCrossShape object.)
AddStripCross (armlengthu Expression, armlengthv Expression, stripwidth Expression, slotwidth Expression)
Create a strip cross shape with the specified arm lengths, strip width and slot width. (Returns a StripCrossShape object.)
AddStripHexagon (properties table)
Create a strip hexagon shape from a table defining the properties. (Returns a StripHexagonShape object.)
AddStripHexagon (width Expression, stripwidth Expression)
Create a strip hexagon shape with the specified width and strip width. (Returns a StripHexagonShape object.)
AddTCross (properties table)
Create a T-cross shape from a table defining the properties. (Returns a TCrossShape object.)
AddTCross (armlength Expression, edgelength Expression, stripwidth Expression)
Create a T-cross shape with the specified arm length, edge length and strip width. (Returns a TCrossShape object.)
AddTrifilar (properties table)
Create a trifilar shape from a table defining the properties. (Returns a TrifilarShape object.)
AddTrifilar (length Expression, stripwidth Expression)
Create a trifilar shape with the specified length and strip width. (Returns a TrifilarShape object.)
Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
Delete ()
Deletes the entity.
Duplicate ()
Duplicates the entity. (Returns a Object object.)
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step. (Returns a table object.)
Item (index number)
Returns the Shape for the given index in the collection. (Returns a Shape object.)
Item (label string)
Returns the Shape for the given label in the collection. (Returns a Shape object.)
Items ()
Returns a table of Shape items. (Returns a UnsupportedType(List of Shape) object.)
SetProperties (properties Object)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
UniqueName (label string)
Generates a unique name base 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 string object.)

Static Function List

GetDefaultProperties ()
Creates a table containing the default settings to create an object. (Returns a table object.)

Property Details

Count
The number of Shape items in the collection.
Type
number
Access
Read only
Label
The object label.
Type
string
Access
Read/Write
Type
The object type string.
Type
string
Access
Read only

Method Details

AddCross (properties table)
Create a cross shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new cross shape.
Return
CrossShape
The cross shape.
AddCross (armlengthu Expression, armlengthv Expression, stripwidth Expression)
Create a cross shape with the specified arm lenths and strip width.
Input Parameters
armlengthu(Expression)
The cross shape arm length (U).
armlengthv(Expression)
The cross shape arm length (V).
stripwidth(Expression)
The cross strip width.
Return
CrossShape
The cross shape.
AddEllipse (properties table)
Create an ellipse shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new ellipse shape.
Return
EllipseShape
The ellipse shape.
AddEllipse (radiusu Expression, radiusv Expression)
Create an ellipse shape with the specified radius U and radius V.
Input Parameters
radiusu(Expression)
The ellipse shape radius (U).
radiusv(Expression)
The ellipse shape radius (V).
Return
EllipseShape
The ellipse shape.
AddHexagon (properties table)
Create a hexagon shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new hexagon shape.
Return
HexagonShape
The hexagon shape.
AddOpenRing (properties table)
Create an open ring shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new open ring shape.
Return
OpenRingShape
The open ring shape.
AddOpenRing (outerradius Expression, innerradius Expression, gapangle Expression, startangle Expression)
Create an open ring shape with the specified outer and inner radius, gap and start angle.
Input Parameters
outerradius(Expression)
The ring shape outer radius.
innerradius(Expression)
The ring shape inner radius.
gapangle(Expression)
The ring shape gap angle.
startangle(Expression)
The ring shape opening start angle.
Return
OpenRingShape
The open ring shape.
AddPlane (properties table)
Create a plane shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new plane shape.
Return
PlaneShape
The plane shape.
AddPlane (width Expression, depth Expression)
Create a plane shape with the specified width and depth.
Input Parameters
width(Expression)
The plane shape width.
depth(Expression)
The plane shape depth.
Return
PlaneShape
The plane shape.
AddRing (properties table)
Create a ring shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new ring shape.
Return
RingShape
The ring shape.
AddRing (outerradius Expression, innerradius Expression)
Create a ring shape with the specified outer and inner radius.
Input Parameters
outerradius(Expression)
The ring shape outer radius.
innerradius(Expression)
The ring shape inner radius.
Return
RingShape
The ring shape.
AddSpiralCross (properties table)
Create a spiral cross shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new spiral cross shape.
Return
SpiralCrossShape
The spiral cross shape.
AddSpiralCross (armlength Expression, edgelength Expression, spirallength Expression, stripwidth Expression)
Create a spiral cross shape with the specified arm, edge and spiral length and strip width.
Input Parameters
armlength(Expression)
The cross shape arm length.
edgelength(Expression)
The cross shape edge length.
spirallength(Expression)
The cross shape spiral length.
stripwidth(Expression)
The cross shape strip width.
Return
SpiralCrossShape
The spiral cross shape.
AddSplitRing (properties table)
Create an split ring shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new split ring shape.
Return
SplitRingShape
The split ring shape.
AddSplitRing (outerradius Expression, innerradius Expression, gapangle Expression, startangle Expression)
Create a split ring shape with the specified outer and inner radius, gap and start angle.
Input Parameters
outerradius(Expression)
The ring shape outer radius.
innerradius(Expression)
The ring shape inner radius.
gapangle(Expression)
The ring shape gap angle.
startangle(Expression)
The ring shape opening start angle.
Return
SplitRingShape
The split ring shape.
AddStripCross (properties table)
Create a strip cross shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new strip cross shape.
Return
StripCrossShape
The strip cross shape.
AddStripCross (armlengthu Expression, armlengthv Expression, stripwidth Expression, slotwidth Expression)
Create a strip cross shape with the specified arm lengths, strip width and slot width.
Input Parameters
armlengthu(Expression)
The strip cross shape arm length (U).
armlengthv(Expression)
The strip cross shape arm length (V).
stripwidth(Expression)
The strip cross shape strip width.
slotwidth(Expression)
The strip cross shape slot width.
Return
StripCrossShape
The strip cross shape.
AddStripHexagon (properties table)
Create a strip hexagon shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new strip hexagon shape.
Return
StripHexagonShape
The strip hexagon shape.
AddStripHexagon (width Expression, stripwidth Expression)
Create a strip hexagon shape with the specified width and strip width.
Input Parameters
width(Expression)
The hexagon shape width.
stripwidth(Expression)
The hexagon shape strip width.
Return
StripHexagonShape
The strip hexagon shape.
AddTCross (properties table)
Create a T-cross shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new T-cross shape.
Return
TCrossShape
The T-cross shape.
AddTCross (armlength Expression, edgelength Expression, stripwidth Expression)
Create a T-cross shape with the specified arm length, edge length and strip width.
Input Parameters
armlength(Expression)
The cross shape arm length.
edgelength(Expression)
The cross shape edge length.
stripwidth(Expression)
The cross shape strip width.
Return
TCrossShape
The T-cross shape.
AddTrifilar (properties table)
Create a trifilar shape from a table defining the properties.
Input Parameters
properties(table)
A table of properties defining the new trifilar shape.
Return
TrifilarShape
The trifilar shape.
AddTrifilar (length Expression, stripwidth Expression)
Create a trifilar shape with the specified length and strip width.
Input Parameters
length(Expression)
The trifilar shape length.
stripwidth(Expression)
The trifilar shape strip width.
Return
TrifilarShape
The trifilar shape.
Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the item.
Return
boolean
The success of the check.
Delete ()
Deletes the entity.
Duplicate ()
Duplicates the entity.
Return
Object
The new (duplicated) entity.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step.
Return
table
A table defining the properties.
Item (index number)
Returns the Shape for the given index in the collection.
Input Parameters
index(number)
The index of the Shape.
Return
Shape
The item in the collection
Item (label string)
Returns the Shape for the given label in the collection.
Input Parameters
label(string)
The label of the Shape.
Return
Shape
The item in the collection
Items ()
Returns a table of Shape items.
Return
UnsupportedType(List of Shape)
The list of items in the collection
SetProperties (properties Object)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
Input Parameters
properties(Object)
A table of properties defining the new state of the object.
UniqueName (label string)
Generates a unique name base 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
string
The generated unique name label for the item.

Static Function Details

GetDefaultProperties ()
Creates a table containing the default settings to create an object.
Return
table
A table containing the default properties.