sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Non-model geometry

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 218 Views 4 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.
    • M Offline
      maxim1000
      last edited by

      Hello

      During implementation of plugin I faced with requirement to show some geometry to user which should not appear in saved files and preferably be absent in "undo" stack.

      It's a helper entity - basically bounding box which shows to user bounds of area for model fitting.

      Does anyone know ways to do such things in Sketchup?

      P.S.
      We already considered approach of creating a tool, but it's important to allow user to edit model with other tools while the plugin is active.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Think you're out of luck. There is no event that trigger before you save. And the arguments of model.start_operation which is meant to let operations be transparent - is bugged. πŸ˜•

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

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

          As your PS - with a 'tool' you can 'draw' openGL geometry temporarily but this only displays while the tool is active.
          To make a 'bounds-box' why not make a lightly transparent grouped box with hidden edges etc that sits in the required location [locked?] and stays there while you do other things/tools.
          The 'bounds-box' could be a 'unique' thing in that when you activate a new one it'd make sure that any earlier one was erased - simple attribute given to the grouped box lets it be recognized as one ready for erasure...
          You then have a tool/toolbar-icon[s] to show 'bounds', hide/clear 'bounds' etc for some particular location [not sure how you want to specify this?]...
          You could also have an observer that removed any left over 'bounds' when the model closed, or removed any found when the model starts, so there is never a 'bounds' you don't expect, and never more that one of them at a time ?
          Making the box will be undo-able BUT you could store the bounds' info in a model attribute and set a flag that says one should be displayed... then when it is erased in an undo error an observer watching for groups say spots that the desired one is gone and automatically recreates it UNLESS you run a 'bounds' clear tool to remove it and reset the flag etc ???

          TIG

          1 Reply Last reply Reply Quote 0
          • C Offline
            cjthompson
            last edited by

            I noticed that the API documentation for view.draw_(lines,points,etc...) mentions that it is usually implemented inside the draw method.

            Is there any other way you can implement them?

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              No. πŸ˜•

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • M Offline
                maxim1000
                last edited by

                Thanks for answers.

                We ended up with approach similar to one of described by TIG: we have a separate layer with known and recognizable name and store all our geometry there. Any operation gets required data (actually it's only box size) from that layer and thus the problem with losing references to our stuff is solved.

                Of course problem with appearance of our geometry in saved modelΡ‹ is still relevant, but it seems we can and will have to live with that (because after reopening the plugin catches existing geometry)...

                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