Custom Shape: enter value of SVG Path dynamically in ElementFactory

Hello, I hope somebody can help me resolve the following issue:

I wrote a function that allows to draw paths drawPath in a customRenderer:

 function drawPath(parentGfx, d, offset, attrs)...

Afterwards I use a handler to enter the value of

d = "M 1 1 L 37 1 L 160 1 L 226 89 L 161 172 L 1 171 Z"

in order to generate a custom shape. This results in a process shape.

At the moment I am entering the value of “d” in the CustomRenderer. Is there a possibility, to enter the value of a path dynamically in the ElementFactory (like with: element.widht, element.height for a square shape). For example Square-Elements use the function getDefaultSize with element.width/height.

EDIT: When I use

var rect = drawPath(parentGfx, element.d, 0, attrs);

in the CustomRenderer and

 return { d : "M 1 1 L 37 1 L 160 1 L 226 89 L 161 172 L 1 171 Z" };

in the ElementFactory it always renders the shape but sets the element size not to the size of the path. Error message is: x / y required.

Has anyone used SVG-Paths and has entered the value dynamically from the ElementFactory?

Thank you very much.