Documentation
About Archicad's documenting tools, views, model filtering, layouts, publishing, etc.

Set Background Pen in GDL

vfrontiers
Enthusiast
Can anyone tell me if it's possible to draw a fill in the 2d SYMBOL portion of a library part then use the script to adjust the background pen?

I really like the feature that manipulate the BACKGROUND PEN in MODEL OPTIONS... so I can produce COLOR DESIGN PLANS using the background pens and turn them off for CD's...

But I can't figure out how to have control over a fill's background pen from a gdl parameter..


Thanks in advance,
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop
8 REPLIES 8
Anonymous
Not applicable
The GDL reference says...

POLY_2B n, frame_fill, fill_pen, fill_background_pen, x1, y1, s1, ..., xn, yn, sn

Does that help? I assume you know how to create a pen color parameter, and the background fill can be assigned here, so I'm assuming it will work.
Anonymous
Not applicable
GDL wrote:
FRAGMENT2 fragment_index,
use_current_attributes_flag
The fragment with the given index is inserted into the 2D Full View with the current transformations.
use_current_attributes_flag: defines whether or not the current attributes will be used
0: the fragment appears with the color, line type and fill type defined for it.
1: the current settings of the script are used instead of the color, line type and fill type of the fragment.
The use_current_attributes_flag might do what you want. I don't know if it includes the background pen.
vfrontiers
Enthusiast
Matthew wrote:
GDL wrote:
FRAGMENT2 fragment_index,
use_current_attributes_flag
The fragment with the given index is inserted into the 2D Full View with the current transformations.
use_current_attributes_flag: defines whether or not the current attributes will be used
0: the fragment appears with the color, line type and fill type defined for it.
1: the current settings of the script are used instead of the color, line type and fill type of the fragment.
The use_current_attributes_flag might do what you want. I don't know if it includes the background pen.

This is more along the lines I was after as the fills are "hand drawn" in the 2d symbol... But it doesn't work.

Just think it's funny that you can put a PEN statement or FILL statement in front of the FRAGMENT2 to control fills / pens but not background pen...

*wishlist*
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop
Anonymous
Not applicable
vfrontiers wrote:
Just think it's funny that you can put a PEN statement or FILL statement in front of the FRAGMENT2 to control fills / pens but not background pen...

*wishlist*
The FRAGMENT2 statement antedates the background pen function and it seems it hasn't been revised to accommodate it.
David Maudlin
Virtuoso
vfrontiers wrote:
Can anyone tell me if it's possible to draw a fill in the 2d SYMBOL portion of a library part then use the script to adjust the background pen?
Duane:

You can drag the fill from the 2D Symbol window into the 2D Script window, this will convert the fill to code using the POLY2_B{5} command that has fill_background_pen as one of its variables.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Anonymous
Not applicable
Another way to do it would be to have the linework on say layer 1 of the symbol, and the fill on layer 2. When the fill is needed you need to issue 2 fragment2 commands. First set the fill to either Solid Fill or %100 and the pen for the fill to the background pen and issue the fragment2 command. Then set the fill and pen to the user selected fill and foreground pen and issue the fragment2 command.
vfrontiers
Enthusiast
Michael wrote:
Another way to do it would be to have the linework on say layer 1 of the symbol, and the fill on layer 2. When the fill is needed you need to issue 2 fragment2 commands. First set the fill to either Solid Fill or %100 and the pen for the fill to the background pen and issue the fragment2 command. Then set the fill and pen to the user selected fill and foreground pen and issue the fragment2 command.
Right... but then I won't have MODEL VIEW control over the fill as described in the original post...

What I'm after is the ability to have PRESENTATION plans with color (using the BACKGROUND of the fill) then be able to "turn off" the background using the MODEL View Options when producing CD's...

I know I can do this with another LAYER of PRESENTATION FILLS, which is what I have to do now. But it's a bummer every time furniture changes to have to make sure the fills follow along with the objects.

I can ALSO simply PRESET the fills of the objects with the proper BACKGROUND FILL PEN, but then if I want a GREY TABLE and a PURPLE same TABLE, I'm screwed.

Not a huge deal, but seems like GDL could handle a BCKGD_PEN override for the 2d symbol...
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop
vfrontiers
Enthusiast
David wrote:
vfrontiers wrote:
Can anyone tell me if it's possible to draw a fill in the 2d SYMBOL portion of a library part then use the script to adjust the background pen?
Duane:

You can drag the fill from the 2D Symbol window into the 2D Script window, this will convert the fill to code using the POLY2_B{5} command that has fill_background_pen as one of its variables.

David
I've done this before (many, many years ago) and am going to try this again.

Ultimately this will get me where I need to be. These were furniture pieces that were converted from .3ds.... So they had SCRIPTED 2d representations which were SLOWWW...

So... I just did a top view and ECONOMIZED the linework. I guess I can take it that one more step and drag back to the script window to add this additional control.

Thanks EVERYONE for the exploration of this topic.

BTW... I want to give a shameless plug for ArchiBASE planet (http://www.archibaseplanet.com) . I use it mostly to get furniture for ArtLANTIS, but most objects come as .gsm as well (though they are clearly just .3ds conversions)... But they're a hole different level of look for models. Admittedly, 90% of the stuff I'll never use, but the other 10% is fantastic.... Can be directly imported into ArtLantis and converted to ArtLantis objects.
Duane

Visual Frontiers

AC25 :|: AC26 :|: AC27
:|: Enscape3.4:|:TwinMotion

DellXPS 4.7ghz i7:|: 8gb GPU 1070ti / Alienware M18 Laptop