cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

Project data & BIM
About BIM-based management of attributes, schedules, templates, favorites, hotlinks, projects in general, quality assurance, etc.
SOLVED!

Can't seem to find property GUID in a project

Otavio Augusto
Certified Trainer

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:
ss3.pngss4.png

 

 

 

 

 

 

 

 

 

 

 

 

this is when it works, and the following images are when it doesnt work...

 

ss1.pngss2.png

 

 

 

 

 

 

 

 

 

 

whyyyyyy

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

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.


bschwb_0-1696540640398.png

Code

Need 2 parameters named myProperty1 and myProperty2.

UI-Script

 

 

 

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

 

 

 

2D Script

 

 

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.

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

View solution in original post

3 REPLIES 3

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:

bschwb_0-1696538032242.png

 


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

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com
Solution

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.


bschwb_0-1696540640398.png

Code

Need 2 parameters named myProperty1 and myProperty2.

UI-Script

 

 

 

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

 

 

 

2D Script

 

 

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.

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com

WOW, that's awesome Bernd! thank you so much!
This is really waaaaaaaay easier, i can't express my gratitute enough!