We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Making a section marker

Sam Karli
Enthusiast
Hi,
I want to make a custom Section Tool ending sign, but do not know, how to make such an object. A link for a similar thing will be enough.

Thanks in advance.
GDL/Python/C++ dev
16 REPLIES 16
Sam Karli
Enthusiast
Hi, I have another basic problem: I have made custom text for my doors/windows, but the text's rotation is not good.
line2 0, 0.4, 0, -1
define style "Samu Dinamikus" AC_TextFont_1, AC_TextSize_1, 7, 0
style "Samu Dinamikus"
rot2 -90
text2 -0.4, 0, AC_WIDO_A_SIZE*100
text2 -0.4, -AC_TextSize_1*1.5/10, AC_WIDO_B_SIZE*100


I think the problem is that the door text (AC_WIDO_B_SIZE and AC_WIDO_A_SIZE) are aligned to the wall's local coordinate system, and, in this case, if the vector of the wall points form right to left (negative x direction), the text rotation is good, but if the wall's "arrows" point from left to right, aligned to the positive x direction, the door text stands 'upside down'.
Am I able to get the parent wall's direction from a variable somehow to decide the door text's rotation?

Thanks
GDL/Python/C++ dev
Anonymous
Not applicable
The rotation angle of doors/windows and their markers is one of the most mind bending problems I have run into. I still haven't taken the time to sort it out and just put in a parameter (and dynamic hotspots) to let the user fix it.

The angle is some combination of the swing of the door and the direction and angle of the wall (as far as I have determined at this point). I'm hoping to find the time to sort this out so I can make more automatic door tags, but the manual adjustment works for now.
Frank Beister
Moderator
Hello Matthew,

in this case AC helps you very much, because you haven't the total access to the wall and window settings. Paradoxon? No! Because of this the SYMB_ROTANGLE contains the correct orientation of the local coordinate-system to the global. If you would program that inside a window or door you would have to calculate by more parameters than SYMB_ROTANGLE, which would contain just 0 or 180, representing the orientation of the window inside the wall.

So the following script will help you. It has to be used as a wido-marker script. It uses just the first set of font setting- and the AC_readable-parameter. An additional rotation-parameter can be added:
! Parameters:
! ef_PosW, free adjustable Angle of text to wall
! values "ef_PosW" CUSTOM,RANGE [0,360)

! define font style
define style "demo" AC_TextFont_1,AC_TextSize_1,5,AC_TextStyle_1
style "demo"

! reading the window orientation.
! does only work in marker environment
! in this easy way!
textAngle = SYMB_ROTANGLE+ef_PosW : gosub 100

! turn direction if reveal side is changed
if AC_WIDO_REVEAL_SIDE = 1 then
  rot2 180
  textAngle = textAngle + 180 : gosub 100
  endIf

! rotation to individual position and
! correcting for readable text if selected
if textAngle >=90 and textAngle <=270 then
  rot2 ef_PosW+180*AC_readable
  else
  rot2 ef_PosW
  endif
  
! output
text2 0,0,"marker"
end

100:
! keep angle in range 0-360
if textAngle >= 360 then textAngle = textAngle - 360
return
Doing this with labels is similar, but a bit more complicated. AFAIK is there a bug with LABEL_ROTANGLE too, which is fixed in AC9 Hotfix 5 (2219).
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Anonymous
Not applicable
F. wrote:
Hello Matthew,

in this case AC helps you very much, because you haven't the total access to the wall and window settings. Paradoxon? No! Because of this the SYMB_ROTANGLE contains the correct orientation of the local coordinate-system to the global. If you would program that inside a window or door you would have to calculate by more parameters than SYMB_ROTANGLE, which would contain just 0 or 180, representing the orientation of the window inside the wall.
Thanks, I'll give it a try.
Sam Karli
Enthusiast
Thanks to Your huge help, I have managed to make a working window/door text. Parapet height is not included yet.
define style "Samu Dinamikus Jobbos" AC_TextFont_1, AC_TextSize_1, 9, 0
!Right aligned text style
define style "Samu Dinamikus Balos" AC_TextFont_1, AC_TextSize_1, 7, 0
!Left aligned text style
Samuajtjel_jobbos = true
!If true, text is aligned to right

if AC_WIDO_REVEAL_SIDE = 0 then
line2 0, -1-AC_WALL_THICKNESS, 0, .5
else
Samuajtjel_jobbos = not ( Samuajtjel_jobbos )
line2 0, 1, 0, -.5-AC_WALL_THICKNESS
add2 0, -AC_WALL_THICKNESS
endif

if SYMB_ROTANGLE>45 and SYMB_ROTANGLE<225 then
rot2 -90

else
rot2 90
Samuajtjel_jobbos = not ( Samuajtjel_jobbos )
endif

if Samuajtjel_jobbos = true then
style "Samu Dinamikus Jobbos"
else
style "Samu Dinamikus Balos"
endif

text2 0, 0, AC_WIDO_A_SIZE*100
text2 0, -AC_TextSize_1*1.5/10, AC_WIDO_B_SIZE*100
(As You can see, I have simplified Mr. Beister's original idea, text is not rotateable and angles can be over 360 degree.)

One (and the last main) problem to solve is decide whether this is a window or a door, since the for the window we have to define the height of the parapet (the wall under the window).

My next question is how to modify (or is it possible) an existing window easily. Because I want to use built in or readily got windows, for example, but I also want to see my 2D drawings. So the 3D, and other difficult stuffs (database connectivity, etc) must be the same as a well workjing window or door, but the 2D symbol has to be mine (not only the text, but the window drawing, too).

Is it difficult?

Many thanks
GDL/Python/C++ dev
David Maudlin
Rockstar
Sam wrote:
One (and the last main) problem to solve is decide whether this is a window or a door, since the for the window we have to define the height of the parapet (the wall under the window).

My next question is how to modify (or is it possible) an existing window easily. Because I want to use built in or readily got windows, for example, but I also want to see my 2D drawings. So the 3D, and other difficult stuffs (database connectivity, etc) must be the same as a well workjing window or door, but the 2D symbol has to be mine (not only the text, but the window drawing, too).

Is it difficult?
Sam:

If I follow your question, the subtype of the text symbol you created could be changed to "Window-Door Marker". This would make it available as a Dimension Marker for any door and/or window, but the symbol part of the door and/or window would be from the original door and/or window. One advantage of this is that the Window-Door marker's visibility is a Display Option, so the text part can be turned on or off via Display Options for different plan types. Do you want the text always visible?

Creating your own 2D symbol for the existing doors and windows is more complicated, as these parts already have their own 2D Scripts. As a minimum, you would need to open each door and window and disable all or part of their 2D Scripts, then add your own, either in each part, or via a macro call (to a new macro, or perhaps part of the script you have written for the door/window symbol that contains the your text). The parts that come with ArchiCAD are complex, and understanding the code is not a simple process. If you are interested in modifying a few doors and windows (and hopefully their 2D Scripts are similar) this might not be too bad, but to go through all of them will take some time.

HTH

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
Sam Karli
Enthusiast
Hi, I made a temporary sollution for the first problem to make it fully understandable. In this script, if the Parapet height, AC_GLOB_ELEVATION is 0, the user has to set the SAMU_PARAPET_KELL variable to true to see the parapet height.
define style "Samu Dinamikus Jobbos" AC_TextFont_1, AC_TextSize_1, 9, 0
define style "Samu Dinamikus Balos" AC_TextFont_1, AC_TextSize_1, 7, 0
define style "Samu Dinamikus Közepes" AC_TextFont_1, AC_TextSize_1, 8, 0
Samuajtjel_jobbos = true

if AC_WIDO_REVEAL_SIDE = 0 then
line2 0, -1-AC_WALL_THICKNESS, 0, .5
else
Samuajtjel_jobbos = not ( Samuajtjel_jobbos )
line2 0, 1, 0, -.5-AC_WALL_THICKNESS
add2 0, -AC_WALL_THICKNESS
endif

if SYMB_ROTANGLE>45 and SYMB_ROTANGLE<225 then
rot2 -90
else
rot2 90
Samuajtjel_jobbos = not ( Samuajtjel_jobbos )
endif

if Samuajtjel_jobbos = true then
style "Samu Dinamikus Jobbos"
else
style "Samu Dinamikus Balos"
endif

text2 0, 0, AC_WIDO_A_SIZE*100
text2 0, -AC_TextSize_1*1.5/10, AC_WIDO_B_SIZE*100

if (AC_GLOB_ELEVATION <> 0) or SAMU_PARAPET_KELL = 1 then

if (SYMB_ROTANGLE>45 and SYMB_ROTANGLE<=90) or (SYMB_ROTANGLE>=225 and SYMB_ROTANGLE<270) then
rot2 90
else
rot2 -90
endif

style "Samu Dinamikus Közepes"

if (SYMB_ROTANGLE>90 and SYMB_ROTANGLE<270 and AC_WIDO_REVEAL_SIDE = 1) or ((SYMB_ROTANGLE<=90 or SYMB_ROTANGLE>270) and AC_WIDO_REVEAL_SIDE = 0) then
text2 0, -AC_WALL_THICKNESS-.3, SAMU_PARAPET + str (AC_GLOB_ELEVATION,3,0)
else
text2 0, AC_WALL_THICKNESS, SAMU_PARAPET + str (AC_GLOB_ELEVATION,3,0)
endif

endif
Another, quite absurd problem, that the Archicad puts the door markers to the wrong side of the door, the SE 2006 symbols put them to the reveal side of the door, which is the 'inner' side. In Hungary, we put them to the 'outer' side. It is not a problem, but the windows have the opposite direction. If I optmimize my script to a door, it will be bad for a window, and vice versa. Do You have the same problem?
GDL/Python/C++ dev