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

Can GDL tell if a layer is on or off?

Anonymous
Not applicable
I am trying to create a library part that shows lines and text when a "text layer" is turned on in the layer settings, but only show the lines when the "text layer" is turned off.

Again, control over the visibility of the text must be dependent upon the layer settings, not a parameter in the object itself.

Is there a way to do this? and if so, how?

Thanks
Wes
5 REPLIES 5
Rob
Graphisoft
Graphisoft
Weston,
I am afraid that's not possible. Check globals/requests in the AC help but I think there is nothing about the actual layer status.
::rk
Karl Ottenstein
Moderator
Weston wrote:
I am trying to create a library part that shows lines and text when a "text layer" is turned on in the layer settings, but only show the lines when the "text layer" is turned off.
Library parts can ask which zones they are in, and they can be in any number of overlapping zones at that. The only zones that are retrieved by the zone request are the visible ones. You can take advantage of that.

Define a zone category with white as the color. In your 'text layer', draw a zone with this white zone category that is as large as the drawing extents and copy it to every story that you will be using your object on. (It would seem that one very tall zone placed on the lowest story would work, but it seems that zone awareness is a 2D thing even though zones are 3D.)

Inside your object use a dynamic array and request similar to this:
dim strParams[]
nParamCount=request ("Zone_relations", "",strParams)

nZoneCount = nParamCount / 4
text2 0, 0, "zone count="+str(nZoneCount,3,0)

for nRow=1 to nParamCount
	add2 0, -0.2
	text2 0, 0, strParams[nRow]
next nRow
and instead of displaying the values of the parameters, iterate through them (in steps of 4) to see if your special zone name is present ... if so , then you know that the text layer is on, if not, you know that it is off.

This weird workaround only works if your object is only used in plan (story) views. Out of luck with sections and details. (You could do something goofy with a global variable set by an auxiliary part in plan, but the variable wouldn't be changed if you changed layer settings while viewing the detail ... you'd have to rebuild the plan, then go back to the detail. So... no reproducible behavior for document publishing.)

Hopefully there is a better idea out there...

Karl
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
Aussie John
Newcomer
I know is not the same but often you dont want to see the text when the scale gets too small so you library part can be scripted to not show text at certain scales
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019
[/size]
Anonymous
Not applicable
Aussie wrote:
I know is not the same but often you dont want to see the text when the scale gets too small so you library part can be scripted to not show text at certain scales
Sure - use the global variable :

if smaller than Glob_scale then text (else not)
Anonymous
Not applicable
We use these workarounds at our office. Specific pen set for object labeling, PlotMaker layout has that pen turned white if text not needed. True 255,255,255 white doesn't plot (atleast with our plotters) even with "everything black" checked, which is perfect for us.

Opening object and disabling text (or anything else) with ! in GDL code takes few seconds. Plot or print or save DWG without unwanted information. Much faster than fidling with objects parameters.

Your GDL request belongs to my long list of GDL improvements, too.