.NET API
SolidApi
Headless versions of the Solid family tools: ArtisanCut, ArtisanRecess, ArtisanCapRound, ArtisanCurveShell, ArtisanCurves1Rail and ArtisanCurves2Rails. Every method replicates the command’s Accept (same kernel objects, same destination layers / materials / custom objects) with the interactive picks turned into explicit ids. Millimetres; 0 = tool default (honouring the user’s saved defaults where the panel does).
from ArtisanPlugin.Scripting import SolidApi
See also the Python package, ra.solid.
Methods
| Method | |
|---|---|
CapRound | Rounded (domed) cap over a closed planar curve (the ArtisanCapRound command): a RoundCapCustomObject linked to the curve, on the metal layer with the metal material. |
CurveShell | Hollow shell (a wall + a floor) built from one or more closed planar curves (the ArtisanCurveShell command): one CurveShellCustomObject per curve on the metal layer with the metal material. |
Cut | Cuts solids with planar closed curves (the ArtisanCut command): each curve is extruded through the solids (twice the bounding-box diagonal, centred on the curve plane) and subtracted. |
Recess | Recess (default) or protrusion of the region a closed curve marks on a solid’s face (the ArtisanRecess command): the curve is pulled onto the face, the face is split and the inner piece is offset height mm (default 0.5) and subtracted (recess) or united (protrusion). |
SweepOneRail | Orients profile curves along one rail and sweeps them (the ArtisanCurves1Rail command). |
SweepTwoRails | Orients profile curves between two rails and sweeps them (the ArtisanCurves2Rails command). |
CapRound
Guid SolidApi.CapRound(Guid curveId, double height = 0, bool? flip = null)
Rounded (domed) cap over a closed planar curve (the ArtisanCapRound command): a RoundCapCustomObject linked to the curve, on the metal layer with the metal material. height 0 = the user’s saved default or 5 mm; flip null = saved default (false = along the curve normal). Returns the id of the cap object.
| Parameter | Type | Default |
|---|---|---|
curveId | Guid | required |
height | double | 0 |
flip | bool? | null |
Returns Guid.
CurveShell
IReadOnlyList<Guid> SolidApi.CurveShell(
IEnumerable<Guid> curveIds,
double height = 0,
double widthThickness = 0,
double heightThickness = 0,
string profile = null,
bool? flip = null)
Hollow shell (a wall + a floor) built from one or more closed planar curves (the ArtisanCurveShell command): one CurveShellCustomObject per curve on the metal layer with the metal material. 0 = the user’s saved default or the tool default: height 3, widthThickness 1 (wall), heightThickness 2 (floor; must be < height). profile ROUND | SHARP (offset corners); flip null = saved default. Returns the new ids.
| Parameter | Type | Default |
|---|---|---|
curveIds | IEnumerable<Guid> | required |
height | double | 0 |
widthThickness | double | 0 |
heightThickness | double | 0 |
profile | string | null |
flip | bool? | null |
Returns IReadOnlyList<Guid>.
Cut
IReadOnlyList<Guid> SolidApi.Cut(IEnumerable<Guid> solidIds, IEnumerable<Guid> curveIds)
Cuts solids with planar closed curves (the ArtisanCut command): each curve is extruded through the solids (twice the bounding-box diagonal, centred on the curve plane) and subtracted. The originals are replaced by the results, which keep their layer / material. Returns the ids of the resulting breps.
| Parameter | Type | Default |
|---|---|---|
solidIds | IEnumerable<Guid> | required |
curveIds | IEnumerable<Guid> | required |
Returns IReadOnlyList<Guid>.
Recess
IReadOnlyList<Guid> SolidApi.Recess(
Guid curveId,
Guid solidId,
double height = 0,
bool protrusion = false,
int faceIndex = -1)
Recess (default) or protrusion of the region a closed curve marks on a solid’s face (the ArtisanRecess command): the curve is pulled onto the face, the face is split and the inner piece is offset height mm (default 0.5) and subtracted (recess) or united (protrusion). faceIndex -1 = the face closest to the curve. The original is replaced by the result (same layer / material). Returns the new ids.
| Parameter | Type | Default |
|---|---|---|
curveId | Guid | required |
solidId | Guid | required |
height | double | 0 |
protrusion | bool | false |
faceIndex | int | -1 |
Returns IReadOnlyList<Guid>.
SweepOneRail
SweepResult SolidApi.SweepOneRail(
Guid railId,
IEnumerable<Guid> profileIds,
string mode = "OPEN",
double thickness = double.NaN,
bool flip = false,
bool sweep = true,
IEnumerable<double> positions = null)
Orients profile curves along one rail and sweeps them (the ArtisanCurves1Rail command). Profiles are drawn flat on World XY (base = bottom of their bounding box) and distributed evenly from the rail start, or at positions (normalized 0..1, one per profile). mode OPEN | CLOSE (chord) | COMFORT (curved inner) | THICKNESS (inner offset by thickness, NaN = 0.6 mm; negative allowed). flip mirrors the profiles across the rail; sweep false = only the oriented curves. Returns the ids of the swept breps and of the baked curves.
| Parameter | Type | Default |
|---|---|---|
railId | Guid | required |
profileIds | IEnumerable<Guid> | required |
mode | string | "OPEN" |
thickness | double | double.NaN |
flip | bool | false |
sweep | bool | true |
positions | IEnumerable<double> | null |
Returns SweepResult.
SweepTwoRails
SweepResult SolidApi.SweepTwoRails(
Guid rail1Id,
Guid rail2Id,
IEnumerable<Guid> profileIds,
string mode = "OPEN",
double thickness = double.NaN,
bool keepProportion = false,
bool sweep = true,
IEnumerable<double> positions = null)
Orients profile curves between two rails and sweeps them (the ArtisanCurves2Rails command). Each profile’s endpoints land on rail 1 and rail 2 (start->end), scaled to the distance between the rails: keepProportion false = uniform scale, true = the height is kept. Profiles spread evenly along rail 1 (rail 2 by closest point) or at positions (normalized 0..1 on rail 1). mode / thickness / sweep as in SweepOneRail. Returns the swept brep ids and the baked curve ids.
| Parameter | Type | Default |
|---|---|---|
rail1Id | Guid | required |
rail2Id | Guid | required |
profileIds | IEnumerable<Guid> | required |
mode | string | "OPEN" |
thickness | double | double.NaN |
keepProportion | bool | false |
sweep | bool | true |
positions | IEnumerable<double> | null |
Returns SweepResult.