Attribute order in DC's alphabetical? Multi-Language?
-
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
-
Yup, it only does alphabetical and alphanumeric. So you could use numbers instead of letters if that helps.
-
@unknownuser said:
....if that helps.
Not really.
01_FrontColor
02_BackColorDoes 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ückwandFarbeBy the way: Can a ruby detect in which language SU is running?
Regards,
Hans-Peter
-
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
-
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? -
@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.
-
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?
-
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.
-
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.
Chris
Advertisement