Python package
ra.assets
The profile library the parametric tools build from.
import rhinoartisan as ra
Wraps ArtisanPlugin.Scripting.AssetsApi.
Functions
| Function | |
|---|---|
delete() | Permanently deletes a user asset from the library. |
duplicate() | Copies an asset (standard ones included) as a new user asset named new_name (empty = ” |
export_as_curve() | Adds the asset’s profile to the document as a curve so it can be seen before choosing it: the shape the tools build from (mirrored and closed, or open for RING_SIDE_CURVE), sized width x height mm (0 = 5 x 3, like the Assets panel’s insert; side curves keep their aspect and only follow height) and centered on plane’s origin (default: the active construction plane). |
get_default() | The default asset for a type — the one every Create uses when no profile name is given. |
list() | Lists the assets in the library, optionally filtered by type (“RING_PROFILE”, “BEZEL_PROFILE”, “CHARM_PROFILE”, …). |
rename() | Renames a user asset. |
set_default() | Makes an asset the default of its type: every Create uses it when no profile is given. |
types() | Valid values for the type arguments. |
ra.assets.delete()
ra.assets.delete(type: str, name: str) -> bool
Permanently deletes a user asset from the library. Standard assets are protected. Objects already built from it keep their embedded copy. Returns True when deleted.
| Parameter | Type | |
|---|---|---|
type | str | required |
name | str | required |
ra.assets.duplicate()
ra.assets.duplicate(type: str, name: str, new_name=None) -> AssetInfo
Copies an asset (standard ones included) as a new user asset named new_name (empty = ”
| Parameter | Type | |
|---|---|---|
type | str | required |
name | str | required |
new_name | str | optional — None = the tool default |
ra.assets.export_as_curve()
ra.assets.export_as_curve(type: str, name: str, width=None, height=None, plane=None) -> str
Adds the asset’s profile to the document as a curve so it can be seen before choosing it: the shape the tools build from (mirrored and closed, or open for RING_SIDE_CURVE), sized width x height mm (0 = 5 x 3, like the Assets panel’s insert; side curves keep their aspect and only follow height) and centered on plane’s origin (default: the active construction plane). name accepts the asset name or “id:
| Parameter | Type | |
|---|---|---|
type | str | required |
name | str | required |
width | float | optional — None = the tool default |
height | float | optional — None = the tool default |
plane | Optional[PlaneLike] | optional — None = the tool default |
ra.assets.get_default()
ra.assets.get_default(type: str) -> AssetInfo
The default asset for a type — the one every Create uses when no profile name is given.
| Parameter | Type | |
|---|---|---|
type | str | required |
ra.assets.list()
ra.assets.list(type=None) -> List[AssetInfo]
Lists the assets in the library, optionally filtered by type (“RING_PROFILE”, “BEZEL_PROFILE”, “CHARM_PROFILE”, …).
| Parameter | Type | |
|---|---|---|
type | str | optional — None = the tool default |
ra.assets.rename()
ra.assets.rename(type: str, name: str, new_name: str) -> AssetInfo
Renames a user asset. Standard (factory) assets cannot be renamed: tool defaults and scripts refer to them by name. The new name must be free within the type.
| Parameter | Type | |
|---|---|---|
type | str | required |
name | str | required |
new_name | str | required |
ra.assets.set_default()
ra.assets.set_default(type: str, name: str) -> AssetInfo
Makes an asset the default of its type: every Create uses it when no profile is given.
| Parameter | Type | |
|---|---|---|
type | str | required |
name | str | required |
ra.assets.types()
ra.assets.types() -> List[str]
Valid values for the type arguments.