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]
Synopsis
MGSvgExport( image=string, includeLabel=boolean, includeName=boolean, includeTypeHint=boolean, includeUnimportable=boolean, membersAsId=boolean, rootGroup=string, selection=boolean, view=string, )
MGSvgExport |
|---|
-image(-i) string
|
The output image path to export the SVG to. |
-includeLabel(-il) boolean
|
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) boolean
|
Whether include the picker item name in the exported SVG element ID, the name will be wrapped with |
-includeTypeHint(-ith) boolean
|
Whether include the picker type hint in the exported SVG element ID, the type hint will be wrapped with |
-includeUnimportable(-iui) boolean
|
Whether we include those mgpicker item types that are not supported during SVG import. |
-membersAsId(-mai) boolean
|
Whether to use the members of a selectButton as its exported SVG element ID, the multiple members will be joined by the |
-rootGroup(-rg) string
|
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) boolean
|
Whether we export selected mgpicker items or all of them. |
-view(-v) string
|
Specify which picker view we want to export the SVG from. |
Flag can appear in Create mode
Flag can appear in Edit mode
Flag can appear in Query mode
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)