Skip to content

.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
CapRoundRounded (domed) cap over a closed planar curve (the ArtisanCapRound command): a RoundCapCustomObject linked to the curve, on the metal layer with the metal material.
CurveShellHollow 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.
CutCuts 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.
RecessRecess (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).
SweepOneRailOrients profile curves along one rail and sweeps them (the ArtisanCurves1Rail command).
SweepTwoRailsOrients 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.

ParameterTypeDefault
curveIdGuidrequired
heightdouble0
flipbool?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.

ParameterTypeDefault
curveIdsIEnumerable<Guid>required
heightdouble0
widthThicknessdouble0
heightThicknessdouble0
profilestringnull
flipbool?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.

ParameterTypeDefault
solidIdsIEnumerable<Guid>required
curveIdsIEnumerable<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.

ParameterTypeDefault
curveIdGuidrequired
solidIdGuidrequired
heightdouble0
protrusionboolfalse
faceIndexint-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.

ParameterTypeDefault
railIdGuidrequired
profileIdsIEnumerable<Guid>required
modestring"OPEN"
thicknessdoubledouble.NaN
flipboolfalse
sweepbooltrue
positionsIEnumerable<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.

ParameterTypeDefault
rail1IdGuidrequired
rail2IdGuidrequired
profileIdsIEnumerable<Guid>required
modestring"OPEN"
thicknessdoubledouble.NaN
keepProportionboolfalse
sweepbooltrue
positionsIEnumerable<double>null

Returns SweepResult.