Skip to content

.NET API

CurveApi

Scriptable versions of the Artisan curve helpers that do not have a facade of their own (ring curve, text on curve, raster to vector, patterns and profile sweeps live in their own *Api classes): Advanced ArtisanAdvancedCurve symmetric control-point curve with offset AutoJoin ArtisanAutoJoin joins every open curve of the document Cross ArtisanCrossBuilder parametric cross outline (CrossCustomObject) Connect ArtisanCurveConnect arc blend between two points on solids Infinite ArtisanInfiniteCurve very long construction line / ray InfiniteLoop ArtisanInfiniteLoopCurve lemniscate (“infinity symbol”) curve IsoCurves ArtisanIsoCurve smart isocurves of a surface at a point Waves ArtisanWaves sine-like wave flowed along a curve AddSketches ArtisanAddSketches reference images on a 10 mm box (top/front/side) Millimetres everywhere; numeric 0 (or null/omitted) keeps the tool’s default. Every method returns the Guid(s) of the curves it added.

from ArtisanPlugin.Scripting import CurveApi

See also the Python package, ra.curve.

Methods

Method
AddSketchesReplicates the ArtisanAddSketches panel’s Accept: places reference sketch images on the faces of a 10 x 10 x 10 mm box at the origin — two textured surfaces per image (top: z=0 and z=10; front: y=0 and y=10; side: x=0 and x=10, the far one mirrored), rendered display mode, all in one group.
AdvancedReplicates ArtisanAdvancedCurve: a degree-3 control-point curve through points, mirrored by symmetry (NONE | X | Y | XY — the “Quad” option), optionally closed, plus an offset copy with connecting lines when offset != 0 (default 1 mm; NaN/omitted = default, 0 = no offset).
AutoJoinReplicates ArtisanAutoJoin: joins the open, visible curves of the document whose ends touch (document tolerance), like running _Join on all of them.
ConnectReplicates ArtisanCurveConnect: an arc blend leaving firstId at the point of its surface closest to firstPoint (along the normal) and arriving at secondId near secondPoint against its normal.
CrossReplicates the ArtisanCrossBuilder panel’s Accept: a closed cross outline centred at the world origin (the panel does the same), stored as a parametric CrossCustomObject on the primary user layer.
InfiniteReplicates ArtisanInfiniteCurve: a very long line (type LINE, centred on basePoint) or ray (RAY, starting at basePoint) used as a construction reference.
InfiniteLoopReplicates ArtisanInfiniteLoopCurve: a closed lemniscate (“infinity symbol”) interpolated through sampled points, centred at center.
IsoCurvesReplicates ArtisanIsoCurve: extracts the isocurve(s) of surfaceId (a surface, or the face of a solid nearest to point) passing through the point of the surface closest to point.
WavesReplicates ArtisanWaves: a smooth wave (waves full periods, default 3, peak-to-peak height mm, default 3) flowed along curveId from its start to its end.

AddSketches

IReadOnlyList<Guid> CurveApi.AddSketches(
    string topImagePath = null,
    string frontImagePath = null,
    string sideImagePath = null)

Replicates the ArtisanAddSketches panel’s Accept: places reference sketch images on the faces of a 10 x 10 x 10 mm box at the origin — two textured surfaces per image (top: z=0 and z=10; front: y=0 and y=10; side: x=0 and x=10, the far one mirrored), rendered display mode, all in one group. Give at least one image path (PNG/JPG). Returns the ids of the surfaces added.

ParameterTypeDefault
topImagePathstringnull
frontImagePathstringnull
sideImagePathstringnull

Returns IReadOnlyList<Guid>.

Advanced

IReadOnlyList<Guid> CurveApi.Advanced(
    IEnumerable<Point3d> points,
    IEnumerable<int> sharpIndices = null,
    string symmetry = "NONE",
    bool close = false,
    double offset = double.NaN,
    Plane? plane = null)

Replicates ArtisanAdvancedCurve: a degree-3 control-point curve through points, mirrored by symmetry (NONE | X | Y | XY — the “Quad” option), optionally closed, plus an offset copy with connecting lines when offset != 0 (default 1 mm; NaN/omitted = default, 0 = no offset). sharpIndices are 0-based indices of the points picked with Shift in the command (kinks). plane is the symmetry/offset plane; omitted = the active view’s construction plane. Returns the ids of the curves added to the primary user layer.

ParameterTypeDefault
pointsIEnumerable<Point3d>required
sharpIndicesIEnumerable<int>null
symmetrystring"NONE"
closeboolfalse
offsetdoubledouble.NaN
planePlane?null

Returns IReadOnlyList<Guid>.

AutoJoin

IReadOnlyList<Guid> CurveApi.AutoJoin(IEnumerable<Guid> curveIds = null)

Replicates ArtisanAutoJoin: joins the open, visible curves of the document whose ends touch (document tolerance), like running _Join on all of them. curveIds restricts the candidates (closed curves are always skipped); null/empty = every visible curve. Curves that do not touch anything are left untouched. Each joined result keeps the attributes of its first member. Returns the ids of the NEW joined curves.

ParameterTypeDefault
curveIdsIEnumerable<Guid>null

Returns IReadOnlyList<Guid>.

Connect

Guid CurveApi.Connect(Guid firstId, Point3d firstPoint, Guid secondId, Point3d secondPoint)

Replicates ArtisanCurveConnect: an arc blend leaving firstId at the point of its surface closest to firstPoint (along the normal) and arriving at secondId near secondPoint against its normal. Both ids must be solids/surfaces (breps); the two may be the same object. The result is a ConnectCurveCustomObject that remembers both parents. Returns the curve id.

ParameterTypeDefault
firstIdGuidrequired
firstPointPoint3drequired
secondIdGuidrequired
secondPointPoint3drequired

Returns Guid.

Cross

Guid CurveApi.Cross(
    double width = 0,
    double height = 0,
    double thickness = 0,
    double displacement = 0,
    double radius = 0,
    string mode = null)

Replicates the ArtisanCrossBuilder panel’s Accept: a closed cross outline centred at the world origin (the panel does the same), stored as a parametric CrossCustomObject on the primary user layer. Defaults come from the user’s saved Cross Builder defaults, else width 4, height 6, thickness 1, displacement 1, mode ROUND. mode is NONE | ROUND | CHAMFER; radius is the corner radius for ROUND/CHAMFER (0 = saved default, minimum 0.1 like the panel). Returns the curve id.

ParameterTypeDefault
widthdouble0
heightdouble0
thicknessdouble0
displacementdouble0
radiusdouble0
modestringnull

Returns Guid.

Infinite

Guid CurveApi.Infinite(
    Point3d basePoint,
    string mode = "TWO_POINTS",
    Point3d? secondPoint = null,
    Point3d? thirdPoint = null,
    double angle = 0,
    double length = 0,
    string type = "LINE",
    bool useCPlane = true)

Replicates ArtisanInfiniteCurve: a very long line (type LINE, centred on basePoint) or ray (RAY, starting at basePoint) used as a construction reference. mode chooses the direction: TWO_POINTS (needs secondPoint) | HORIZONTAL | VERTICAL | ANGLE (uses angle in degrees) | AXIS_X | AXIS_Y | AXIS_Z | BISECTOR (needs secondPoint and thirdPoint: bisector of the angle they form at basePoint) HORIZONTAL/VERTICAL/ANGLE follow the active construction plane when useCPlane is true, else World XY. length 0 = 10x the scene’s bounding-box diagonal (minimum 1000 mm). Returns the line id.

ParameterTypeDefault
basePointPoint3drequired
modestring"TWO_POINTS"
secondPointPoint3d?null
thirdPointPoint3d?null
angledouble0
lengthdouble0
typestring"LINE"
useCPlanebooltrue

Returns Guid.

InfiniteLoop

Guid CurveApi.InfiniteLoop(
    Point3d center,
    string kind = "BERNOULLI",
    double width = 0,
    double heightRatio = 0,
    double height = 0,
    bool flatBottom = false,
    int samples = 0,
    double rotation = 0,
    bool useCPlane = true)

Replicates ArtisanInfiniteLoopCurve: a closed lemniscate (“infinity symbol”) interpolated through sampled points, centred at center. kind BERNOULLI (default) or GERONO; width total width in mm (default 100); heightRatio scales the natural lobe height (default 0.5); height lifts the strands in Z at the crossing so one passes over the other (0 = flat; signed); flatBottom raises only the upper lobe; samples points per loop (default 180); rotation in degrees around the plane normal; plane = active CPlane or World XY. Returns the curve id.

ParameterTypeDefault
centerPoint3drequired
kindstring"BERNOULLI"
widthdouble0
heightRatiodouble0
heightdouble0
flatBottomboolfalse
samplesint0
rotationdouble0
useCPlanebooltrue

Returns Guid.

IsoCurves

IReadOnlyList<Guid> CurveApi.IsoCurves(
    Guid surfaceId,
    Point3d point,
    string direction = "U")

Replicates ArtisanIsoCurve: extracts the isocurve(s) of surfaceId (a surface, or the face of a solid nearest to point) passing through the point of the surface closest to point. direction U | V | BOTH (default U). Each result is a smart IsoCurveCustomObject (remembers its surface) on the primary user layer. Returns the ids (1 or 2 curves).

ParameterTypeDefault
surfaceIdGuidrequired
pointPoint3drequired
directionstring"U"

Returns IReadOnlyList<Guid>.

Waves

Guid CurveApi.Waves(Guid curveId, int waves = 0, double height = 0)

Replicates ArtisanWaves: a smooth wave (waves full periods, default 3, peak-to-peak height mm, default 3) flowed along curveId from its start to its end. Plain curve added with the document’s current attributes; the source curve is left untouched. Returns the new curve id.

ParameterTypeDefault
curveIdGuidrequired
wavesint0
heightdouble0

Returns Guid.