# By Axelerator AB All rights reserved
# Author Marcus Isaksson
from varmain .primitiv import *#line:6
from varmain .custom import *#line:7
from varmain .var_basic import *#line:8
from varmain .dummy_var import *#line:9
from aqa .math import *#line:10
import math #line:11
import sys ,os #line:12
if not os .path .dirname (os .path .abspath (__file__ ))in sys .path :#line:18
			   sys .path .append (os .path .dirname (os .path .abspath (__file__ )))#line:19
from AX_BOXF import *#line:22
from AX_HANDLEVERS import *#line:23
from AX_P1_45_WALL_BRACKET import *#line:25
from AX_P1_45_WALL_BRACKET_2_PORT import *#line:26
from AX_P1_45_WALL_BRACKET_3_PORT import *#line:27
from AX_P1_45_WALL_BRACKET_BALLVALVE import *#line:28
from AX_P1_45_WALL_BRACKET_BALLVALVE_2_PORT import *#line:29
from AX_P1_45_WALL_BRACKET_BALLVALVE_3_PORT import *#line:30
from AX_P1_BRACKET import *#line:31
from AX_P1_BRACKET_BALLVALVE import *#line:32
from AX_P1_BRACKET_FTH import *#line:33
from AX_P1_COUPLING import *#line:34
from AX_P1_ELBOW_45 import *#line:35
from AX_P1_ELBOW_90 import *#line:36
from AX_P1_ELBOW_90_STUD import *#line:37
from AX_P1_END_CAP import *#line:38
from AX_P1_EQUAL_CROSS import *#line:39
from AX_P1_EQUAL_TEE import *#line:40
from AX_P1_EQUAL_Y import *#line:41
from AX_P1_FIXING_CLIP import *#line:42
from AX_P1_FRL_6700 import *#line:43
from AX_P1_FRL_6701 import *#line:44
from AX_P1_FRL_6702 import *#line:45
from AX_P1_FRL_6703 import *#line:46
from AX_P1_FRL_6708 import *#line:47
from AX_P1_LOCKABLE_BUTTERFLY_VALVE import *#line:48
from AX_P1_LOCKABLE_D_BALL_VALVE import *#line:49
from AX_P1_MALE_STUD_FITTING import *#line:50
from AX_P1_MALE_TH_ADAPTOR import *#line:51
from AX_P1_MALE_TH_NUT import *#line:52
from AX_P1_MINI_BALLVALVE import *#line:53
from AX_P1_PLUG_IN_REDUCER import *#line:54
from AX_P1_QA_BRACKET import *#line:55
from AX_P1_QA_DFB_FEMALE import *#line:56
from AX_P1_REDUCER_Y import *#line:57
from AX_P1_REDUCING_TEE import *#line:58
from AX_P1_SIMPLE_BRACKET_76 import *#line:59
@activate (Group ="ValveBody",TooltipShort ="LOCKABLE BUTTERFLY VALVE",TooltipLong ="LOCKABLE BUTTERFLY VALVE",LengthUnit ="mm",Ports ="2")#line:61
@group ("MainDimensions")#line:62
@param (DN =LENGTH ,TooltipShort ="Nominal Diameter",TooltipLong ="Nominal Diameter")#line:63
@param (AA =LENGTH ,TooltipShort ="Rotation Angle",TooltipLong ="Rotation Angle")#line:64
def AX_P1_LOCKABLE_BUTTERFLY_VALVE (OO00O00000OOO0000 ,DN =65 ,AA =0 ,**O0O0O00O0OO0OO00O ):#line:69
	if DN ==65 :#line:71
		O0OO0O0000O000000 =63.0 #line:72
		OO00000O00OOOO0O0 =102.0 #line:73
		OO0OO0OOOO000OO00 =145.0 #line:74
		O00O00O0OOO00O0OO =18.0 #line:75
		O0O0OOO00OO0O000O =170.0 #line:76
		O0OOOO0OO0O0O0O0O =186.0 #line:77
		O0O0OOO0O000O0O00 =69.0 #line:78
		O00OO0O00O000000O =46.0 #line:79
	elif DN ==80 :#line:80
		O0OO0O0000O000000 =76.0 #line:81
		OO00000O00OOOO0O0 =118.0 #line:82
		OO0OO0OOOO000OO00 =160.0 #line:83
		O00O00O0OOO00O0OO =18.0 #line:84
		O0O0OOO00OO0O000O =206.0 #line:85
		O0OOOO0OO0O0O0O0O =219.0 #line:86
		O0O0OOO0O000O0O00 =90.0 #line:87
		O00OO0O00O000000O =46.0 #line:88
	elif DN ==100 :#line:89
		O0OO0O0000O000000 =100.0 #line:90
		OO00000O00OOOO0O0 =150.0 #line:91
		OO0OO0OOOO000OO00 =180.0 #line:92
		O00O00O0OOO00O0OO =18.0 #line:93
		O0O0OOO00OO0O000O =206.0 #line:94
		O0OOOO0OO0O0O0O0O =239.0 #line:95
		O0O0OOO0O000O0O00 =106.0 #line:96
		O00OO0O00O000000O =52.0 #line:97
	elif DN ==150 :#line:98
		O0OO0O0000O000000 =168.0 #line:99
		OO00000O00OOOO0O0 =205.0 #line:100
		OO0OO0OOOO000OO00 =240.0 #line:101
		O00O00O0OOO00O0OO =23.0 #line:102
		O0O0OOO00OO0O000O =285.0 #line:103
		O0OOOO0OO0O0O0O0O =290.0 #line:104
		O0O0OOO0O000O0O00 =131.0 #line:105
		O00OO0O00O000000O =56.0 #line:106
	O0OO0OOO000OO0O0O =O00OO0O00O000000O *0.80 #line:108
	O0000OO00OO000000 =O0OOOO0OO0O0O0O0O *0.80 #line:109
	OOO0OO0000O0000OO =O0OOOO0OO0O0O0O0O *0.20 #line:110
	OO000O000OO00OO00 =CYLINDER (OO00O00000OOO0000 ,R =OO00000O00OOOO0O0 /2.0 ,H =O00OO0O00O000000O ).rotateY (90 ).translate ((-O00OO0O00O000000O /2.0 ,0 ,0 ))#line:112
	OOO00OOOOO000OO00 =CYLINDER (OO00O00000OOO0000 ,R =O0OO0OOO000OO0O0O /2.0 ,H =O0000OO00OO000000 *0.90 )#line:113
	OOOOO000OO0000O00 =CYLINDER (OO00O00000OOO0000 ,R =O00OO0O00O000000O /2.0 ,H =O0000OO00OO000000 *0.05 ).translate ((0 ,0 ,O0000OO00OO000000 *0.90 ))#line:114
	O0OO00000O00OO00O =CYLINDER (OO00O00000OOO0000 ,R =O00OO0O00O000000O /1.8 ,H =O0000OO00OO000000 *0.05 ).translate ((0 ,0 ,O0000OO00OO000000 *0.95 ))#line:115
	OO0O0O0O0O0O00000 =(OO0OO0OOOO000OO00 /2.0 )+O00O00O0OOO00O0OO #line:117
	O0O000OOOOO0O0O00 =AX_BOXF (OO00O00000OOO0000 ,W =O00O00O0OOO00O0OO *3.5 ,L =OO0O0O0O0O0O00000 *2.0 ,H =O00OO0O00O000000O *0.20 ,R =(O00O00O0OOO00O0OO *3.5 )/2.5 ,T =4 ).rotateY (90 ).rotateX (90 ).translate ((-(O00OO0O00O000000O *0.20 )/2.0 ,0 ,0 )).rotateX (40 )#line:119
	OOOOO0O0OO00O0O00 =AX_BOXF (OO00O00000OOO0000 ,W =O00O00O0OOO00O0OO *3.5 ,L =OO0O0O0O0O0O00000 *2.0 ,H =O00OO0O00O000000O *0.20 ,R =(O00O00O0OOO00O0OO *3.5 )/2.5 ,T =4 ).rotateY (90 ).rotateX (90 ).translate ((-(O00OO0O00O000000O *0.20 )/2.0 ,0 ,0 )).rotateX (-40 )#line:120
	OO0OO0000O0OO0O00 =AX_BOXF (OO00O00000OOO0000 ,W =OO00000O00OOOO0O0 *0.85 ,L =OO0O0O0O0O0O00000 *1.5 ,H =O00OO0O00O000000O *0.20 ,R =20 ,T =4 ).rotateY (90 ).rotateX (90 ).translate ((-(O00OO0O00O000000O *0.20 )/2.0 ,0 ,0 ))#line:121
	OO0000O0000O0O0O0 =CYLINDER (OO00O00000OOO0000 ,R =O0OO0OOO000OO0O0O /2.0 ,H =(OO0O0O0O0O0O00000 *1.5 )/2.0 ).rotateX (180 )#line:122
	for OOOOO000O0OO0O00O in [OOO00OOOOO000OO00 ,OOOOO000OO0000O00 ,O0OO00000O00OO00O ,O0O000OOOOO0O0O00 ,OOOOO0O0OO00O0O00 ,OO0OO0000O0OO0O00 ,OO0000O0000O0O0O0 ]:#line:125
		OO000O000OO00OO00 .uniteWith (OOOOO000O0OO0O00O )#line:126
		OOOOO000O0OO0O00O .erase ()#line:127
	OOOOOO00O00OOOO0O =[(40 ,20 ),(-40 ,20 ),(140 ,20 ),(220 ,20 )]#line:132
	for O000OOO0OOO0OOOO0 ,OOO0O0000O00O0O00 in OOOOOO00O00OOOO0O :#line:134
		OO0O000000O00O0OO =O000OOO0OOO0OOOO0 -(OOO0O0000O00O0O00 /2 )#line:135
		OOO0OOOOO0O0000O0 =O000OOO0OOO0OOOO0 +(OOO0O0000O00O0O00 /2 )#line:136
		for O0O00OOO0OO00000O in [OO0O000000O00O0OO ,OOO0OOOOO0O0000O0 ]:#line:138
			OOO0000000O0O0000 =CYLINDER (OO00O00000OOO0000 ,R =O00O00O0OOO00O0OO /2.0 ,H =O00OO0O00O000000O ).rotateY (90 ).translate ((-O00OO0O00O000000O /2.0 ,0 ,OO0OO0OOOO000OO00 /2.0 )).rotateX (O0O00OOO0OO00000O )#line:140
			OO000O000OO00OO00 .subtractFrom (OOO0000000O0O0000 )#line:141
			OOO0000000O0O0000 .erase ()#line:142
	OOOO000OOOO00OO00 =CYLINDER (OO00O00000OOO0000 ,R =O0OO0O0000O000000 /2.0 ,H =O00OO0O00O000000O ).rotateY (90 ).translate ((-O00OO0O00O000000O /2.0 ,0 ,0 ))#line:145
	OO000O000OO00OO00 .subtractFrom (OOOO000OOOO00OO00 )#line:146
	OOOO000OOOO00OO00 .erase ()#line:147
	OO0OO0OO0OOO0OOO0 =AX_HANDLEVERS (OO00O00000OOO0000 ,W =O00OO0O00O000000O *0.60 ,LE =O0O0OOO00OO0O000O ,TH =OOO0OO0000O0000OO *0.40 ,HT =OOO0OO0000O0000OO ,T =1.0 ).rotateZ (90 ).translate ((0 ,0 ,O0000OO00OO000000 ))#line:150
	O0000O0OOOO0O0O00 =CYLINDER (OO00O00000OOO0000 ,R =(O0OO0OOO000OO0O0O /2.0 )*0.50 ,H =OOO0OO0000O0000OO *2.0 ).translate ((0 ,0 ,O0000OO00OO000000 +OOO0OO0000O0000OO *0.40 ))#line:151
	OO0OO0OO0OOO0OOO0 .subtractFrom (O0000O0OOOO0O0O00 )#line:152
	O0000O0OOOO0O0O00 .erase ()#line:153
	OOOOOOO0000OO0000 =AX_BOXF (OO00O00000OOO0000 ,W =O00OO0O00O000000O *0.40 ,L =O0O0OOO00OO0O000O *0.80 ,H =OOO0OO0000O0000OO *0.30 ,R =2 ,T =12 ).translate ((0 ,(O0O0OOO00OO0O000O *0.80 )/2.0 ,O0000OO00OO000000 ))#line:154
	OO0OO0OO0OOO0OOO0 .uniteWith (OOOOOOO0000OO0000 )#line:155
	OOOOOOO0000OO0000 .erase ()#line:156
	OO0OO0OO0OOO0OOO0 .rotateZ (AA )#line:157
	O0000OOOOOOO0O00O =CYLINDER (OO00O00000OOO0000 ,R =O0OO0O0000O000000 /2.0 ,H =O00OO0O00O000000O *0.30 ).rotateY (90 ).translate ((-(O00OO0O00O000000O *0.30 )/2.0 ,0 ,0 ))#line:161
	OOO0OOOOO0000000O =CYLINDER (OO00O00000OOO0000 ,R =(O00OO0O00O000000O *0.40 )/2.0 ,H =OO00000O00OOOO0O0 ).translate ((0 ,0 ,-OO00000O00OOOO0O0 /2.0 ))#line:162
	O0000OOOOOOO0O00O .uniteWith (OOO0OOOOO0000000O )#line:163
	OOO0OOOOO0000000O .erase ()#line:164
	O0000OOOOOOO0O00O .rotateZ (AA )#line:165
	OO00O00000OOO0000 .setPoint ((O00OO0O00O000000O /2.0 ,0 ,0 ),(1 ,0 ,0 ))#line:181
	OO00O00000OOO0000 .setPoint ((-O00OO0O00O000000O /2.0 ,0 ,0 ),(-1 ,0 ,0 ))#line:182
