If it is possible to add some Command-Line Parameters into Inkscape ?

Asked by jiangminge on 2017-04-11

If it is possible to add some Command-Line Parameters into Inkscape ?
How this function work : Add below 2 Command-Line Parameters into Inkscape ?

1、 If it is possible to get the Width and Height of the Equivalents Specific ID
Group Path Set which inside the Given .SVG file according with Specific ID
Group ?

1) Example : Inkscape.exe”Z:\123.SVG”-ID=layer1 w
   The Width of Return Path Set is 3.313px inside Inkscape

2)Example : Inkscape.exe”Z\123.svg”-ID=layer1 h
 The Height of Return Path Set is 4.811px inside Inkscape

2、 If it is possible to set up the Value of The X Cordinate,Y Cordinate,Width,
Height of the Equivalents Specific ID Group Path Set which inside the
Given .SVG file according with Specific IDGroup ?

  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(233.54677,-351.27387)">
    <path
       inkscape:connector-curvature="0"
       id="path3427"
       d="m -231.88551,351.44196 c -0.0979,0.51955 -0.38714,1.16933 -0.635,1.67216 -0.27517,0.67733 -0.508,1.37582 -0.82549,2.07432 -0.0212,0.21166 -0.14817,0.40216 -0.1905,0.5715"
       style="fill:none;stroke:#000000;stroke-width:0.02116651px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       sodipodi:nodetypes="cccc" />
    <path
       inkscape:connector-curvature="0"
       id="path3429"
       d="m -231.84758,351.28039 c 0.381,0.48683 0.70289,1.38923 0.97806,2.04539 0.20563,0.76199 0.31261,1.52399 0.50799,2.30716 0.008,0.14639 0.0172,0.40775 -0.0635,0.40216"
       style="fill:none;stroke:#000000;stroke-width:0.02116651px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       sodipodi:nodetypes="cccc" />
    <path
       inkscape:connector-curvature="0"
       id="path3431"
       d="m -233.18797,353.99956 c 0.12724,-0.0469 0.6211,-0.0584 0.83321,-0.18401 0.32208,-0.0937 0.47922,-0.0115 0.77101,-0.17666 0.4445,-0.10584 0.42816,-0.0807 0.85149,-0.20769"
       style="fill:none;stroke:#000000;stroke-width:0.02116651px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
       sodipodi:nodetypes="cccc" />
  </g>

Question information

Language:
English Edit question
Status:
Answered
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Last query:
2017-04-11
Last reply:
2017-04-11
Hachmann (marenhachmann) said : #1

Hi jianminge,

I am not entirely sure that I understand everything :/

Ad 1.):
---------------------
I think you are looking for:

-I, --query-id

    Set the ID of the object whose dimensions are queried. If not set, query options will return the dimensions of the drawing (i.e. all document objects), not the page or viewbox
-X, --query-x

    Query the X coordinate of the drawing or, if specified, of the object with --query-id. The returned value is in px (SVG user units).
-Y, --query-y

    Query the Y coordinate of the drawing or, if specified, of the object with --query-id. The returned value is in px (SVG user units).
-W, --query-width

    Query the width of the drawing or, if specified, of the object with --query-id. The returned value is in px (SVG user units).
-H, --query-height

    Query the height of the drawing or, if specified, of the object with --query-id. The returned value is in px (SVG user units).
-S, --query-all

    Prints a comma delimited listing of all objects in the SVG document with IDs defined, along with their x, y, width, and height values.

Example:
Retrieving the width of an object:
inkscape filename.svg --query-width --query-id text1555

See also https://inkscape.org/en/doc/inkscape-man.html#EXAMPLES

Ad 2.):
----------

- No, I don't think that works. The command line parameters from the --verb-list do not take any arguments, currently.
This is a long-standing feature request.

- You can use an extension for that inside Inkscape, or use the inkex.py and other extension files that come with Inkscape as a basis for writing your own script that works on the files.

Hope that answers your questions,
 Kind Regards,
 Maren

Can you help with this problem?

Provide an answer of your own, or ask jiangminge for more information if necessary.

To post a message you must log in.