sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Attribute order in DC's alphabetical? Multi-Language?

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    9 Posts 3 Posters 1.6k 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.
    • H Offline
      HPW
      last edited by

      Just got my book 'SU 7 for Dummies' and I read there that attribute always appear in alphabetical order.
      I think this is a big mistake in the design.
      There maybe attributs which need to be filled in a logical order.
      I need a value first to porcess a possible second value etc.
      The hint in the book about prefixing the attribute looks in the result unprofessional.

      The attribute field-name should not affect the form of visuall interface.
      Like in a DB it should be a logical field-name and how the label of the data-entry form is, should be configurable.

      So a attribut should get a field with a settabel attribute 'displayed field name'.
      And the component definition should get a stored order of attributes for each DC.

      Now I would have to make each DC every time new for each GUI-language!

      Or do I miss something?

      Hans-Peter

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        Yup, it only does alphabetical and alphanumeric. So you could use numbers instead of letters if that helps.

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • H Offline
          HPW
          last edited by

          @unknownuser said:

          ....if that helps.

          Not really.

          01_FrontColor
          02_BackColor

          Does not look nice. And in the DC-rules you have to use this workaround in the formulas.

          And for a different language you start all again:

          01_FrontFarbe
          02_RückwandFarbe

          By the way: Can a ruby detect in which language SU is running?

          Regards,

          Hans-Peter

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            Yes, ruby can detect the language. Mots ruby scripts do not implement any language translation. But some do. The native SU ones do and so do Fredo's free form tools.

            I don't know if that can be worked into DC's though 😞

            Chris

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • H Offline
              HPW
              last edited by

              I am a bit puzzled.
              I read about the alphabetical sorting of the attributes in the book text.
              But there are hardcopys of 'components options' dialogs in the book, which shows a circular stair and there are options not in the alpabetical order.
              I then downloded the SKP and it show also the label which are not in alpabetical order.
              Since I have not SU 7 Pro yet, I can not look into the DC config.
              So is there a difference between attribut name and shown label?

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

                @hpw said:

                So is there a difference between attribut name and shown label?

                Yes. You specify an attribute name and a "User Friendly" name which is shown in the label.

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

                1 Reply Last reply Reply Quote 0
                • H Offline
                  HPW
                  last edited by

                  Thanks for the info.
                  So the "User Friendly" label makes it easier.
                  Maybe could be used to change the GUI language also.

                  Is the "User Friendly" label settable from ruby?

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

                    Sketchup.active_model.selection[0].definition.attribute_dictionary('dynamic_attributes').each_pair { |k,v| puts k + '; ' + v.to_s }
                    

                    This will list the DC attribute keys and values of the DC definition. (There might be attributes attached to the instances as well.)

                    When you select an instance of Sang, you get this output:

                    @unknownuser said:

                    %(#660000)[_description_label: Description _formatversion: 1.0 _has_movetool_behaviors: 0.0 _hasbehaviors: 1.0 _lastmodified: 2008-10-07 14:36 _material_access: LIST]%(#FF8000)[**_material_formlabel: Shirt Color**] %(#660000)[_material_formula: _material_label: Material _material_options: &Simple%20Yellow=%3D%22Wheat%22&Blue=%3D%22Blue%22&Red=%3D%22Red%22&Yellow=%3D%22Yellow%22&Green=%3D%22Green%22&White=%3D%22white%22& _material_units: STRING _name: Sang _name_label: Name _onclick_formlabel: Click to change my shirt color. _onclick_label: onClick _onclick_state1: 4 description: Sang is a member of the SketchUp development team. He enjoys rock climbing, pho and long walks on the beach.<br><br>You can change Sang's shirt by clicking on him with the Interact tool. material: White name: Sang onclick: set("material", "Blue", "Red", "Yellow", "Green","White")]

                    Notice the highlighted line which is contains the Option's label for the shirt colour.

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

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      And here's a picture of a DC config box and the menu open side by side. In the configuration window, you'll see the attributes color_options, name_option, size_options. Those get alphabetized automatically. And the order that they appear in the configuration window is the order they will appear in the menu window. So to get them to change order, I would need to add a 01 02 03 in front of the in the desired order. That does not affect the user friendly name that appear in the menu.

                      comp_names.jpg

                      Chris

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      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