sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Request] Locking: Enhanced-Locking of Geometry

    Scheduled Pinned Locked Moved Plugins
    9 Posts 3 Posters 309 Views 3 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.
    • JClementsJ Offline
      JClements
      last edited by

      I have created a model for a client. Part of the structural elements should/must NOT be altered. Other elements can be altered.

      The client is being given the model so they can alter or move certain structural and mechanical elements. I want to make sure they don't alter the core, structural geometry.

      I have used SU's out-of-the-box locking but that does not prevent someone from unlocking things.

      I was thinking of one of the following methods to use:

      1-Apply a password to geometry when locking. Only the "project administrator" and certain team members would be given the password. Also, what about an option to enhance-lock/enhance-unlock geometry by picking a layer name? Objects added to that layer would not automatically be locked.

      OR

      2- A script that would disable (overide) SU's built-in unlocking function. If the script is loaded in the SU/plugin's directory, the user could not lock or unlock geometry. Or, if loaded, unlocking/locking could be activated via a password.

      #2 seems to have more appeal to me because it eliminates the risk of forgetting a password.

      If an "enhanced-locked" object is clicked/selected could there be a message displayed next to the cursor ?. The message could be changed by manually editing the .Rb file.

      John | Illustrator | Beaverton, Oregon

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

        Unfortunately, none of these options are technically doable with the SketchUp Ruby API.

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

        1 Reply Last reply Reply Quote 0
        • JClementsJ Offline
          JClements
          last edited by

          Thank you for the quick reply, Tom

          John | Illustrator | Beaverton, Oregon

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

            Sorry it could not be of any help.
            You could throw the idea at Google...

            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

              You could do this using an observer that spots objects on a specific layer and prevents them being edited - grouped/locked etc. The password of the [un]locking is saved as a model attribute... but [the BIG BUT] if the .rb/.rbs file that is needed to auto-load and add that observer and thereby 'lock' things can be easily removed from the Plugins [or Tools] folder and then on a restart the locking is inactive and you are as you were before. So this is no use for securing your SKP data if it's to be distributed to others a sthey simply don't laod the script! ... BUT it might have some use 'internally' in-house to ensure that the uninitiated cannot tamper with some aspect of your SKPs... however you still need to have a .rbs auto-loading - perhaps one that also offers some other unique functionality so that disabling it is not acceptable to your own users either... πŸ˜•

              TIG

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

                @tig said:

                You could do this using an observer that spots objects on a specific layer and prevents them being edited - grouped/locked etc. T

                How would you "lock" it?

                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

                  This is all very hypothetical... even 'academic'...
                  An observer would perhaps look for changes to entities and find all on layer XXXX that are not 'grouped' and always ensure that all objects on that layer are part of a special humungous group that is locked [preventing if from being changed]. Thereby if you changed an object's layer to XXXX the it's auto-locked.
                  A second observer looks at the group and prevents it from being unlocked - so group.locked if not group.locked?.
                  A third observer looks at layers and if layer XXXX is renamed it's renamed back as XXXX...
                  A fourth observer looks at the special group and if its layer changed it reverted to...
                  etc etc
                  A convolution of observers could do it BUT as I said somewhat pointless since simply removing the script so it doesn't auto-load stops everything working anyway...

                  TIG

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

                    Observing for changes is one thing, but it's the preventing change that I find to be the main issue.

                    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

                      You can readily do group.locked if not group.locked? once somehthing has changed and been observed, as you would have given 'group' a special attribute etc...
                      My HolePuchTool has various observers, including a selection observer - so it a selection contains an instance with a certain attribute then the selection is adjusted to include all other entities with the matching attribute. So if you highlight a cutting-component that's been punched all of the geometry to its reveals are highlighted to, so when you move one the others move - thus it's like them being grouped - however if you select part of the reveal all of the reveal geometry is selected but the instance isn't - to allow for adjustments etc
                      ...
                      but as I said it's all pretty much academic for locking'.

                      TIG

                      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