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

    Way to lock component definition

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 3 Posters 140 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.
    • C Offline
      cjthompson
      last edited by

      I am trying to find a way to lock a definition of a component, so that the end user can move an instance of it, but not modify the contents.

      Is this possible, assuming the plugin will always be installed?

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

        I guess you can monitor the active entity path and close the instance when the user tries to open 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

          @thomthom said:

          I guess you can monitor the active entity path and close the instance when the user tries to open it..?

          That would need the end user to have loaded your script - so disabling it makes it editable anyway ?

          TIG

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

            @cjthompson said:

            assuming the plugin will always be installed?

            @thomthom said:

            I guess you can monitor the active entity path and close the instance when the user tries to open it..?

            I thought of that, but there are still plugins that can modify a definition without having to go into edit mode.

            Another idea I had was to save the component to a temp file, and then reload it, but that might be really slow. Which leads me to another question: Is there any way to load a component from a file twice? Whenever I've tried it, it doesn't create a new definition, it just ignores the command.

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

              @cjthompson said:

              I thought of that, but there are still plugins that can modify a definition without having to go into edit mode.

              Have you tried locking all the entities inside the definition?

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

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

                @thomthom said:

                @cjthompson said:

                I thought of that, but there are still plugins that can modify a definition without having to go into edit mode.

                Have you tried locking all the entities inside the definition?

                How do you do that?

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

                  hmm.... I thought you could lock any entity... but looking at the API - it'd appear only groups and instances can be locked...

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

                  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