SVG move object with type path

Hello,

Am pretty new in SVG editing and am looking to a way to move one of my element into my SVG. Am able to move cercle and rectangle because I have the property for the xy position but with a type Path its look like I can't not make it. Any clue how to make it? Did I need a script python to look the D property and make change on it to change the XY position?

Best regards Gabriel



Is using inkscape (or similar )to edit the raw SVG not an option?

am actually using inkscape and on the editor you can manually position the path element into XY but not dynamic with like an attribute.. That what am looking for..

So what exactly are you trying to do? Are you trying to move the circle and change the width of the rectangle? If so, yes, you should just be able to write to the circle's x/y coordinate. The rectangle, because it's a path, will be slightly more involved. I suggest you read up on how the d path works, but really it's just a bunch of coordinates and/or numbers telling the path how to be drawn, from start to finish.

I want to move the object on top of the conveyor but this object is not a cercle or rectangle its a path and I dont have the property of moving path into XY its look like a attribute name D. But I think I can make a group with the svg path and use something like translate(0.79377481) but not sure is there a better solution

Can you provide the SVG xml in here?

Looking up how to do it with a raw SVG led me to this answer on stackoverflow
that uses the transform attribute on the <g> element that contains the path. I'm not sure exactly how that would translate (or if it can translate) to the ignition property tree representation.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>









you will need to put it into a code block image, otherwise the forum will see it as HTML to render

3 Likes
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   width="179.35768mm"
   height="65.205994mm"
   viewBox="0 0 179.35768 65.205994"
   version="1.1"
   id="svg10274"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs10271" />
  <g
     id="layer1">
    <rect
       style="fill:#006c00;fill-rule:evenodd;stroke:#7e1800;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill"
       id="conveyor"
       width="150.35883"
       height="27.67594"
       x="14.499434"
       y="36.868595" />
    <circle
       style="fill:#006c00;fill-rule:evenodd;stroke:#7e1800;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill"
       id="rollerleft"
       cx="14.499433"
       cy="50.706562"
       r="13.837973" />
    <circle
       style="fill:#006c00;fill-rule:evenodd;stroke:#7e1800;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill"
       id="rollerright"
       cx="164.85826"
       cy="50.706562"
       r="13.837967" />
    <path
       id="item"
       style="fill:#006c00;fill-rule:evenodd;stroke:#7e1800;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill"
       d="M 20.811214,0.66145998 H 33.736075 A 7.3021806,7.3021806 45 0 1 41.038256,7.9636406 V 33.01012 H 12.632772 V 8.8399023 a 8.1784423,8.1784423 135 0 1 8.178442,-8.17844232 z" />
  </g>
</svg>

Yes I think I got it! Its work if I group my path and


use Transform!

1 Like

So theoretically if you put that path bit inside its own <g> tag you could do something like this:

...(rest of svg)
<g transform = translate(100,0)>
<path
       id="item"
       style="fill:#006c00;fill-rule:evenodd;stroke:#7e1800;stroke-width:1.32292;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill"
       d="M 20.811214,0.66145998 H 33.736075 A 7.3021806,7.3021806 45 0 1 41.038256,7.9636406 V 33.01012 H 12.632772 V 8.8399023 a 8.1784423,8.1784423 135 0 1 8.178442,-8.17844232 z" />
 </g>
...(rest of svg)

and see how that shows up in Ignition. Maybe it would give you an extra property to bind to

1 Like

I would create a style property (assuming one doesn't exist) for that specific element and then use the new stylesheet.

1 Like

I did something like that into Inkscape and its look like its work into ignition! Thank you :slight_smile:

So the solution is to make a Group with the path and use transform(X,Y) and to use effect on the movement of your object you can add a style to your Group and in the style you add transitionDuration with the value you want in Second.

2 Likes