MGSvgExport

MGSvgExport is NOT undoable, and editable.

This command exports picker contents to SVG file so user can refine it or use it as a visual reference in vector program.

Go to: [MEL Examples] [Python Examples]

MGSvgExport

-image(-i)stringC E

The output image path to export the SVG to.

-includeLabel(-il)booleanC E

Whether we include label of mgpicker item in the SVG, during SVG import these texts will duplicate with mgpicker item’s own label.

-includeName(-inm)booleanE

Whether include the picker item name in the exported SVG element ID, the name will be wrapped with [].

-includeTypeHint(-ith)booleanE

Whether include the picker type hint in the exported SVG element ID, the type hint will be wrapped with (). The type hint will be recognized during the import.

-includeUnimportable(-iui)booleanC E

Whether we include those mgpicker item types that are not supported during SVG import.

-membersAsId(-mai)booleanQ E

Whether to use the members of a selectButton as its exported SVG element ID, the multiple members will be joined by the -.

-rootGroup(-rg)stringC E

The id of group or panel we want to export its content to SVG, empty string or absence of this flag will export all content to SVG.

-selection(-sel)booleanC E

Whether we export selected mgpicker items or all of them.

-view(-v)stringC E

Specify which picker view we want to export the SVG from.

C Flag can appear in Create mode   E Flag can appear in Edit mode
Q Flag can appear in Query mode   M Flag can be used more than once.

MEL examples

string $tempDir = `internalVar -utd`;
string $svgFile = $tempDir + "svgFile.svg";
MGSvgExport -image $svgFile -includeLabel 0;

Python examples

from mgpicker import mgp
import tempfile
import os

svgFile = os.path.join(tempfile.gettempdir(), "svgFile.svg")
mgp.MGSvgExport(image=svgFile, includeLabel=False)