Skip to content

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 = ” (Copy)”), preview included.
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.

ParameterType
typestrrequired
namestrrequired

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 = ” (Copy)”), preview included.

ParameterType
typestrrequired
namestrrequired
new_namestroptional — 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:”. Returns the curve id.

ParameterType
typestrrequired
namestrrequired
widthfloatoptional — None = the tool default
heightfloatoptional — None = the tool default
planeOptional[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.

ParameterType
typestrrequired

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”, …).

ParameterType
typestroptional — 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.

ParameterType
typestrrequired
namestrrequired
new_namestrrequired

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.

ParameterType
typestrrequired
namestrrequired

ra.assets.types()

ra.assets.types() -> List[str]

Valid values for the type arguments.