-
Notifications
You must be signed in to change notification settings - Fork 32
Quick reference
Scott Pakin edited this page Dec 24, 2023
·
45 revisions
This page serves as a quick reference for all of Simple Inkscape Scripting's functions, object methods, variables, and properties. Each is shown with its arguments or data type and is formatted as a hyperlink to a page providing details and examples.
-
all_pages
()
-
all_shapes
()
-
apply_action
(action, [obj])
-
apply_path_operation
(op, [obj, …])
-
arc
((cx, cy), (rx, ry), (ang1, ang2), arc_type)
-
circle
((cx, cy), radius)
-
clip_path
(obj, clip_units)
-
clone
(obj)
-
connector
(obj1, obj2, ctype, curve)
-
duplicate
(obj)
-
ellipse
((cx. cy), (rx, ry))
-
filter_effect
(name, pt1, pt2, filter_units, primitive_units, auto_region)
-
foreign
((x1, y1), (x2, y2), xml)
-
group
([obj, …])
-
guide
((x, y), angle, color, label)
-
hyperlink
(objs, href, title, target, mime_type)
-
image
(fname, (x, y), embed)
-
inkex_object
(iobj)
-
layer
(name, [obj, …])
-
line
((x1, y1), (x2, y2))
-
linear_gradient
(pt1, pt2, repeat, gradient_units, template)
-
marker
(obj, (x, y), orient, marker_units, view_box)
-
mask
(obj, mask_units)
-
objects_from_svg_file
(file, keep_layers)
-
page
(name, pos, size)
-
path
([elt, …])
-
path_effect
(name, key=value, …)
-
polygon
([(x1, y1), (x2, y2), …, (xn, yn)])
-
polyline
([(x1, y1), (x2, y2), …, (xn, yn)])
-
pop_defaults
()
-
print
(s, …)
-
push_defaults
()
-
radial_gradient
(center, radius, focus, fr, repeat, gradient_units, template)
-
randcolor
([values, …], [space])
-
rect
((x1, y1), (x2, y2), round)
-
regular_polygon
(sides, (cx, cy), radius, angle, round, random)
-
save_file
(file)
-
selected_shapes
()
-
star
(sides, (cx, cy), (rt, rb), (angt, angb), round, random)
-
style
(key=value, …)
-
text
(msg, (x, y), obj)
-
transform
(t)
-
z_sort
([obj, …])
While not listed in the above, all shape-creation functions also accept a transform
argument, which takes either a string or an inkex
Transform
object; a conn_avoid
Boolean argument; and a clip_path
object argument. Any trailing key=value arguments update the object's style. Underscores in key are converted to dashes. See Common arguments for details.
-
add
(ftype, key=value, …)
-
add_stop
(ofs, color, opacity)
-
add_text
(msg, (x, y))
-
animate
(objs, duration, begin_time, key_times, repeat_count, repeat_time, keep, interpolation, path, path_rotate, at_end, attr_filter)
-
append
(obj)
-
apply_path_effect
(lpe)
-
bounding_box
()
-
bounding_box
()
-
bounding_box
()
-
get_inkex_object
()
-
get_parent
()
-
get_size_by_name
(name, landscape)
-
remove
()
-
resize_by_name
(name, landscape)
-
resize_to_content
([obj, …])
-
reverse
()
-
rotate
(angle, anchor, first)
-
rotate_path
(angle, anchor)
-
scale
(factor, anchor, first)
-
scale_path
(factor, anchor)
-
skew
((sx, sy), anchor, first)
-
skew_path
((sx, sy), anchor)
-
style
(key=value, …)
-
svg
(xmlns, pretty_print)
-
svg_get
(attr, as_str)
-
svg_set
(attr, val)
-
to_def
()
-
to_path
(all_curves)
-
translate
((x, y), first)
-
translate_path
((x, y))
-
ungroup
()
orungroup
(obj)
orungroup
([obj, …])
-
unremove
()
-
z_order
(target, n)
-
canvas
(typeSimpleCanvas
) -
extension
(typeinkex.EffectExtension
) -
guides
(typelist
) -
metadata
(typeSimpleMetadata
) -
script_filename
(typestr
) -
svg_root
(typeinkex.SvgDocumentElement
) -
user_args
(type[string]
)
-
angle
(typefloat
) -
color
(typestr
) -
contributors
(typestr
) -
coverage
(typestr
) -
creator
(typestr
) -
date
(type [date
time.datetime
](https://docs.python.org/3/library/datetime.html#datetime-objects)) -
description
(typestr
) -
height
(typefloat
) -
height
(typefloat
) -
identifier
(typestr
) -
keywords
(type[str]
) -
label
(typestr
) -
language
(typestr
) -
license
(typestr
ordict
) -
position
(typetuple
) -
publisher
(typestr
) -
raw_date
(typestr
) -
relation
(typestr
) -
rights
(typestr
) -
source
(typestr
) -
tag
(typestr
) -
title
(typestr
) -
transform
(typeinkex.Transform
) -
true_height
(typefloat
orstr
) -
true_width
(typefloat
orstr
) -
viewbox
(type[float]
) -
viewbox
(type[float]
) -
width
(typefloat
) -
width
(typefloat
)