Can I also add a couple of items to a wish list:-
- · Support for metric calculations through %-cm% as an example, as you have for height, depth etc.
- · Support if then in calculations
- · Support for thousands separator for numeric formats
- · ability to specify currency symbol used
Tags:
Note: Advanced calculation features can be done using the fact that all of our calculations are executed as ruby strings.
Metric
What else did you want metric calculations for?
One way to do this is to add: .to_cm after a number in the calculations: %Len%.to_cm should work.
Here is an example in the SketchUp ruby console:
(In the ruby console, every other line is the result of the previous line)
a1 = 1.23
1.23
a1.to_cm
3.1242
If then
This can be performed using ? and : as ruby operators:
Here is another example from the ruby console:
a1 = 0.1
0.1
(a1 > 2 ? a1 * 100 : a1 * 200)
20.0
a1 = 3
3
(a1 > 2 ? a1 * 100 : a1 * 200)
300
International Formatting:
I believe we use the windows localization settings for thousands separators and currency. I wil check it out.
I think there is another post where someone requested the ability to override the currency setting. Let me see what I can do with that.
Hi Al,
Will the %Len%.to_cm work if if you then perform a further calculation? Would it also work if you wanted the X cordnidate of an object
If then would be nice, for example being able to set a price depending on the value of another attribute.
A ruby script may be the answer, but the whole point of Space Design is to present an easy to use "Report Generator" for Sketchup. I for one would have no idea where to start with the Ruby console.
The current windows localisations is working for the currency, but not the thousands seperator (at least not in the total.
A couple of additional items for the wish list
On the Define Space Design Attributes window:-
Ability to move columns around (and save setting)
Navigation buttons on Attribute settings window (auto saving changes as you move to next / previous attribute)
Allow the window to be minimised. Once its opened it locks out access to the SketchUp window
Have the Create Report button load the default report setting, it does not load defaults from the Project folder, unless the “Report” is opened.
A structured user manual, the on-line version is fine, but can get you going round in circles, especially for a new user.
Will the %Len%.to_cm work if if you then perform a further calculation? Would it also work if you wanted the X cordnidate of an object
.to_cm is a SketchUp ruby function which converts dimensions to cm. (multiplies by 2.54) One you use it, on a number it is remembered for the rest of the calculation.
e.g. %Len%.to_cm * 1.234
If then would be nice, for example being able to set a price depending on the value of another attribute.
A ruby script may be the answer, but the whole point of Space Design is to present an easy to use "Report Generator" for Sketchup. I for one would have no idea where to start with the Ruby console.
Calculations are in ruby, so for complex calculations you may have to use some ruby functions. And it is worth testing them on the ruby console.
If you wanted to set the price to be 1.00 it the weight was < 1.23, 2.00 if the weight was between 1.23 and 4.99 and 3.00 if the weight was >= 5.00, you could use:
(%weight% < 1.23 ? 1.00 : (%weight% <= 4.99 ? 2.00 : 3.00))
I tested this on the ruby console by entering:
(remember every line is ruby's response)
(It would be nice if I did not use %weight%, which has to be replace by w when testing.
w = 1.5
1.5
(w < 1.23 ? 1.00 : (w <= 4.99 ? 2.00 : 3.00))
2.0
Also I am making the box where you input the calculations larger and easier to read:
Enter a phrase here to search the entire Render Plus web site:
© 2024 Created by Render Plus. Powered by