Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

Expressions Error

Anonymous
Not applicable
I'm having problems trying to use Skin Component Area in expressions. The error I'm receiving is "Expressions contains circular reference"

Is this the correct approach/parameters to do calculations with for complex profiles with multiple materials?
20 REPLIES 20
Anonymous
Not applicable
On a similar note, I'm trying to do the same thing in order to try and detect if a door position is external or not in order to have an expression use it to determine if its a single/double architrave.
Barry Kelly
Moderator
So just to confirm we are both going down the same track, you have a complex profile something like this that has modifiers to allow for a skirting (or not if zero width)?

Barry.
One of the forum moderators.
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
Anonymous
Not applicable
Hi Barry,

Yes that's what I have, along with a few more components overlapping (not sure if that matters).
poco2013
Mentor
Not Sure this is your problem but:

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?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Anonymous
Not applicable
Sorry, the "Skirting - Thickness" is the modifier name, not an operation. The data value of "Skirting - Thickness" should be a statement of true/false from my understanding - matching the required expression definition data type.

Screenshot:
Barry Kelly
Moderator
I was going to look at it on the weekend, but my interest has been piqued.

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.
One of the forum moderators.
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
poco2013
Mentor
To add to what Barry said -- and I believe we are saying the same thing.

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.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Anonymous
Not applicable
This works perfectly. Definitely jogged up some old memories from coding classes a long time ago.

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.
Barry Kelly
Moderator
Andrew wrote:
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?
I am a bit confused what the position would have to do with architraves.
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.
One of the forum moderators.
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
poco2013
Mentor
Andrew wrote:
I'd have to obtain it from a string parameter and use the text editor functions to have it return TRUE/FALSE?
Correct - However, string functions can compare strings directly to return a true/false. pretty much the same as using a if statement.

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??
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27