Quote:
Originally Posted by Andy Poulsen
I'm curious why you removed the sd-sys-to-user-units functions, [...]
|
Dear Andy
It's a usability issue. I want to enter the values in the script using t/m^3 because this is how you have the values in mind. It creates the least leading or trailing Zeros (i.e. steel 7.8, water 1...) But this format is neither the user setting (most construction companies use kg and mm) nor the system unit setting.
Quote:
Originally Posted by Andy Poulsen
On the other hand, if you want to display the values using a fixed set of units independent of the units the user is using (such as always displaying kg/m^3 regardless of user units), you can just do the conversion using a fixed factor as well rather than the sd-sys-to-user-units function.
|
I heard of LISP and Direct Modeling two weeks ago so I had some troubles making a simple division :-) But now I got it to work:
Code:
(sd-create-logical-table "Material-Density-List"
:columns '(:Material :Density)
:columnNames (sd-multi-lang-string
'("Material Type" "Density in kg/L")
:german
'("Werkstoff" "Dichte in kg/L")
)
:types '(:string :number)
:contents (list
(list (sd-multi-lang-string "Aluminum" :german "Aluminium") 2.75)
(list (sd-multi-lang-string "Steel" :german "Stahl") 8.5)
)
)
Then browse for lines containing "set_part_[...]_density" and add the division in the format (/ numerator denominator), i.e.
Code:
(sd-call-cmds (set_part_base_density :parts a_TEIL :dens (/ DICHTE 1000))