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.

Door Marker Creation

Anonymous
Not applicable
Hi all!

I've been trying to create a new door marker, or alter an existing one, but haven't had much luck so far. Basically, I'm looking to create a door marker that shows two lines of text (I've searched the boards, and have found some, but haven't beena able to get those to work). The first line of text should be the Door ID number, or a Door Type. The second line should be separated by a line, and that number should show the Door Hardware. I'd even settle for having a second line of custom text that will show there. Can anyone help?

Thanks!!
33 REPLIES 33
TomWaltz
Participant
SwissHokie wrote:
Is there a coding reference book?
I'll answer the other part shortly, but there should be a PDF in your installation directory called "GDL Reference Guide".

It's a little cryptic at times, but is a reference of almost every GDL command, their syntax, and a general usage.

There is another PDF called "Object Making with Archicad" which is more basic, and teaches object making with and without GDL.

If you can find it, David Nicholson Cole's GDL Cookbook is a great reference, though it lacks a lot of more modern commands since it was written for Archicad 6.5.
Tom Waltz
TomWaltz
Participant
The second line is a little trickier because you need to retrieve a parameter from the door object itself. In order to do that, we need to know what the parameter name is.

The easiest way to do this is to select the Door Object on your floor plan, then click File > GDL Objects > Open Object....

In the GDL editor, scroll down until you find the name of the "Hardware Set" parameter (or whatever else you might want). If it's an Archicad door, it's called "gs_list_hwsetno"

We need to use a REQUEST command and request a parameter associated with another object. In this case, the syntax will be:
REQUEST ("ASSOCLP_PARVALUE", associated_parameter_name, name_or_index_of_parameter, type, flags, dim1, dim2, requested_values).

Most of these are not important to you. They

REQUEST variable have to be part of a statement, since they are not a command by themselves (and can generate error statements), so we usually set a REQUEST statement equal to some made-up parameter (I like "xx")

We also need to create a new variable to hold the value of the Hardware Set.

I like to be obvious:
HardWareText = "" ! Makes the variable a string

Lastly, we need to place your text, which we want offset below the line.

Putting it all together, we get:
HardWareText = ""
xx = REQUEST ("ASSOCLP_PARVALUE", "gs_list_hwsetno", pIndex, typeVar, flags, dim1, dim2, HardWareText)
TEXT2 0, -0.05", HardWareText 
Tom Waltz
TomWaltz
Participant
To make the whole thing movable, we need to add graphic hotspots.

First of all, go back to the "Parameters". Click the "New" button twice, to make two new parameters at the bottom of the list. Rename (in the left column) the first to locX and the second to locY. Make their descriptions (which should be the blank right column) X-Offset and Y-Offset.

Now, go back to the 2D Script. At the very top of the script, add:
unID = 1

HOTSPOT2		locX, 0, 		unID, locY, 1+128 : unID = unID +1 
HOTSPOT2		locX, -1, 		unID, locY, 3: unID = unID +1 
HOTSPOT2		locX, locY, 	unID, locY, 2: unID = unID +1 

HOTSPOT2		0, locY, 		unID, locX, 1+128: unID = unID +1 
HOTSPOT2		-1, locY, 		unID, locX, 3: unID = unID +1 
HOTSPOT2		locX, locY,	unID, locX, 2: unID = unID +1 
This is boiler-plate code for graphic hotspots. It will work in any object that has the parameters we just created. I keep a file of all kinds of code like that so I can re-use it whenever I need it.

The hard part is knowing to put it before the MUL2 statement, otherwise the object will multiple the distance you moved the marker by the current scale.... that would be bad....
Tom Waltz
Anonymous
Not applicable
OH SO CLOSE!

I've managed to get it all working, but I'm still unable to move the Door Marker independantly of the door. Any ideas?

Thanks for all your help!!!
Anonymous
Not applicable
For info on gdl scripting...

You can also try your local ArchiCAD user group - there are a number of us in the DC area that do some GDL... PM me for details.

Wes
ps. go Hokies!
TomWaltz
Participant
SwissHokie wrote:
OH SO CLOSE!

I've managed to get it all working, but I'm still unable to move the Door Marker independantly of the door. Any ideas?

Thanks for all your help!!!
What does it do? Do you at least have the diamond-shaped hotspot in the middle?

You might need to remove the line
HOTSPOT2 0'-0.0000", 0'-0.0000" 
Tom Waltz
TomWaltz
Participant
Weston wrote:
For info on gdl scripting...

You can also try your local ArchiCAD user group - there are a number of us in the DC area that do some GDL... PM me for details.

Wes
ps. go Hokies!
For those in the Philly area, I'll be teaching this exact topic (of making your own objects and adding some script) in our next user meeting (Tuesday, March 28 at AIA HQ in Center City).
Tom Waltz
Anonymous
Not applicable
Tom,

I don't have the diamond shaped hotspot showing up. I also tried deleting the HOTSPOT2 0'-0.0000", 0'-0.0000"...but to no avail.
TomWaltz
Participant
SwissHokie wrote:
Tom,

I don't have the diamond shaped hotspot showing up. I also tried deleting the HOTSPOT2 0'-0.0000", 0'-0.0000"...but to no avail.
Do you get the "Stretch" option on the Pet Palette?
Tom Waltz
Anonymous
Not applicable
When I select a hotspot on the door itself, I get the stretch option. When I select a hotspot on the door marker, I don't have the stretch option. The hotspots show up as black dots, not as the green diamond.