Expressions Error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-09 06:33 AM
Is this the correct approach/parameters to do calculations with for complex profiles with multiple materials?
- Labels:
-
Data management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 04:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 04:22 AM
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 04:30 AM
Yes that's what I have, along with a few more components overlapping (not sure if that matters).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 04:40 AM
IF ( ( Skirting - Thickness} > 0 ), TRUE, FALSE ) -- assuming skirting and thickness have the same units -- if not they must be properly cancelled out.
Is a valid expression. However, the data type returned by the expression must match the data type configured (definition value) for the expression. Generally the string type is set as default. in your case, for the above, the expression definition data type must also be set to TRUE/FALSE.
Yes you can convert from one data type to another but the units within the expression must match that of the value definition data type. However, this can't be done for true/false since there is no equivalence between a number and a Boolean value. 1 does not equal true as in some programing languages. You must use a logical (if) statement.
example:
area/m = length
volume/m = area
area * m2 = volume
area/m2 = number -- no units
IOW you must be sure to cancel out units correctly to match that of the definition value type.
Hope this helps unless you have some other issues?
Windows 11 - Visual Studio 2022; ArchiCAD 27
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 04:53 AM
Screenshot:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 05:01 AM
This will hopefully explain it.
Use 'IF' to test if the modifier is true or false - 1 or 0 in this case as we can then multiply it by the wall length.
Don't use zero as the comparison value as there will be small errors in the skirting width - 0 may actually be 0.00001.
Set a unit of measurement to the comparison value so you are comparing a length with a length.
Now just multiply it by the conditional wall length.
Make sure the 'Data Type' is 'Length' and be sure to associate the property with walls.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 05:24 AM
in your if statement you are comparing a dimension ed number to a non-unit number. They must be the same.
simply multiply the 0 by whatever units the profile is so they are the same.
Windows 11 - Visual Studio 2022; ArchiCAD 27
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 05:49 AM
With that said, I feel like the TRUE/FALSE data type is a bit useless? Using my next task as an example - if I wanted to get the position of my window/door to determine architraves on one or both sides - I'd have to obtain it from a string parameter and use the text editor functions to have it return TRUE/FALSE?
Thanks for both of your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 06:03 AM
Andrew wrote:I am a bit confused what the position would have to do with architraves.
if I wanted to get the position of my window/door to determine architraves on one or both sides - I'd have to obtain it from a string parameter and use the text editor functions to have it return TRUE/FALSE?
Wouldn't this be a parameter you turn on/off in the object.
That would be your true/false.
If true then it is (window width +window height)*2 and for doors door width + door height *2.
This doesn't allow for full height windows or corner windows if that is what you mean by position.
But architraves which are added as part of the object will best be calculated in the object.
Which may be a problem if you are using the Graphisoft doors and windows (I am unfamiliar with them as I don't use them).
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2018-08-10 06:04 AM
Andrew wrote:Correct - However, string functions can compare strings directly to return a true/false. pretty much the same as using a if statement.
I'd have to obtain it from a string parameter and use the text editor functions to have it return TRUE/FALSE?
Keep in mind that this feature is a first issue -- so as deficiencies become apparent, I ASSUME Graphisoft will improve this feature in the future??
Windows 11 - Visual Studio 2022; ArchiCAD 27