Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

GDL - Acquiring element attributes in custom labels

pedrocollares
Enthusiast

Hi all!

 

I'm new to GDL and I'm attempting to do a custom label that is able to identify which type of element is being labeled and then is able to put out its surface information, according to the type identified.

 

For example: if the labeled element is a floor, it puts out the "Top surface" of the element (Following eventual surface overrides). If it is a ceiling, puts out the "Bottom surface". If it's a wall, it puts out the "Inside finish surface" or the "Outside".

 

------

 

My questions are the following:

 

1 - How to 'Request' those surface names of the labeled object to use in the label object.

 

2 - How to condition the surface name used according to the type of element. (I'll use the same label to label walls, slabs, beams, so on)

 

3 - How to add a parameter to the label to choose Internal/External finish (In case it is a wall, or a beam)

 

4 - Would it be possible to identify if the reference line of the wall is internal/external so I can "position" my label to the correct side of the wall? (Auto-adapt according to which side finish I chose to label)

 

---

 

I don't intend to use Archicad Properties for that, because I can't use "Hybrid" element types. It fails to return values if I use multiple element types at the same property. Also, the label symbol should have a custom shape depending on the type of element being labeled, so I'm heading to GDL to have that freedom.

 

That's it. If anyone can show me directions to solve any of those questions, I'd be very thankful 🙂

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64
14 REPLIES 14

Thanks David! I did change the 2nd parameter to 3 but it didn't alter the fill.

 

pedrocollares_0-1633007384683.png

 

Still hollow.. (The label is already at the top in the view order)

 

And thanks for the tip regarding the signature, I'll adjust it soon 🙂

 

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64

Have you SET the fill before the POLY2 command (SET FILL ...)?

You need to tell it what fill you intend to use.

If you have set an 'Empty' fill, the background pen will need to be coloured.

If you have set a 'Solid' fill, the foreground pen will determine the colour.

If you have set a 'Hatched' fill, you will need to set both foreground and background pens to the same colour.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

I was missing that! 😅

 

Now it worked! Thanks

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64

cann you share the label?

 

Hi JanisL

It was developed further since this topic was created. If you're interested I could tinker it to your use, you may contact me (pedro@ideia1.com.br)

Architect / BIM Manager at IDEIA1 - www.ideia1.com.br
Archicad 27 / Windows 11 64