sketchucation logo sketchucation
    • 登入
    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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    [Plugin] AttributeInspector 1.1.1 – 2014-05-08

    已排程 已置頂 已鎖定 已移動 Plugins
    45 貼文 10 Posters 3.8k 瀏覽 10 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Dan RathbunD 離線
      Dan Rathbun
      最後由 編輯

      Also.. I would like to say that I wrote at least one plugin which I purposely added a AttributeDictionary to a collection object, because I did not want the user messing with it, or having it included in an attribute report.

      I'm not here much anymore.

      1 條回覆 最後回覆 回覆 引用 0
      • Dan RathbunD 離線
        Dan Rathbun
        最後由 編輯

        Another think that throws me off a bit, is that I am used to the +/- buttons being on the top toolbar, in the Scenes and Layers managers.

        BUT.. I like it, mainly because I myself thought about doing this, but never had the time to do much more that the simple lister pluglet for the GeoLocation dictionary.

        I'm not here much anymore.

        1 條回覆 最後回覆 回覆 引用 0
        • jiminy-billy-bobJ 離線
          jiminy-billy-bob
          最後由 編輯

          @dan rathbun said:

          Sketchup::Model#typename() is added into the API by "dcutils.rbs"... so turn the DynamicComponents extension back on, and you will no longer have the errors.

          Thanks!

          25% off Skatter for SketchUcation Premium Members

          1 條回覆 最後回覆 回覆 引用 0
          • A 離線
            Aerilius
            最後由 編輯

            The bug has been fixed some time ago in the (not yet released) next version. I'll publish it soon.

            1 條回覆 最後回覆 回覆 引用 0
            • Dan RathbunD 離線
              Dan Rathbun
              最後由 編輯

              v1.0.1

              When I choose "materials", nothing happens. (I should see a blank list when no dictionaries are attached to any material in the model.)

              Should materials not having dictionary attached be displayed but grayed out ?

              I'm not here much anymore.

              1 條回覆 最後回覆 回覆 引用 0
              • Dan RathbunD 離線
                Dan Rathbun
                最後由 編輯

                Clicking (giving focus to) the edit boxes in the righthand pane, cause the row height to increase (by differing amounts, depending on whether the attribute name or value box gets focus.)

                I'm not here much anymore.

                1 條回覆 最後回覆 回覆 引用 0
                • genma saotomeG 離線
                  genma saotome
                  最後由 編輯

                  Hi Dan, would it be possible to expand upon this idea and code up something that will find all elements that match an attribute value? AFAIK there isn't a way to find faces that have no materials applied... and I have a plug-in I use all of the time that makes use of the dictionary to hold an assigned value (always about faces) but if I decide to change that value I have no way to tracking down all instances except by recollection and/or trial and error. So being able to do this attribute --> this value --> show me all that match would be very handy for me. By "show" it would be adequate to show the attribute information but I think it would be better to select them instead.

                  I think anyone else who uses the dictionary feature might also benefit because those data are not part of SU's own selection function and your plug-in, as it is now, does reveal that data. I think taking the next step and figuring out how to do a select based on Dictionary attributes and their values would be a big plus.

                  Thank you for any consideration you give this.

                  1 條回覆 最後回覆 回覆 引用 0
                  • Dan RathbunD 離線
                    Dan Rathbun
                    最後由 編輯

                    @genma saotome said:

                    Hi Dan, would it be possible to expand upon this idea and code up something that will find all elements that match an attribute value?

                    ThomThom's SelectionToys plugin can modify your selection set by many filters.
                    There are at least 4 filters regarding add or remove objects according to front/back material set as default ( nil.)

                    So first you window select a bunch of objects. Then use the SelectionToys face filter, so only faces remain in the set.

                    Then use the default material filter for front faces, and/or back faces.

                    Install manually via
                    http://extensions.sketchup.com/en/content/selection-toys
                    or using the ExtensionWarehouse dialog from within SketchUp 2013 and higher. Navigate to ThomThom's page, and scroll down to SelectionToys

                    💭

                    I'm not here much anymore.

                    1 條回覆 最後回覆 回覆 引用 0
                    • A 離線
                      Aerilius
                      最後由 編輯

                      A lot of the ideas are things that I had found and added myself, others did I integrate now. Sorry that I still haven't finished/published the update because I want to be sure the quality is right.
                      (Some extension stores have longer update cycles, so when I discover an overseen issue, I can't publish a quickfix.)

                      As for searching within the selected entities by attribute, I had thought of that idea, but decided not to get distracted but focus first on the main function of reading/editing attributes. One could certainly add a lot of ideas, but to make a "good" user interface one needs to carefully think about user workflows and how a feature affects the plugin's complexity (of UI and code). I'm not yet sure if search is something that I should better leave for thomthom's Selection Toys.

                      Checking an entity for a "direct" property is on thing, but speed would also be much more affected for attributes, when you consider every entity can have multiple dictionaries, with each mutiple attributes/values. And Christina found that attribute dictionaries can have their own nested attribute dictionaries…

                      1 條回覆 最後回覆 回覆 引用 0
                      • jiminy-billy-bobJ 離線
                        jiminy-billy-bob
                        最後由 編輯

                        Have you considered browsing through the read/write_default stuff?

                        25% off Skatter for SketchUcation Premium Members

                        1 條回覆 最後回覆 回覆 引用 0
                        • A 離線
                          Aerilius
                          最後由 編輯

                          A "registry inspector" is - I believe - not possible with thr API. We can only read if we know the registry key to read.

                          1 條回覆 最後回覆 回覆 引用 0
                          • jiminy-billy-bobJ 離線
                            jiminy-billy-bob
                            最後由 編輯

                            Ok!

                            25% off Skatter for SketchUcation Premium Members

                            1 條回覆 最後回覆 回覆 引用 0
                            • Dan RathbunD 離線
                              Dan Rathbun
                              最後由 編輯

                              .. and currently it is very dangerous as (on PC,) the keys written are mixed in among the application's keys.

                              We can only ASK coders to prefix their keys similar to how they should prefix their plugin directories.
                              ex: "Plugin_AE_AttributeInspector"

                              I'm not here much anymore.

                              1 條回覆 最後回覆 回覆 引用 0
                              • A 離線
                                Aerilius
                                最後由 編輯

                                I updated the plugin:
                                • definitions (component/group/image definitions)
                                • more data types: points and vectors
                                • optimized column widths

                                1 條回覆 最後回覆 回覆 引用 0
                                • inteloideI 離線
                                  inteloide
                                  最後由 編輯

                                  Hello Arilius !

                                  Your plugin is very useful for me thanks !

                                  Just missing an "update" button, in order to avoid closing an openning the window to refresh and it will be perfect !
                                  Thank you !
                                  Inteloide

                                  Humanity will do a huge step when the IT professionals will understand that computers are tools...

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • jiminy-billy-bobJ 離線
                                    jiminy-billy-bob
                                    最後由 編輯

                                    @inteloide said:

                                    Just missing an "update" button, in order to avoid closing an openning the window to refresh and it will be perfect !

                                    +1 👍

                                    25% off Skatter for SketchUcation Premium Members

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • jiminy-billy-bobJ 離線
                                      jiminy-billy-bob
                                      最後由 編輯

                                      I found a conflict with TIG's 2DTools.

                                      This plugin adds an attribute dictionnary to the model called "2Dtools", with a key "z" and a value of "0.0" in my case.
                                      This causes the AttributeInspector to not load anything for the model, and the ruby console outputs this:

                                      AE;;AttributeInspector;;Dialog Error for callback 'get_all'; 
                                      comparison of Length with true failed
                                      C;/Users/Marjorie/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/ae_AttributeInspector/AttributeInspector.rb;505;in `=='
                                      C;/Users/Marjorie/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Plugins/ae_AttributeInspector/AttributeInspector.rb;505;in `block (2 levels) in get_attributes'
                                      Blablabla...
                                      

                                      (I was able to find the conflicting dictionnary using Eneroth's Attribute Editor)

                                      25% off Skatter for SketchUcation Premium Members

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • Dan RathbunD 離線
                                        Dan Rathbun
                                        最後由 編輯

                                        That is the Trimble SketchUpAPI team's fault. They did not properly override the == method in the Length subclass.

                                        It (the overridden method,) should have an unless clause that invokes super if the argument is not a Numeric subclass.

                                        like:

                                        
                                          def ==(arg)
                                            unless arg.is_a?(Numeric)
                                              super
                                            else
                                              # check if arg is within SketchUp's
                                              # tolerance of this Length instance
                                            end
                                          end
                                        

                                        I'm not here much anymore.

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • TIGT 離線
                                          TIG Moderator
                                          最後由 編輯

                                          So any plugin which saves an attribute as a Length will return an error if the test on it is not sufficiently robust ?
                                          So make a test like:
                                          unless object.get_attribute(key, value, nil).class == NilClass ... else next ### end
                                          So now if the key's value is NOT nil you do something...
                                          BUT if it is nil you skip it ###...

                                          But as I read this plugin's code its line #505 uses:
                                          type = (value == true || value == false) ? "Boolean" : value.class.to_s
                                          That is where the failure happens.
                                          The Length is checked for true/false.
                                          If it's recast as something more like:
                                          type = value.class.to_s; type = "Boolean" if type =~ /TrueClass|FalseClass/
                                          Then it'll work with Lengths too...
                                          You could also add a trap for NilClass and perhaps skip that key/value pair ?
                                          ; type = "Nil" if type =~ /NilClass/
                                          OR take it as equivalent to FalseClass ??

                                          TIG

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • A 離線
                                            Aerilius
                                            最後由 編輯

                                            Thanks for pointing this out!

                                            I didn't think about that I could get an error when comparing things. I assumed something that doesn't compare would return "false". The ruby way would maybe be to do feature testing:
                                            type = (value.is_a?(Comparable) && (value == true || value == false) ? "Boolean" : value.class.to_s
                                            Which also fails due to SketchUp's bugged API method (Length is a Comparable).
                                            This should be better (and without string comparison). Or shouln't ruby have a "Boolean" super class of which TrueClass and FalseClass are subclasses?
                                            type = (value.is_a?(TrueClass) || value.is_a?(FalseClass)) ? "Boolean" : value.class.to_s

                                            @unknownuser said:

                                            You could also add a trap for NilClass and perhaps skip that key/value pair ?

                                            I wanted to list all existing attributes. An attribute can persist with a value "nil" without being deleted/garbage collected.

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement