Inkscape.org
Forum Testing Sorry, just testing here!!
  1. #1
    GRS-1955 GRS-1955 @GRS-1955

     

    Code-Block for....   ExportXY-CSV.py

    import inkex
    import sys
    from inkex import paths
    from inkex import transforms

    def warn(*args, **kwargs):
        pass
    import warnings
    warnings.warn = warn

    class TemplateEffect(inkex.Effect):
        def __init__(self):
            inkex.Effect.__init__(self)
        def effect(self):
            for node in self.selected.items():
                output_all = output_nodes = ""
                for id, node in self.selected.items():
                    if node.tag == inkex.addNS('path','svg'):
                        output_all += ""
                        output_nodes += ""
                        node.apply_transform()
                        d = node.get('d')
                        p = paths.CubicSuperPath(d)
                        for subpath in p:
                            for csp in subpath:
                                #  The line below has been modified, to make 'comma' delimited parts!!
                                # output_nodes += str(csp[1][0]) + "\t" + str(csp[1][1]) + "\n"
                                  output_nodes += str(csp[1][0]) + "," + str(csp[1][1]) + ",\n"
                sys.stderr.write(output_nodes)
    TemplateEffect().run()
    sys.exit(0) #helps to keep the selection

    Notice I have modified the Output-Nodes line....
     

  2. #2
    GRS-1955 GRS-1955 @GRS-1955

    Testing a reply to myself....

  3. #3
    GRS-1955 GRS-1955 @GRS-1955
    *

    Hmmm....  That works here, but NOT in a reply to someone who replied to a post of mine???
     

    ALL SORTED NOW !!!!

  4. #4
    Polygon Polygon @Polygon🌶

    What is all the testing for?

  5. #5
    GRS-1955 GRS-1955 @GRS-1955

    Was just testing posting Code-Blocks mainly!!  hahaha....  Sorted

  6. #6
    Polygon Polygon @Polygon🌶

    Can I delete the other threads to free space or is it somehow important?

  7. #7
    GRS-1955 GRS-1955 @GRS-1955
    *

    Yes, you can remove this whole test post/replies now....  Problem was sorted. Thanks friend...

    How do i post in-line images !!!

  8. #8
    Polygon Polygon @Polygon🌶

    Either drag an image into the editor window where you type the reply in or use the paperclip icon below to upload content.

  9. #9
    GRS-1955 GRS-1955 @GRS-1955

    Ahhh...  Thank you!!!....     I love your name 'Polygon', as they are what I love playing with, and coding for. Mainly using a now On-Line
    Physics Simulation site...   https://app.physion.net/, and going back for years, with the authors old PC-Based version. (A different beast!!).
    The Old 'Physion' had polygon points based on CSV data, but the new on-line version equates to 'JSON' data, instead of a CSV string....
    I was never happy with the default created 'Gears' being produced, when you could not specify the Number Of Teeth!!!   Sigh...
     

Inkscape Inkscape.org Inkscape Forum Forum Testing Sorry, just testing here!!