GDL
About building parametric objects with GDL.

how to get the labelled door origin

easyDoesIt
Booster

I have a label that I would like to know the origin of the door that it is labelling. What I have so far below. This works fine for a door in a straight wall at any rotation. When I come to a radial wall I can't seem to find any global parameters which will tell me where the door is since it only gives me the angle of the chord of the opening. Thinking I am trying to make this too complex, should I be using something else to get the origin of the door?

 

 

 

    !1 remove rotation of label, labelautorotates to be readable
if (LABEL_ROTANGLE <=90 or LABEL_ROTANGLE >270) then
rot2 -LABEL_ROTANGLE
else
rot2 -LABEL_ROTANGLE + 180
endif
    !2 return to origin
add2 -LABEL_POSITION[1][1], - LABEL_POSITION[1][2]
    !3 move to start of wall position
add2 WALL_POSITION[1], WALL_POSITION[2]
    !4 rotate to wall rotation, note this is the angle of opening chord in the wall between reveals
rot2 WALL_DIRECTION
    !5 move to door position in wall
add2 SYMB_POS_X, 0

 

 

edit, removed symb_pos_Y from last add2, not needed.

Cheers,
Mark
Brisbane, Australia
10 REPLIES 10
Peter Baksa
Graphisoft
Graphisoft

Hi,

WIDO_POSITION is available in the parameter script of doors/windows, you can store it as a parameter, then read that from the label.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
easyDoesIt
Booster

Thanks Peter, I want to read any door library part so I don't have control over what parameters that door has. Any other ideas?

Cheers,
Mark
Brisbane, Australia
Peter Baksa
Graphisoft
Graphisoft

Archicad library has ac_hole_position_angle too.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Thanks for your help on this Peter, just cant seem to work out what I need. See snapshot below, in the straight wall I can determine the origin of the door from within the label, but I just don't seem to have enough information to work door origin for a curved wall as shown in red. Items in black are known. What am I missing?

 

easyDoesIt_0-1679709855846.png

 

Cheers,
Mark
Brisbane, Australia

Anyone able to help on this please.

Cheers,
Mark
Brisbane, Australia
Peter Baksa
Graphisoft
Graphisoft

It looks like we know enough things:

PeterBaksa_2-1680623074199.png

 

The red angle is ac_hole_position_angle in the Archicad Library. It can be read from the label using request("ASSOCLP_PARVALUE")

The green angle is WALL_DIRECTION or better LABEL_ASSOC_ELEM_ORIENTATION.

Marked with green crosshairs is your label's transformations without the last

 

 

add2 SYMB_POS_X, 0

 

 

So we know the start point of the red line, and its orientation (calculated from the green and red angles).

The blue distance is WIDO_ORIG_DIST, the distance from the wall center to the reveal depth. The wall radius could be calculated from this and WIDO_SILL. Probably there are difficulties here with handling the orientation.

Knowing the radius, we get the arc center on the red line, and the midpoint of the opening on the green line.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Thanks Peter for the direction. I got caught up in some other items and have come back to this.

 

I managed to calculate the radius however my problem now is knowing which side the reveal is on. WIDO_REVEAL_SIDE tells me if opposite but there is nothing that tells me the window is placed on the outside or inside edge of the wall. Not an issue for a straight wall but for curved this changes how WIDO_ORIG_DIST relates the inside and outside radius.

easyDoesIt_0-1683699559296.png

 

Cheers,
Mark
Brisbane, Australia

WALL_FLIPPED should help. It is 0 when the outside of the wall is to the left relative to the reference line direction. A curved wall's reference line always goes ccw around the center.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
easyDoesIt
Booster

Hi Peter,

 

WALL_FLIPPED does not seem to change if the reveal side is changed?

 

I need to find out if the reveal is on the outside or inside radius of the curved wall so I can then work backwards from the WIDO_ORIG_DIST of the door and calculate the radius of the wall.

Cheers,
Mark
Brisbane, Australia