'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright by Weinmann Holzbausystemtechnik GmbH (c) 2005
'
' Filename:                Makro_5.WMK
'
' Description:        Bau Vila Makrodefinition, Makro 5
'
' Author:                Mikan
'
' Date:                        20050503
'
' Version:                V0.01
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

const MACROTITLE = "Macro"

SUB MAIN

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
DIM sIni
DIM F_Title
DIM BALKEN_WIDTH
DIM BALKEN_HEIGHT
DIM PAF_RADIUS
DIM EBENE
DIM AUSFAHRT
DIM PP_INDEX1
DIM PP_INDEX2
DIM PP_ALPHA
DIM PP_Z
DIM KB_TYPE

'INITIALISIERUNG DER KONSTANTEN
EBENE = 2        'Bezugsebene
AUSFAHRT = 50    '50 mm ausfahren
PP_INDEX1 = 211  'PP1-Werkzeugkorrektur - vielleicht abfragen
PP_INDEX2 = 111  'PP2-Werkzeugkorrektur - vielleicht abfragen
PP_ALPHA = 0     'PP-Winkel Alpha
PP_Z = 0         'PP-Z-Koordinate
KB_TYPE = "Acc"  'PP-Kreisbogen Typ


'Holen Parameterbezeichnungen abhaengig von der Landessprache
sIni = "BV_l" + GETACTUALLANGUAGE() + ".ini"

' ==========================================================================

	IF NOT FINDFIRSTSELECTED THEN
		DIM BEAMCOUNTER

		BEAMCOUNTER = GETCOUNTTYPE(CalcType("LS"))
		BEAMCOUNTER = BEAMCOUNTER + GETCOUNTTYPE(CalcType("QS"))
		BEAMCOUNTER = BEAMCOUNTER + GETCOUNTTYPE(CalcType("BT4"))
		BEAMCOUNTER = BEAMCOUNTER + GETCOUNTTYPE(CalcType("BT6"))

		IF BEAMCOUNTER = 1 THEN
			IF GETCOUNTTYPE(CalcType("LS")) = 1 THEN
				FINDFIRSTTYPE(CalcType("LS"))
			END IF
			IF GETCOUNTTYPE(CalcType("QS")) = 1 THEN
				FINDFIRSTTYPE(CalcType("QS"))
			END IF
			IF GETCOUNTTYPE(CalcType("BT4")) = 1 THEN
				FINDFIRSTTYPE(CalcType("BT4"))
			END IF
			IF GETCOUNTTYPE(CalcType("BT6")) = 1 THEN
				FINDFIRSTTYPE(CalcType("BT6"))
			END IF
		ELSE
		  MsgBox GETPRIVATEPROFILESTRING("Fehler", "F1", " ", sIni),vbOkOnly+vbCritical+vbSystemModal,MACROTITLE
		  exit sub
		END IF
	END IF

	IF NOT (ISBEAM OR (ISBEAMPROCESSING AND SELECTPARENTBEAM())) THEN
	  MsgBox GETPRIVATEPROFILESTRING("Fehler", "F2", " ", sIni),vbOkOnly+vbCritical+vbSystemModal,MACROTITLE
	  exit sub
	END IF

' ==========================================================================

BALKEN_WIDTH = GETPARAM(2)
BALKEN_HEIGHT = GETPARAM(3)     'auch Tiefe der PAF
PAF_RADIUS = BALKEN_WIDTH/2     'Radius

REM 1.PAF
PAF EBENE
PP  PAF_RADIUS, BALKEN_WIDTH+AUSFAHRT, -BALKEN_HEIGHT, PP_INDEX1, PP_ALPHA, PP_Z
PP  PAF_RADIUS, BALKEN_WIDTH, -BALKEN_HEIGHT, PP_INDEX1, PP_ALPHA, PP_Z
KB  0, PAF_RADIUS, PAF_RADIUS, KB_TYPE, -BALKEN_HEIGHT, PP_INDEX1, PP_ALPHA, PP_Z
'PP  -AUSFAHRT, PAF_RADIUS, -BALKEN_HEIGHT, PP_INDEX1, PP_ALPHA, PP_Z
PP  0, 0, -BALKEN_HEIGHT, PP_INDEX1, PP_ALPHA, PP_Z


REM 2. PAF
KB_TYPE = "Acw"
PAF EBENE
PP  PAF_RADIUS, -AUSFAHRT, -BALKEN_HEIGHT, PP_INDEX2, PP_ALPHA, PP_Z
PP  PAF_RADIUS, 0, -BALKEN_HEIGHT, PP_INDEX2, PP_ALPHA, PP_Z
KB  0, PAF_RADIUS, PAF_RADIUS, KB_TYPE, -BALKEN_HEIGHT, PP_INDEX2, PP_ALPHA, PP_Z
'PP  -AUSFAHRT, PAF_RADIUS, -BALKEN_HEIGHT, PP_INDEX2, PP_ALPHA, PP_Z
PP  0, BALKEN_WIDTH, -BALKEN_HEIGHT, PP_INDEX2, PP_ALPHA, PP_Z


END SUB
MAIN