assemblyitems.py — Assembly Items Module
Wraps SpinFire.Scripting.API.Utilities.AssemblyItemUtilities. This is the largest module — it covers tree/assembly item queries, selection by path/name/type, appearance changes, and geometric transforms.
Enums
Enum |
Values |
|---|---|
|
|
|
|
Queries
Function |
Parameters |
Returns |
Description |
|---|---|---|---|
|
none |
|
Physical properties of the selected items. |
|
none |
|
Properties of the selected items. |
|
none |
|
Info about the currently selected items. Prints as a numbered list, e.g. |
|
none |
|
Children of the selected tree items. Prints as parent and children, e.g. |
Selection & Naming
Function |
Parameters |
Returns |
Description |
|---|---|---|---|
|
|
|
Renames the selected item. |
|
|
|
Selects an item by tree path. |
|
|
Collection of names/error messages |
Selects multiple items by tree path. |
|
|
Result message |
Selects items matching a name. |
|
|
Result message |
Selects items matching several names. |
|
|
Result message |
Selects items of a given type. |
|
|
Result message |
Selects items of several types. |
|
|
Result message |
Selects the parents of items matching a name. |
|
|
Result message |
Selects the parents of items matching several names. |
|
none |
Result message ( |
Clears the current selection. |
SelectItemsByName, SelectItemsByNames, SelectItemsByType and SelectItemsByTypes all call the same underlying AssemblyItemUtilities.SelectItems. They differ only in what they pass to it: one name, a list of names, one type, or a list of types.
Appearance
Function |
Parameters |
Returns |
Description |
|---|---|---|---|
|
|
Result message |
Sets both front and back color. |
|
|
Result message |
Sets front color only. |
|
|
Result message |
Sets back color only. |
|
|
Result message |
Sets the render mode of the selected items. |
|
|
Result message |
Sets transparency of the selected items. |
Transforms
Function |
Parameters |
Returns |
Description |
|---|---|---|---|
|
|
Result message |
Translates the selected items. |
|
|
Result message |
Rotates the selected items. |
|
|
Result message |
Non-uniform scaling. |
|
|
Result message |
Uniform scaling. |
|
both str/int |
Result message |
Transforms selected items from one coordinate system to another. |
|
|
Result message |
Mirrors the selected items through a plane. |
Points & Bounding Box
Function |
Parameters |
Returns |
Description |
|---|---|---|---|
|
|
Result message |
Exports all points. |
|
|
Result message |
Exports the selected points. |
|
|
|
Creates an axis-aligned bounding box around the selected item(s). |
Usage
1import spinfirescript as sfs
2
3sfs.SelectItemsByType(sfs.TreeItemType.Surface)
4print(sfs.GetSelectedItems())
5
6sfs.SetRenderMode(sfs.RenderMode.Metallic)
7sfs.SetTransparency(50)
8sfs.MoveSelectedAssemblyItems(10.0, 10.0, 10.0)
9sfs.RotateSelectedAssemblyItems(sfs.Axis.Y, 20.0)
10print(sfs.CreateAxisAlignedBoundingBox())