We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Label that reads any parameter on an object

Anonymous
Not applicable
Hi,

I've recently started working with Archicad (17) and I've come across a problem. At my workplace, we need to be able to display quite a lot of information on the drawing in 2D, information that is contained within objects. In Archicad I have only found the standard labeler that only displays the ID of the object and that it can only display 1 label per object.

For example I may need to show on the drawing that this object is a SINK and I would maybe also display that this object will have liquids and gases connected to it. For example I would have small texts saying
BL, KV, TL (Swedish so don't mind the letters). This is information that I store in the object and it would be very handy to have a label that could simply read from a chosen parameter.

So I'm looking for someone out there that knows alot about GDL, I've only had 1 days worth of a course on it and I'm very limited on the basics of it.

What I need is:
* Text label that reads 1 row of a parameter that is conatined within the selected object.
* Label can be moved and rotated manually
It is managable to say that for example a parameter-row that I've named Liquids1 can have it's own label connected to it so that I would have say a list of 20 different labels connected to a certain parameter.

What I'd like to be able to do:
* I select the textlabel, connect it to my object. Get a dropdown list of all the usermade parameters that I can just choose from. (So I only need 1 GDL object)
* Within the labeltool, change size and font of the text.
* That I can lock in this text to the object so when I move or rotate the object the labeltext will stick with it.

Anyone out there that has a solid idea how to atleast start this up and get it going?
25 REPLIES 25
Anonymous
Not applicable
I think you have to contact "Master Script".....http://www.masterscript.nl/.
They have made few useful LABELS.
Anonymous
Not applicable
andro55 wrote:
I think you have to contact "Master Script".....http://www.masterscript.nl/.
They have made few useful LABELS.
I looked in to their script called Label Everything but this seems a bit too much.

Is it really that hard to make a text strip that automaticly reads a parameter on an object.
I feel like it should be very basic, It doesn't need to autorotate based on stuff, read everything connected to an object or have markers connected to it.

As I said, I only did a 1 day GDL course and have some coding experience from way back in school so I'm really just looking for some pointers on what strings I should take a look at if noones actually done a GDL object like this before.
sinceV6
Advocate
Hi there.
If you are looking for pointers to get started, there are a lot of people in this community that will gladly help you get going.

It is really not that hard to do what you want, but it will take a little time and patience and a lot of reading and trial & error.

The first thing I would say: keep your GDL reference guide open at all times You will need it. Check out the Text Element section in the guide, it has the keywords you'll need to grab the object's parameter's content and display it as text in your label (such as text2, richtext2; and others like SET STYLE, DEFINE STYLE, PARAGRAPH, TEXTBLOCK)

Remember to make your new scripted object a Label subtype, this if you really want it to be attached to your object and to be recognized as a label by the label tool.

Hope this helps you get started.
Feel free to ask!
Anonymous
Not applicable
Thank you for the pointers.

I've been looking around a bit and I'm not quite sure what I've gotten myself in to

What I've done is a new object that is subtype Label.

Here I've been messing around with
Text2 aswell as the =REQUEST ("ASSOCLP_PARVALUE",...) - Can't seem to find out how to use this appropriatly
Also I made an attempt with a = str(...)

But I can't seem to put the pieces together. the GDL Reference Guide isn't very Rookie-friendly


I've read up that I need to have the exact same parameters in both my label object and my objects were I want to read information from for it to match up.

Is it important to set the style of the text? For now I'd just like to see if I can get the label to read stuff.

Say I had a list of parameters on all my objects that are identical that reads for example rows:

VVS1
VVS2
EL1
EL2
- This rows are texts that are blank in the objectlibrary and I want to type in information in the object itself

I have my labeltool that simply reads the parameter VVS1 and displays the information written in the object.
- (Advanced would be to select which of the VVS1, VVS2, EL1 and EL2 to display from the objects parameters)

Pointers and ideas?
Documentation about Request ASSOCPAR_VALUE has an error.
There is missing "" there I do not remember where - open any marker object and search for the command.

Best Regards,
Piotr
Anonymous
Not applicable
Hello,

I've been messing around and looking at other markers and I feel like I've gotten somewhere overall but I still can't seem to fetch information with the request.

Can't seem to find much information on this in either the GDL ref guide or via google.

I'm looking at this:
If link_att=`Media` Then
na=request("Assoclp_parvalue", "Media", naminda, typea, flaga, dim1a, dim2a, vala)

What is the na=request, do I need to reference this in somewhere else?

What is all of these: naminda, typea, flaga, dim1a, dim2a, vala?

link_att is the parameter that will display on the drawing and it works with my other setups with the name of the object and the ID but I can't seem to fetch information from my parameter named Media which I have in both the object and the marker
Anonymous
Not applicable
My next attempt was this:
If link_att=`Media` Then
Media = ""
nm=Request ("Assoclp_parvalue", "Media", index, type, flags, dim1, dim2, Media)

TEXT2 0,0,Media
EndIf


I have the Media parameter in both my object and my label
This instead of not working at all gives me a 0 on the drawing
sinceV6
Advocate
Hi.
I've been a little busy to reply. Before downloading, please read the explanation and try to do it yourself. If you can't, download and open to see how it works. Here it goes:

It may seem that the GDL guide isn't friendly, but you really need to read it carefully and fully understand how each keyword works.

The request is the correct one. Did you see the explanation of the REQUEST function? It says that its return value is the number of correctly retrieved values, 0 otherwise. So if you write n=REQUEST (something, bla, bla...) then if your request and parameters are correct, the value of n will be how many values you got right, may be 1, 2, etc. So if n=0 something didn't work as expected. If n>0, "you've got values"

To keep the solution simple:
Make one object. Create one parameter that will store the values you'll want to display, name it "sampleParameter". Write something simple in the 2D script so you can select the object in plan, like:

circle2 0,0,0.10
hotspot2 0,0
In the parameter script, give your parameter the values you will want to display, something like:

VALUES 'sampleParameter' 'fv','dc','sx','az'
If you want, you could show the text to see if it works:

text2 0,0,sampleParameter
Also, if you want, you could add a second boolean parameter to turn of the text in this object, just to make it simpler to work in the label; so make a new boolean parameter and name it "showSampleText" and leave it on by default, then change the text2 line in 2d script to:

IF showSampleText THEN text2 0,0,sampleParameter
Save it and place it on plan.

Now the label.

Make a new object, label subtype. No parameters needed for this simple test. You request, from the associated object, the value from the "sampleParameter", and store it in the last variable: "requestedValue"; as the GDL guide describes it. The DUMMY parts, you don't need right now.

In the masterScript, write:

requestedValue=""
n = REQUEST("ASSOCLP_PARVALUE", "sampleParameter", DUMMY_name_index, DUMMY_type, DUMMY_flags, DUMMY_dim1, DUMMY_dim2, requestedValue)
So with this, you have the value of the "sampleParameter" stored in the "requestedValue" variable, that gets initialized with requestedValue=""

Now in the 2d script, just write:

text2 0,0,requestedValue
Save your new label.

Select the object you created, label it; select the label and from the label type, select the newly saved label. It should display the value of the parameter from the object. If you open the object's properties and change the value, the label should update.

From here, you can add other bells & whistles to your lablel.

Hope this helps.
Best regards.
Anonymous
Not applicable
Thanks a bunch sinceV6,

I will take a look when work allows it and get back to you!