2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
‎2024-07-26 06:48 AM - edited ‎2024-07-26 06:53 AM
Hi,
I have trouble with expressions. I would like to use expression, which tests, whether object is part of module.
I have some objects (e.g. sink) tahat are part of hotlinked module. This module has ID which corresponds to building ID (e.g. Building 01). Then I have some objects, that are not part of hotlinked module and they have property (BuildingID) which we manually fill out. And what I need to do is to have another property (e.g. BuildingIDschedule) which I can put into schedules. This property would be either "BuildingID" or "ModuleID" .
Simply:
IF "object is part of hotlinked module"; moduleID; BuildingID
Whatever I try I get undefined either for objects that are part of module or for the objects that are not.
Thank you
Operating system used: Windows
Solved! Go to Solution.
‎2024-07-26 01:49 PM
One approach I'd try:
IF ( OR(ID modulu = "A"; ID modulu = "B"; ID modulu = "C"; ID modulu = "D"; ID modulu = "E"; ID modulu = "F"); ID modulu; SEKCE VOLBA )
→ the usage of OR(condition1; condition2; ....; conditionN) simplifies the conditions you tried
another one to make the expression even easier:
IF ( ID modulu <> ""; ID modulu; SEKCE VOLBA )
ID modulu <> "" → means if ID modulu is not empty (there's a difference between the value being empty or being undefined)
with this type of writing the condition there's no need to specify what exactly is written in IDmodulu. As long there is some value in there it will use IDmodulu as a result.
‎2024-07-26 08:43 AM
Hi,
I'd suggest to check the following:
‎2024-07-26 08:56 AM
Hi,
module is exported from the same file and property is set to be visible to all classifications. Objects are all properly classified.
‎2024-07-26 09:13 AM
I tried reproducing the error, but for me it worked like intended. Maybe you can share a few screenshots:
‎2024-07-26 12:15 PM
As a workaround I used following expression:
#SEKCE
IFS ( ID modulu = "A"; ID modulu; ID modulu = "B"; ID modulu; ID modulu = "C"; ID modulu; ID modulu = "D"; ID modulu; ID modulu = "E"; ID modulu; ID modulu = "F"; ID modulu; ID modulu = ""; SEKCE VOLBA )
This works as we use only 6 unique IDs for our modules (6 buildings - A, B, ...F). So in case object has any of the module IDs it returns Module ID (as building identification), otherwise it returns "SEKCE VOLBA" which is manually set up by us (Again A, B, ...F).
But what I was originally trying was this:
On printscreen you can see that #SEKCE works, but #SEKCE 1S doesn't work:
IF ( ISUNDEFINED ( ID modulu) ; SEKCE VOLBA; ID modulu )
This doesn't work either:
IF ( ISUNDEFINED ( ID modulu) ; ID modulu ; SEKCE VOLBA)
 
‎2024-07-26 01:49 PM
One approach I'd try:
IF ( OR(ID modulu = "A"; ID modulu = "B"; ID modulu = "C"; ID modulu = "D"; ID modulu = "E"; ID modulu = "F"); ID modulu; SEKCE VOLBA )
→ the usage of OR(condition1; condition2; ....; conditionN) simplifies the conditions you tried
another one to make the expression even easier:
IF ( ID modulu <> ""; ID modulu; SEKCE VOLBA )
ID modulu <> "" → means if ID modulu is not empty (there's a difference between the value being empty or being undefined)
with this type of writing the condition there's no need to specify what exactly is written in IDmodulu. As long there is some value in there it will use IDmodulu as a result.
‎2024-07-26 02:02 PM
Thanks a lot. This is great. I have never seen usage of this <> - that is my little game changer with AC expressions 🙂