Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Label that can read objects

Anonymous
Not applicable
I'm working on a label that will note the selected parameters of an object. I have figured out how to get the value of a parameter if I know the parameter in advance.

Is there a way to read the parameters in any object? ...perhaps a request function I'm missing.

The goal is to select an object, label it and choose the parameter to label from a menu (driven by the parameter script).

Best, Patrick
8 REPLIES 8
Frank Beister
Moderator
Try this one:
ASSOCLP_NAME
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Yes. I have used ASSOCLP_NAME to get the name of an object and ASSOCLP_PARVALUE to get the value of a particular parameter.

The problem is that I need to know the parameter I'm looking for in advance. In other words if I want to label a seat with the material it's made out of, I would need to know that the material parameter is SEAT_MAT. I would love to be able to attach the label to any object and see what parameters are in the object.
Frank Beister
Moderator
Have a look at this code:


!################################################################################
!
! Etikett-Parameter-Routine von Frank-Beister+ Jochen Sühlo


DIM NP[],valS[],valN[],valA[],valAt[],askP[13],valP[],sts[],stsT[]


!### request all parameters from main object and
!### store name and value into the arrays

i=1

do
  NameP=""
  rrr=REQUEST ("ASSOCLP_PARVALUE", i, NameP, Art, Zustand, Dimension_1, Dimension_2, Wert)
  if rrr then
    NP=NameP : valS="" : valN=0 : valA=Art
    maxP=i
    if Art=4 then valS=Wert else valN=Wert
	endif
  sts=Zustand
  i=i+1
  while i<501 and rrr



!### print list

DEFINE STYLE "Links" LABEL_FONT_NAME, LABEL_TEXT_SIZE,3,1
DEFINE STYLE "Rechts" LABEL_FONT_NAME, LABEL_TEXT_SIZE,1,0
s=-LABEL_TEXT_SIZE/1000*GLOB_SCALE*1.5

  for i=1 to maxP

    STYLE "Links"
    f=f+1 : text2 0,0,NP

    STYLE "Rechts"
    IF valS="" THEN txt=str("%.4",valN) ELSE txt="»"+valS+"«"
    text2 t,0, txt + " (type=" + str(valA,1,0) + " · " + str(sts,1,0)+"?"
 
    ADD2 0,s

    NEXT i
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
Thanks so much. Can't wait to try this. I would have never figured this out.

Patrick
Ben Cohen
Advocate
Frank, you are VERY good. Nice work
Ben Cohen
Mac and PC
Archicad (Latest Version) aus
www.4DLibrary.com.au
Anonymous
Not applicable
Many thanks to Frank-Beister+ Jochen Sühlo for their code,

I had a chance to play with this today. I must say this bit of code is great! I learned a lot of things I would have never discovered from the GDL manual. Now I'm working on sorting out the unnecessary parameters to create a useful label object.
Frank Beister
Moderator
What could you learn, if you could read selfGDL.com. 😉
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
selfGDL.com just made it onto my bookmarks bar. I love the way your site is organized. Now I just have to learn German.