Inkscape.org
Creating New Extensions Creating new extension for generating guides.
  1. #1
    rajsenthil rajsenthil @rajsenthil

    Hello, I am trying to create vertical and horizontal guides generated using the extension. The method below is used.

    def create_guide(position, orientation, parent):
        """ Creates a Guide with a defined position, orientation
        and parent in the DOM.
        """
        etree.SubElement(
            parent,
            '{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}guide',
            {
                'position': position,
                'orientation': orientation,
            }
        )
    

    The vertical lines are created from left to right and that is working. Now when I changed the orientation to horizontal as below
     

         # Create row guides
            row_pos = 0.0
            create_guide('0,'+str(row_pos), '0,1', nv)

    The guide is placed to the bottom of the document with these co-ordinates `position: (0,0)` and `orientation: '0,1'`.
    Can someone let me know how to draw horizontal guides by correctly positioning? 

    Regards,

    Senthil

  2. #2
    XRoemer XRoemer @XRoemer

    Hi,

    I've had the same issue and found this line in someone's code:

    y = -y + self.svg.get_page_bbox().height

    Regards,

    Xaver

Inkscape Inkscape.org Inkscape Forum Creating New Extensions Creating new extension for generating guides.