Product Documentation
Virtuoso Schematic Editor SKILL Functions Reference
Product Version IC23.1, November 2023

schExportSVG

schExportSVG( 
?windowId d_windowId
?cellView d_cellview
?path s_path
?background t_background
?bgColor t_bgColor
?foreground t_foreground
?fgColor s_fgColor
?grid S_grid
?stipple S_stipple
?color S_color
?colorType t_colorType
?drawBBox g_drawBBox
?nameCallback g_nameCallback
)
=> t / nil

Description

Exports a schematic as a vector image in SVG format.

Arguments

?windowId d_windowId

The window which to export from or nil a cellview must be passed.
Default: nil

?cellView d_cellView

A valid schematic cellview which is to be exported.
Default: none

?path s_path

Path to a file to be exported ("path/test.svg") or nil.
Default: nil

?background t_background

Background color to be used when exporting. If not specified, and a windowId is specified, the background color follows that of the specified window. Otherwise, the background color is white.
Default: white

?bgColor t_bgColor

Alias of the background argument. Ignored if background is specified.

This argument provides compatibility with hiExportImage, which uses ?bgColor to specify the foreground color. In other cases, it is recommended to use the ?background argument.

?foreground t_foreground

The color to use as the foreground color for bicolor and monochrome exports. If the background color is not specified, the foreground color is black.
Default: black

?fgColor t_fgColor

Alias of the foreground argument. Ignored if foreground is specified.

This argument provides compatibility with hiExportImage, which uses ?fgColor to specify the foreground color. In other cases, it is recommended to use the ?foreground argument.

?grid S_grid

Grid style to be used.
Valid values: none, dotted, line
Default: none

?stipple S_stipple

Stippling style to be used.
Valid values: alpha, bitmap, vector
Default: alpha

?color S_color

Color mapping mode.

  • adjustForeground: Adjusts canvas colors to contrast effectively with the background color. Default setting when left unspecified.
  • fullColor: Uses the canvas colors directly.
  • hiMonochrome: Interpolates canvas colors between the background color and the foreground color the same way as hiExportImage.
  • hiBiColor: Draws everything with the foreground color

Default: adjustForeground

?colorType t_colorType

Selects a color mapping mode based on hiExportImage.
Valid values: fullColor, monochrome, biColor

?drawBBox g_drawBBox

Controls whether to draw instance selection boxes.
Default: t

?nameCallback g_nameCallback

Lets you pass in a callable which is used to name the instance selection boxes. You can also use nil. Example: (lambda (fig path) fig->name)

Value Returned

When the ?path is specified:

t

SVG file successfully saved to disk.

nil

SVG export failed.

When the ?path is nil:

string

String containing the SVG text.

nil

SVG export failed.

Examples

The current window is exported to the file "test.svg".

when( window = hiGetCurrentWindow()
        schExportSVG(?windowId window ?path "test.svg")
    )

You get a string from the SVG exporter which you can then write to disk or insert into another file or export.

when(window = hiGetCurrentWindow()
        schExportSVG(?windowId window
                     ?background "black"
                     ?stipple 'vector)
    )
    when(svg
        println(svg)
    )

Return to top
 ⠀
X