2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2023-10-05 10:10 PM
To find the property GUID, I usually use the 'property label 26' in an object, select which property I want, and save it as a custom label. So, when I open its GDL 2D code, I can find the selected property GUID to use in other objects that I'm creating. However, in this frustrating project (which predates my template in the office), when I save the custom label, it doesn't show any GUID. Does anyone know why or another way to find a property GUID?
Just to illustrate what i'm saying:
this is when it works, and the following images are when it doesnt work...
whyyyyyy
Solved! Go to Solution.
2023-10-05 11:22 PM - edited 2023-10-26 09:27 AM
Actually wasn't happy that the GUIDs can't be easily copied so I updated the object to be able to select the properties in the label settings and you can easily copy the GUIDs from there. The new object is attached to this post.
Need 2 parameters named myProperty1
and myProperty2
.
dim _parentProperties[]
n = REQUEST ("Properties_Of_Parent", "", _parentProperties)
ui_custom_popup_infield "myProperty1",
200, 10, 250, 20, ! X Position, Y Position, Width, Height
1, ! Store Hidden ID
3, ! Tree Depth
1, ! Grouping Method
"", ! Selected Value Description: same as the ID
_parentProperties
ui_custom_popup_infield "myProperty2",
200, 40, 250, 20, ! X Position, Y Position, Width, Height
1, ! Store Hidden ID
3, ! Tree Depth
1, ! Grouping Method
"", ! Selected Value Description: same as the ID
_parentProperties
foundProp1 = 0
foundProp2 = 0
for i = 1 to vardim1(_parentProperties) step 4
propertyGuid = _parentProperties[i]
groupOfProperty = _parentProperties[i+2]
propertyName = _parentProperties[i+3]
if (propertyGuid = myProperty1) then
foundProp1 = 1
ui_outfield propertyName, 10, 10, 180, 20
endif
if (propertyGuid = myProperty2) then
foundProp2 = 1
ui_outfield propertyName, 10, 40, 180, 20
endif
next i
if not (foundProp1) then
ui_outfield "Please select a property", 10, 10, 180, 20
endif
if not (foundProp2) then
ui_outfield "Please select a property", 10, 40, 180, 20
endif
dim _parentProperties[]
n = REQUEST ("Properties_Of_Parent", "", _parentProperties)
foundProp = 0
for i = 1 to vardim1(_parentProperties) step 4
propertyGuid = _parentProperties[i]
groupOfProperty = _parentProperties[i+2]
propertyName = _parentProperties[i+3]
if (propertyGuid = myProperty1) OR (propertyGuid = myProperty2) then
foundProp = 1
text2 0, 0, groupOfProperty + " - " + propertyName
text2 1, -1, propertyGuid
add2 0, -3
endif
next i
if not (foundProp) then
text2 0, 0, "No property selected!\nPlease go into the label settings and select a property!"
endif
Edit (2023-10-26): Renamed object to "GetPropertyGuids.gsm" to better denote the use case. Also compatible with AC24+ now.
2023-10-05 10:36 PM - edited 2023-10-05 11:26 PM
Hi Otavio!
Not sure why your way is not working, but I've attached you a label object which can give you the property GUID in a different way.
Just use it to label some element which has access to the properties, similar to my screenshot:
To make the object yourself, you can paste the following code into the 2D script of new label object.
dim _parentProperties[]
n = REQUEST ("Properties_Of_Parent", "", _parentProperties)
for i = 1 to vardim1(_parentProperties) step 4
propertyGuid = _parentProperties[i]
groupOfProperty = _parentProperties[i+2]
propertyName = _parentProperties[i+3]
if (propertyName = "TAG ACABAMENTO #1") OR (propertyName = "TAG ACABAMENTO #2") then
text2 0, 0, groupOfProperty + " - " + propertyName
text2 1, -1, propertyGuid
add2 0, -3
endif
next i
Hope that helps!
Bernd
2023-10-05 11:22 PM - edited 2023-10-26 09:27 AM
Actually wasn't happy that the GUIDs can't be easily copied so I updated the object to be able to select the properties in the label settings and you can easily copy the GUIDs from there. The new object is attached to this post.
Need 2 parameters named myProperty1
and myProperty2
.
dim _parentProperties[]
n = REQUEST ("Properties_Of_Parent", "", _parentProperties)
ui_custom_popup_infield "myProperty1",
200, 10, 250, 20, ! X Position, Y Position, Width, Height
1, ! Store Hidden ID
3, ! Tree Depth
1, ! Grouping Method
"", ! Selected Value Description: same as the ID
_parentProperties
ui_custom_popup_infield "myProperty2",
200, 40, 250, 20, ! X Position, Y Position, Width, Height
1, ! Store Hidden ID
3, ! Tree Depth
1, ! Grouping Method
"", ! Selected Value Description: same as the ID
_parentProperties
foundProp1 = 0
foundProp2 = 0
for i = 1 to vardim1(_parentProperties) step 4
propertyGuid = _parentProperties[i]
groupOfProperty = _parentProperties[i+2]
propertyName = _parentProperties[i+3]
if (propertyGuid = myProperty1) then
foundProp1 = 1
ui_outfield propertyName, 10, 10, 180, 20
endif
if (propertyGuid = myProperty2) then
foundProp2 = 1
ui_outfield propertyName, 10, 40, 180, 20
endif
next i
if not (foundProp1) then
ui_outfield "Please select a property", 10, 10, 180, 20
endif
if not (foundProp2) then
ui_outfield "Please select a property", 10, 40, 180, 20
endif
dim _parentProperties[]
n = REQUEST ("Properties_Of_Parent", "", _parentProperties)
foundProp = 0
for i = 1 to vardim1(_parentProperties) step 4
propertyGuid = _parentProperties[i]
groupOfProperty = _parentProperties[i+2]
propertyName = _parentProperties[i+3]
if (propertyGuid = myProperty1) OR (propertyGuid = myProperty2) then
foundProp = 1
text2 0, 0, groupOfProperty + " - " + propertyName
text2 1, -1, propertyGuid
add2 0, -3
endif
next i
if not (foundProp) then
text2 0, 0, "No property selected!\nPlease go into the label settings and select a property!"
endif
Edit (2023-10-26): Renamed object to "GetPropertyGuids.gsm" to better denote the use case. Also compatible with AC24+ now.
2023-10-05 11:51 PM
WOW, that's awesome Bernd! thank you so much!
This is really waaaaaaaay easier, i can't express my gratitute enough!