The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

GDL language and objects, API, Add-ons, Script…

Moderators: ejrolon, Barry Kelly, Karl Ottenstein, LaszloNagy, gkmethy

What is your opinion about this Wish?

Essential
1
25%
Important
1
25%
Average
No votes
0%
Not Important
2
50%
Not Needed
No votes
0%
User avatar
By Moonlight
#295572
GDL needs Average sum of values/parameters/variables functions.

It's needed for some calculations such as areas or volumes, besides it makes scripting a little bit easier
User avatar
By Barry Kelly
#295585
You already have it.
Add the variables together and divide by the number of variables.

If there was a function to do this you would still have to list all of the variables so there would be very littly difference in the amount of scripting.

i.e. (var_1+var_2+var_3+var_4)/4

compared to a proposed ... AVERAGE(var_1,var_2,var_3,var_4)

I don't see the need for it unless i am not understanding what you need.

Barry.
User avatar
By Lingwisyer
#295587
Unless you are wanting a median or an average function that excludes outliers. In the second case, a single function is unlikely as there are too many definitions of what an outlier can be.



Ling.
User avatar
By Moonlight
#295605
@Barry Kelly

The average function is already have been implemented in many languages from long time ago, it could be even considered as stable mathematical function to provide with the languages libraries, so the question should be why GDL doesn't have one, not how you can create your own average function.

@ Lingwisyer
a median function would also be perfect to add, even the most basic and simplest one too.
User avatar
By Barry Kelly
#295620
Moonlight wrote:
Thu Mar 21, 2019 7:49 pm
The average function is already have been implemented in many languages from long time ago, it could be even considered as stable mathematical function to provide with the languages libraries, so the question should be why GDL doesn't have one, not how you can create your own average function.
Sure, but my point was why would we need a function that takes just as much to type out as it does to do the actual calculation.
We don't have an ADD(value_1, value_2, value_3) or SUM(value_1, value_2, value_3) as it would be in spreadsheets.
Just as easy to type... value_1+value_2+value_3.

Barry.
User avatar
By Lingwisyer
#295623
And it only works in spreadsheets as you can go and select every relevant cell after typing the command which is something that you cannot do in this type of case.



Ling.