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

    [Plugin] Entity Info + 0.2.0

    Scheduled Pinned Locked Moved Plugins
    12 Posts 6 Posters 3.8k Views 6 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.
    • JQLJ Offline
      JQL
      last edited by

      I'd use it very often if I could batch assign these settings:

      • Glue/Unglue - Vertical, Horizontal, Slopped;
      • Cut openning;
      • Face Camera;
      • Shadows Face Sun.
      • Lock/unlock;
      • Assign all components/groups to a family name; For instance if Family=Window; Every Unique component in the selection would be renamed to "Window#1", "Window#2" etc... No component should be changed to "Window" without havign a sequential numbering.
      • Select all components from a family;
      • Select all component instances;
      • Replace all component instances;
      • Save As;
      • Batch Save As (using folder and component name)
      • Reload;
      • Batch reload...
      • Set axis without having to edit the component;
      • Draw guide points at bounding box;

      Is it asking too much? πŸ˜„

      www.casca.pt
      Visit us on facebook!

      1 Reply Last reply Reply Quote 0
      • G Offline
        greatoe
        last edited by

        but where to download this?

        1 Reply Last reply Reply Quote 0
        • P Offline
          Pherim
          last edited by

          @greatoe said:

          but where to download this?

          Plugin Store.

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            Thanks Tommy - it does not work on Windows. The dialog opens, but the fields are always empty regardless of the selection. I will have a look to see what i can find.

            Hi

            1 Reply Last reply Reply Quote 0
            • TommyKT Offline
              TommyK
              last edited by

              @jim said:

              Thanks Tommy - it does not work on Windows. The dialog opens, but the fields are always empty regardless of the selection. I will have a look to see what i can find.

              Thanks Jim, I will load up windows on my very old machine to see what I can do!

              @jql said:

              I'd use it very often if I could batch assign these settings:

              • Glue/Unglue - Vertical, Horizontal, Slopped;
              • Cut openning;
              • Face Camera;
              • Shadows Face Sun.
              • Lock/unlock;
              • Assign all components/groups to a family name; For instance if Family=Window; Every Unique component in the selection would be renamed to "Window#1", "Window#2" etc... No component should be changed to "Window" without havign a sequential numbering.
              • Select all components from a family;
              • Select all component instances;
              • Replace all component instances;
              • Save As;
              • Batch Save As (using folder and component name)
              • Reload;
              • Batch reload...
              • Set axis without having to edit the component;
              • Draw guide points at bounding box;

              Is it asking too much? πŸ˜„

              Wow, that is a long list! I am considering a customisable system, where the user can add/remove the attributes that are important to them, so I don't think it is too much. I think the following properties on your list is manageable, and would be in the scope of what I am trying to achieve in this plugin:

              @jql said:

              • Glue/Unglue - Vertical, Horizontal, Slopped;
              • Cut openning;
              • Face Camera;
              • Shadows Face Sun.
              • Lock/unlock;
              • Save As;
              • Reload;

              The following, though I think would be better served by another plugin.

              @jql said:

              • Assign all components/groups to a family name; For instance if Family=Window; Every Unique component in the selection would be renamed to "Window#1", "Window#2" etc... No component should be changed to "Window" without havign a sequential numbering.
              • Select all components from a family;
              • Select all component instances;
              • Replace all component instances;
              • Batch Save As (using folder and component name)
              • Batch reload...
              • Set axis without having to edit the component;
              • Draw guide points at bounding box;
              1 Reply Last reply Reply Quote 0
              • TommyKT Offline
                TommyK
                last edited by

                @jim said:

                Thanks Tommy - it does not work on Windows. The dialog opens, but the fields are always empty regardless of the selection. I will have a look to see what i can find.

                Thanks for the update. I have now fixed it. There was a rogue console.log() call in the webDialog window markup that was breaking javascript. It took me ages to figure out what was going on - as soon as I loaded the firebug javascript debugger - it started working!)

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by

                  @tommyk said:

                  Thanks for the update. I have now fixed it. There was a rogue console.log() call in the webDialog window markup that was breaking javascript. It took me ages to figure out what was going on - as soon as I loaded the firebug javascript debugger - it started working!)

                  Yep, it's working now. Thanks.

                  I did change the path where the extensions looks for the html dialog, though. The change allows me to install the plugin in folders other than the default Plugins folder:

                  
                  # html_path = Sketchup.find_support_file "SelectionWindow.html" ,"Plugins/SelectionAttributes/"
                  html_path = File.join(File.dirname(__FILE__), "SelectionWindow.html")
                  
                  

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • TommyKT Offline
                    TommyK
                    last edited by

                    Plugin has been updated. This is still an alpha release, but there are big improvements.

                    Release Notes
                    v 0.2.0

                    • Renamed plugin to "Entity Info +" which is describes its intention better
                    • New user customisable list of entity properties
                    • New properties available
                    • Classifications can be edited, although this is early days at the moment, with lots of bugs
                    • New system for adding properties allows developer contributions

                    Developer Contributions Welcome
                    There is a dizzying array of potential properties that can be edited in SketchUp, which will take a lot of coding to complete. I have developed a way to organise each property in this plugin, so developers (myself included) will be able to write just 4 methods (propertyName, get, set, validate) for each property that they wish to add to the mix.

                    If you are interested, have a look at the propertyType.rb file in the plugin, and see if you can't write the code needed to get your favourite property into the plugin. I will be happy to review and integrate contributions.

                    ###############
                      ### EXAMPLE ###
                      ###############
                      # Each new property type needs to define 4 methods as in the example below.
                      # Note that all methods are class methods, so it can be called without creating
                      # an instance of the class.
                      
                      # The first method simply defines the name of the property type, and the name of
                      # the 'get', 'set' and 'validate' methods it uses.
                      def self.example
                          # getNameFunc is an optional variable, which builds the name from parameters
                          #passed to the method.  This is required for property types such as atributes,
                          # which need to include the attribute dictionaries and attribute label in the name
                          values = {'name' => 'example', \
                          'label' => 'Example', \
                          'getNameFunc' => 'exampleName', \
                          'getValueFunc' => 'getExample', \
                          'setValueFunc' => 'setExample', \
                          'validateFunc' => 'validateExample'}
                        return values
                      end
                    
                      def self.exampleName(options)
                        name = 'example;' + options.to_s
                        return name
                      end
                    
                      # The get method takes a Sketchup;;Selection object, and any parameters required.
                      # Parameters are required when getting deeper structured information about attributes
                      # or Classifications, for example.
                      #
                      # Params;
                      # +selection+;; Sketchup;;Selection object from which to get the values from.
                      # +params+;;  Additional parameters required to get the value (optional).
                      def self.getExample(selection, params)
                        result = {}
                        result['label'] = 'example' # the label shown to the user (optional - defaults to existing label)
                        result['hidden'] = false  # if true, the input box on the editor window will be hidden (optional - defaults to false)
                        result['message'] = "This is a message, not that you need it" # this shows the help text that can be displayed on the editor window (optional)
                        result['warning'] = "Watch out" # a warning to be displayed prominently to the user next to the label text (optional)
                        result['value'] = selection[0].definition.description # the output value. Can be a string, or an array of result objects with the same values as above (required)
                        result['form-type'] = 'text' # the form type, can be 'text', 'textarea', 'checkbox', 'select'
                        return result
                      end
                    
                      # The set method sets the property of the selection.
                      #
                      # Params;
                      # +selection+;; Sketchup;;Selection object to which we can apply the properties.
                      # +params+;;  The values to set the property with.
                      def self.setExample(selection, params)
                        if selection.length > 0
                          # Make your edits here
                          stuff = params['value'] # values normally reside in this hash
                          params['success'] = true # mark your values as successfully set
                          return params # return the params
                        else
                          params['success'] = false # report that something went wrong
                          params['warning'] = "something went wrong" # optional message to be displayed to the user
                          return params # return the params
                        end
                      end
                    
                      # The validate method validates the input parameters, and amends them if necessary.
                      #
                      # Params;
                      # +selection+;; Sketchup;;Selection object to which the properties are to be applied.
                      # +params+;;  A hash object containing values.
                      def self.validateExample(selection, params)
                        if params['value'] == "oh no" # check for problems with values
                          params['error'] = true # report an error - this will stop the setting of the property
                          params['warning'] = "Value given is not a string" # optional message to be displayed to the user
                        end
                        
                        return params # return the parameters for the next step; set the property.
                      end
                    
                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      kiwi15
                      last edited by

                      Hi TommyK,

                      This new way is indeed a much better way to tweak component properties. Apparently you are not the only one who have found the native Component Browser cumbersome: https://extensions.sketchup.com/en/content/component-properties

                      Thanks for a cool and promising plugin:)

                      1 Reply Last reply Reply Quote 0
                      • JQLJ Offline
                        JQL
                        last edited by

                        I use that Thomthom's plugin everyday as it's way easier than using component browser for just those glue properties and the likes. However it doesn't work with multiple components...

                        www.casca.pt
                        Visit us on facebook!

                        1 Reply Last reply Reply Quote 0
                        • TommyKT Offline
                          TommyK
                          last edited by

                          @kiwi15 said:

                          Hi TommyK,

                          This new way is indeed a much better way to tweak component properties. Apparently you are not the only one who have found the native Component Browser cumbersome: https://extensions.sketchup.com/en/content/component-properties

                          Thanks for a cool and promising plugin:)

                          Thanks, kiwi. Yes ThomThom's plugin is indeed worth mentioning in this thread.

                          I must admit I have other distractions at the moment, so development on this is slow. Glue properties are high on my list for this plugin.

                          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