-
Notifications
You must be signed in to change notification settings - Fork 0
/
bim_auto_creo.py
74 lines (53 loc) · 1.66 KB
/
bim_auto_creo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import bim_auto_base as bim
# 被按住的鼠标键(左键LEFT、右键RIGHT、中键滚轮MIDDLE)
middle = bim.MouseKey.MIDDLE
ctrl = bim.KeyboardKey.CTRL
def key_down():
bim.left_corner_click()
bim.center_pos_click()
bim.key_press(ctrl)
bim.mouse_press(middle)
def key_release():
bim.key_release(ctrl)
bim.mouse_release(middle)
def hot_key_down():
bim.left_corner_click()
bim.center_pos_click()
bim.mouse_press(middle)
def hot_key_release():
bim.mouse_release(middle)
def mouse_rotate():
"""鼠标按住后花圈"""
hot_key_down()
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.CIRCLE)
hot_key_release()
def mouse_scroll_right_left():
"""鼠标按住向右拖动"""
hot_key_down()
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.HOR_SCROLL_RIGHT)
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.HOR_SCROLL_LEFT)
hot_key_release()
def mouse_scroll_down_up():
"""鼠标按住后向下拖动"""
hot_key_down()
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.VER_SCROLL_DOWN)
bim.mouse_scroll_and_drag(scroll_type=bim.ScrollType.VER_SCROLL_UP)
hot_key_release()
def zoom_in_out():
"""鼠标滚轮缩放"""
bim.center_pos_click()
key_down()
bim.mouse_scroll_up()
bim.mouse_scroll_down()
bim.mouse_scroll_down()
bim.mouse_scroll_up()
key_release()
# bim.mouse_zoom()
def test_run():
mouse_rotate()
mouse_scroll_right_left()
mouse_scroll_down_up()
# zoom_in_out()
if __name__ == '__main__':
for i in range(200):
test_run()