June 5, 2019 at 20:32 #4769
I am working on a custom label that I would like to read the values of certain parameters from the labeled object, and can’t seem to find the right script command. This would be an associative label only for now. Maybe I’ll add custom options for independent labels later.
How I want it to work:
1. This is limited just to Objects, but applies to non-global variables.
2. In the Label’s settings, I would specify a list of parameter names I want it to retrieve from the labeled object (separated by a comma perhaps that could be broken up with a split command later).
Let’s keep it simple and say I just want it to retrieve the value of “parameter 1” from the labeled object.
3. I would then be able to use this value in the script of my label to adjust other functions for the label’s appearance based on the parameter values retrieved from the associated object.
REQUEST only seems to work for global parameters/properties
Can the CALL function be used to get those parameter values if there’s no specific library name to CALL?
Help is most appreciated!
June 6, 2019 at 11:19 #4770
Have you tried this (this REQUEST works in labels and markers to read Parameters from the associated objects):
REQUEST (“ASSOCLP_PARVALUE”, expr, name_or_index, type, flags, dim1, dim2, p_values)
Example from a GS-Marker:
! — Fire Rating ————————————————————–
if GS_iCustomText_5 = CTXT_MEASUREDVALUE or not(AC_show_firerating) then
firerating = “”
rrr = request (“ASSOCLP_PARVALUE”, “gs_list_firerating”,
index_firerating, type_firerating, flags_firerating,
dim1_firerating, dim2_firerating, firerating)
AC_MarkerText_5 = AC_FirePrefix + firerating ! Fire Rating Value
parameters AC_MarkerText_5 = AC_MarkerText_5
GDL Object Developer
MAC OSx 10.12
June 10, 2019 at 13:46 #4773
Thank you Joachim,
So if I’m trying to retrieve the value of a parameter “bDoor” (boolean value), I would do the following?
bDoor=”” !!! (does the empty expression initialize a variable regardless of what type it is?)
rrr=request(ASSOCLP_PARVALUE”,”bDoor”, index_bDoor, type_bDoor, flags_bDoor, dim1_bDoor, dim2_bDoor, bDoor) !!! (are the index_, type_, flags_, dim1_, and dim2_ necessary here if I know the nature of the variable I’m looking for?)
June 13, 2019 at 10:26 #4778
bDoor = “” initializes the variable as a string, bDoor = 0 as numeric. It could cause a problem if the request fails, and you compare an integer against the string variable.
All the variables are needed in the request expression, altough you can use shorter names for the unneeded ones.
The last parameters expression is not needed, your bDoor is a variable.
Software Engineer, Library Team
June 13, 2019 at 16:03 #4780
Finally got it to work!
Thank you both for your help!
You must be logged in to reply to this topic.