Hi,
I'm using this function in this code :
def get_first_point(self, d):
path = Path(d)
for command in path:
if isinstance(command, Move):
first_point = command.args[0]
return first_point
then this return a float, i expected a tuple of float.(https://inkscape.gitlab.io/extensions/documentation/source/inkex.paths.html#inkex.paths.Path.PathCommandProxy.args)
Is it a bug ?
For example on this path "M 89.2551 77.2901 C 89.2551 77.2901 120.079 77.2901 120.079 77.2901" it return 89.2551 I expected (89.2551, 77.2901)
I think it might be a documentation error or something in 1.4 ? I'm not sure.
However you can get this in from:
selection_list = self.svg.selectedif len(selection_list) < 1:returnfor path_element in selection_list.filter(inkex.PathElement):path = path_element.pathfor entry in path:letter = entry.letterentry_args = entry.argsinkex.errormsg(f'letter: {letter} args: {entry_args}')
Further clarifed, the path proxy is accessed via:
path = path_element.path
path_proxy = path.proxy_iterator()for item in path_proxy:inkex.errormsg(item.args)
Thank's. I have split the path and put data in a tuple.
Hi,
I'm using this function in this code :
def get_first_point(self, d):
path = Path(d)
for command in path:
if isinstance(command, Move):
first_point = command.args[0]
return first_point
then this return a float, i expected a tuple of float.(https://inkscape.gitlab.io/extensions/documentation/source/inkex.paths.html#inkex.paths.Path.PathCommandProxy.args)
Is it a bug ?
For example on this path "M 89.2551 77.2901 C 89.2551 77.2901 120.079 77.2901 120.079 77.2901" it return 89.2551 I expected (89.2551, 77.2901)
I think it might be a documentation error or something in 1.4 ? I'm not sure.
However you can get this in from:
selection_list = self.svg.selected
if len(selection_list) < 1:
return
for path_element in selection_list.filter(inkex.PathElement):
path = path_element.path
for entry in path:
letter = entry.letter
entry_args = entry.args
inkex.errormsg(f'letter: {letter} args: {entry_args}')
Further clarifed, the path proxy is accessed via:
path = path_element.path
path_proxy = path.proxy_iterator()
for item in path_proxy:
inkex.errormsg(item.args)
Thank's. I have split the path and put data in a tuple.