sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    View.draw_lines point1, point2

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 235 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • honoluludesktopH Offline
      honoluludesktop
      last edited by

      Whats the problem with the following? I am unable to draw a line. I tried this:
      ` model=Sketchup.active_model
      selection=model.selection

      view=model.active_view
      point1=Geom::Point3d.new(@light_fixture.transformation.origin)
      point2=Geom::Point3d.new(point_here)
      status=view.drawing_color="red"
      status=view.draw_lines point1,point2,and this: status=view.draw_lines (@light_fixture.transformation.origin,point_here)`

      This works, but I do not want a permanent line.
      ` model=Sketchup.active_model
      entities=model.entities

      entities.add_line(@light_fixture.transformation.origin,point_here)`

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        The view.draw... commands for temporary graphics like rubberbanding only work inside a Tool class.
        If you want to 'draw' temporary 'lines' try something like cl=model.active_entities.add_cline(point,point2) to add a guide [construction] line.
        I sometimes use clines within Tools too as you can't 'snap' back to a temporary ' draw' line, but you can to edges or clines...
        Because you've remembered it as ' cl' you can remove it later [ cl.erase! if cl.valid?] when you've completed whatever it is you are doing [or you onCancel() or deactivate() - but again they are part of the Tool class methods!]...

        TIG

        1 Reply Last reply Reply Quote 0
        • honoluludesktopH Offline
          honoluludesktop
          last edited by

          Tig, thanks.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement