sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    View.draw_lines point1, point2

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 286 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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better πŸ’—

          Register Login
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement