cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
til0byte
Participant

Archicad 29: poly2_b{5} outline missing (covered by fill?) despite separate calls

Hi everyone,

I’m working on a 2D furniture object in Archicad 29 that changes its representation based on a custom Model View Option (MVO).

The Problem: The fills render correctly (Solid, Dashed, Colored), but the outlines (contours) are invisible in regular view. However, when I select the object in the floor plan, the dashed/solid outlines appear as part of the selection highlight. It seems like the fill is overlapping the outline, even though they are called separately.

I am using the poly2_b{5} command and I’ve already tried adding explicit pen resets before each call.

! ---- Standard Initialization ----
pen gs_cont_pen
fill gs_fill_type

! ---- Constants ----
DISPLAY_HIDDEN  = 1
DISPLAY_SOLID   = 2
DISPLAY_DASHED  = 3
DISPLAY_COLORED = 4

! ---- Read MVO Settings ----
_mode = 2
_ok = LIBRARYGLOBAL("ModelViewSettings", "iDisplayMode", _mode)

! Mode 1 = Hidden: draw nothing
IF _mode = DISPLAY_HIDDEN THEN GOTO 999

! ---- Determine Pen Color ----
_pen = 19
IF _mode = DISPLAY_COLORED THEN
    _pen = 85
    IF iResponsibility = 2 THEN _pen = 104
    IF iResponsibility = 3 THEN _pen = 114
ENDIF

! ---- Set Line Style ----
IF _mode = DISPLAY_DASHED THEN
    set line_type 25
ELSE
    set line_type 1
ENDIF

pen _pen

! ---- Main Body ----
IF _mode <> DISPLAY_DASHED THEN
    ! (1) Fill (Solid/Colored only)
    fill fillAttribute_1
    poly2_b{5} 5, 2, 0, 3, _pen, 0,
        0, 0, 1, 0, 0, 1, 0,
        0, 0, 1,
        A, 0, 1,
        A, B, 1,
        0, B, 1,
        0, 0, 1
ENDIF

! (2) Contour (all modes except Hidden)
pen _pen
poly2_b{5} 5, 1, 0, 3, 1, 0,
    0, 0, 1, 0, 0, 1, 0,
    0, 0, 1,
    A, 0, 1,
    A, B, 1,
    0, B, 1,
    0, 0, 1

! ---- Top Elements----
IF isVitrine = 1 THEN
    _vx = A / 8
    _vy = B / 12
    IF _mode <> DISPLAY_DASHED THEN
        ! (1) Fill
        fill fillAttribute_1
        poly2_b{5} 5, 2, 0, 3, _pen, 0,
            0, 0, 1, 0, 0, 1, 0,
            _vx,   _vy,   1,
            A-_vx, _vy,   1,
            A-_vx, B-_vy, 1,
            _vx,   B-_vy, 1,
            _vx,   _vy,   1
    ENDIF
    ! (2) Contour
    pen _pen
    poly2_b{5} 5, 1, 0, 3, 1, 0,
        0, 0, 1, 0, 0, 1, 0,
        _vx,   _vy,   1,
        A-_vx, _vy,   1,
        A-_vx, B-_vy, 1,
        _vx,   B-_vy, 1,
        _vx,   _vy,   1
ENDIF

999:
end

 

Has anyone encountered this behavior with poly2_b{5}? Is there a specific draw order or distortion_flag I might be missing to ensure the contour stays on top?

Thanks in advance!



2 Replies 2
Jochen Suehlo
Moderator Emeritus

Have you tried to let the object create the script. Here the outer lines are visible. Please compare it with your script. (AC 29 , MAC OS)

pen         24
fill "Misch-Schraffur 50 %"
poly2_b{5}       5,      2,      1,      3,     24,     91, 
                   0,            0,            1,            0,            0,            1,            0, 
                   0,            0,     33, 
                   0, -1.598563264691,     33, 
        2.258005550405, -1.598563264691,     33, 
        2.258005550405,            0,     33, 
                   0,            0,     33
pen          1
set line_type "Volllinie"
poly2_b{5}       5,      1,      0,      3,      1,      0, 
                   0,            0,            1,            0,            0,            1,            0, 
                   0,            0,     33, 
        2.258005550405,            0,     33, 
        2.258005550405, -1.598563264691,     33, 
                   0, -1.598563264691,     33, 
                   0,            0,     33


 

Jochen Suehlo . AC12-29 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
runxel
Moderator

Any particular reason you are not using inline conditionals to flip the bits?

In my opinion keeping it DRY is a better style.

So I'd do it like this:

pen mypen
fill myfill
has_outline = not(_mode = display_hidden)
has_fill = (_mode = display_solid) | (_mode = display_colored)

poly_2b 4, has_outline+2*has_fill+4, pen_fg, pen_bg,
    0, 0, 1,
    ... etc.

Not sure what you'd need version {5} for in your code, but there it's the same.

Lucas Becker | AC 29 on Mac (Sequoia) | Graphisoft Insider Panelist | Akroter.io – high-end GDL objects | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text

My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!