The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Everything about using Libraries and Library Parts - Doors/Windows/Objects/Stairs etc. (Example: How can I display a Transom above my Door?)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, Gergely Feher

User avatar
By phubbell
#174906
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
User avatar
By phubbell
#174988
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.
User avatar
By F. Beister
#175031
Have a look at this code:


Code: Select all
!################################################################################
!
! 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[i]=NameP : valS[i]="" : valN[i]=0 : valA[i]=Art
    maxP=i
    if Art=4 then valS[i]=Wert else valN[i]=Wert
	endif
  sts[i]=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[i]

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

    NEXT i
[/quote]
User avatar
By phubbell
#175083
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.
User avatar
By phubbell
#175132
selfGDL.com just made it onto my bookmarks bar. I love the way your site is organized. Now I just have to learn German.