Codesammlung

Zuletzt geändert: 1. Juli 2021
Du bist hier:
Geschätzte Lesezeit: 1 min

– Etikett auf Ursprung setzen

add2 LABEL_POSITION[2][1] + LABEL_POSITION[3][1],
     LABEL_POSITION[2][2] + LABEL_POSITION[3][2]

– Rotation Undo Routine für Fenster

Fenster Rotations-Routine (JS): 2D + 3D, um sämtliche Drehungen, Spiegelungen und Verschiebungen zu neutralisieren:
a) 2D

! ---------------------------------------------------------------------- !
! ---------------------------------------------------------------------- !

! ----- 2016 b-prisma R O T A T I O N   U N D O   R O U T I N E -------- !

!	TEXT2 0,0,SYMB_MIRRORED != V~
!	TEXT2 0,-0.2,WIDO_REVEAL_SIDE != E~
!	TEXT2 0,-0.4,SYMB_ROTANGLE != W~
!	TEXT2 0,0.2, W~

    bRotated = round_int (SYMB_ROTANGLE) = 180

	IF NOT(SYMB_MIRRORED) AND NOT(WIDO_REVEAL_SIDE) AND NOT(bRotated) THEN		! 0, 0, 0
		ADD2 0, 0
		MUL2 1, 1	
	ENDIF

	IF SYMB_MIRRORED AND NOT(WIDO_REVEAL_SIDE) AND NOT(bRotated) THEN		! 1, 0, 0
		ADD2 0, 0
		MUL2 1, 1	! K A N N   M A N   S P I E G E L N
	ENDIF

	IF NOT(SYMB_MIRRORED) AND NOT(WIDO_REVEAL_SIDE) AND bRotated THEN		! 0, 0, 1
		MUL2 -1, -1
		ADD2 0,  - ac_wido_sill * 2 + C_
	ENDIF

	IF SYMB_MIRRORED AND WIDO_REVEAL_SIDE AND bRotated THEN					! 1, 1, 1
		MUL2 -1, -1
		ADD2 0, gs_frame_thk
	ENDIF

	IF SYMB_MIRRORED AND WIDO_REVEAL_SIDE AND NOT(bRotated) THEN			! 1, 1, 0
		ADD2 0, - ac_wido_sill * 2 + C_ - gs_frame_thk
		MUL2 1, 1
	ENDIF

	IF SYMB_MIRRORED AND NOT(WIDO_REVEAL_SIDE) AND bRotated THEN			! 1, 0, 1
		MUL2 -1, -1
		ADD2 0, - ac_wido_sill * 2 + C_ 
	ENDIF

	IF NOT(SYMB_MIRRORED) AND WIDO_REVEAL_SIDE AND NOT(bRotated) THEN		! 0, 1, 0
		ADD2 0, - ac_wido_sill * 2 + C_ - gs_frame_thk
		MUL2 1, 1
	ENDIF

	IF NOT(SYMB_MIRRORED) AND WIDO_REVEAL_SIDE AND bRotated THEN			! 0, 1, 1
		MUL2 -1, -1
		ADD2 0,  gs_frame_thk
	ENDIF

  ! ............

DEL 2

! ---------------------------------------------------------------------- !
! ---------------------------------------------------------------------- !

b) 3D

! ---------------------------------------------------------------------- !
! ---------------------------------------------------------------------- !

! ----- 2016 b-prisma R O T A T I O N   U N D O   R O U T I N E -------- !

    bRotated = round_int (SYMB_ROTANGLE) = 180

	IF NOT(SYMB_MIRRORED) AND NOT(WIDO_REVEAL_SIDE) AND NOT(bRotated) THEN		! 0, 0, 0
		ADDz 0
		MULz 1
	ENDIF

	IF SYMB_MIRRORED AND NOT(WIDO_REVEAL_SIDE) AND NOT(bRotated) THEN		! 1, 0, 0
		ADDz 0
		MULz 1		! K A N N   M A N   S P I E G E L N
	ENDIF

	IF NOT(SYMB_MIRRORED) AND NOT(WIDO_REVEAL_SIDE) AND bRotated THEN		! 0, 0, 1
		MUL -1, 1,  -1
		ADDz  ac_wido_sill * 2 - C_
	ENDIF

	IF SYMB_MIRRORED AND WIDO_REVEAL_SIDE AND bRotated THEN					! 1, 1, 1
		MUL -1, 1,  -1
		ADDz - gs_frame_thk
	ENDIF

	IF SYMB_MIRRORED AND WIDO_REVEAL_SIDE AND NOT(bRotated) THEN			! 1, 1, 0
		ADDz  ac_wido_sill * 2 - C_ + gs_frame_thk
		MULz 1
	ENDIF

	IF SYMB_MIRRORED AND NOT(WIDO_REVEAL_SIDE) AND bRotated THEN			! 1, 0, 1
		MUL -1, 1,  -1
		ADDz  ac_wido_sill * 2 - C_ 
	ENDIF

	IF NOT(SYMB_MIRRORED) AND WIDO_REVEAL_SIDE AND NOT(bRotated) THEN		! 0, 1, 0
		ADDz ac_wido_sill * 2 - C_ + gs_frame_thk
		MULz 1
	ENDIF

	IF NOT(SYMB_MIRRORED) AND WIDO_REVEAL_SIDE AND bRotated THEN			! 0, 1, 1
		MUL -1, 1,  -1
		ADDz - gs_frame_thk
	ENDIF

  ! ............

DEL 2

! ---------------------------------------------------------------------- !
! ---------------------------------------------------------------------- !

String-Funktion zur realen Abbildung einer Zahl

str{2}("%~^1m", var)

Diese Funktion hat mir Péter Baksa von Graphisoft empfohlen, um unterschiedlich formatierte Zahlen immer genau so als String auszugeben, wie sie tatsächlich formatiert sind. Z.B. 1.1 als „1.1“ und 1.204 als „1.204“ und nicht „1.100“ und „1.204“ bzw. „1.1“ und „1.2“

War dieser Artikel hilfreich?
Mag ich nicht 0 0 of 0 fanden diesen Artikel hilfreich.
Anzahl Aufrufe: 72

Schreibe einen Kommentar

Close Menu