-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy path__init__.pyi
More file actions
1103 lines (709 loc) · 22.5 KB
/
__init__.pyi
File metadata and controls
1103 lines (709 loc) · 22.5 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from typing import List
from typing import Tuple
from cadwork.api_types import ElementId
from cadwork.point_3d import point_3d
from cadwork.window_geometry import window_geometry
from cadwork.shortcut_key import shortcut_key
from cadwork.shortcut_key_modifier import shortcut_key_modifier
def get_3d_version() -> int:
"""Gets the 3D version.
Returns:
The 3D version.
"""
def get_3d_build() -> int:
"""Gets the 3D build.
Returns:
The 3D build.
"""
def get_3d_file_path() -> str:
"""Gets the 3D file path.
Returns:
The 3D file path.
"""
def set_project_data(project_data_id: str, data: str) -> None:
"""Sets the project data.
Parameters:
project_data_id: The project data id.
data: The data to set.
"""
def print_error(message: str) -> None:
"""Prints an error to the bottom toolbar of Cadwork 3d.
Notes:
Attention, this function is blocking. User will need to click to
continue the process.
Parameters:
message: The error message.
"""
def get_language() -> str:
"""Gets the 3D language.
Returns:
The language.
"""
def print_message(message: str, row: int, column: int) -> None:
"""Prints a message that will be visualized in the bottom toolbar of the
3D view. You can arrange the message in the desired position by specifying the row and column.
Examples:
>>> import utility_controller as uc
>>> uc.print_message("Hello World!", 1, 1)
Parameters:
message: The message to print.
row: The row to print the message in.
column: The column to print the message in.
"""
def get_user_int(message: str) -> int:
"""Prompts the user for an integer.
Parameters:
message: The message to display.
Returns:
The user input integer.
"""
def get_user_double(message: str) -> float:
"""Prompts the user for a double.
Parameters:
message: The message to display.
Returns:
The user input double.
"""
def get_user_bool(message: str, default_yes: bool) -> bool:
"""Prompts the user for a boolean.
Parameters:
message: The message to display.
default_yes: The default value, True by default.
Returns:
The user input boolean.
"""
def get_user_string(message: str) -> str:
"""Prompts the user for a string.
Parameters:
message: The message to display.
Returns:
The user input string.
"""
def set_project_name(project_name: str) -> None:
"""Sets the project name.
Parameters:
project_name: The project name.
"""
def set_project_number(project_number: str) -> None:
"""Sets the project number.
Parameters:
project_number: The project number.
"""
def set_project_part(project_part: str) -> None:
"""Sets the project part.
Parameters:
project_part: The project part.
"""
def set_project_architect(project_architect: str) -> None:
"""Sets the project architect.
Parameters:
project_architect: The project architect.
"""
def set_project_customer(project_customer: str) -> None:
"""Sets the project customer.
Parameters:
project_customer: The project customer.
"""
def set_project_designer(project_designer: str) -> None:
"""Sets the project designer.
Parameters:
project_designer: The project designer.
"""
def set_project_deadline(project_deadline: str) -> None:
"""Sets the project deadline.
Parameters:
project_deadline: The project deadline.
"""
def set_project_user_attribute(number: int, user_attribute: str) -> None:
"""Sets the project user attribute.
Parameters:
number: The project user attribute number.
user_attribute: The project user attribute.
"""
def set_project_user_attribute_name(number: int, user_attribute_name: str) -> None:
"""Sets the project user attribute name.
Parameters:
number: The project user attribute number.
user_attribute_name: The project user attribute name.
"""
def set_project_latitude(latitude: float) -> None:
"""Sets the project latitude.
Parameters:
latitude: The project latitude.
"""
def set_project_longitude(longitude: float) -> None:
"""Sets the project longitude.
Parameters:
longitude: The project longitude.
"""
def set_project_address(address: str) -> None:
"""Sets the project address.
Parameters:
address: The project address.
"""
def set_project_postal_code(postal_code: str) -> None:
"""Sets the project postal code.
Parameters:
postal_code: The project postal code.
"""
def set_project_city(city: str) -> None:
"""Sets the project city.
Parameters:
city: The project city.
"""
def set_project_country(country: str) -> None:
"""Sets the project country.
Parameters:
country: The project country.
"""
def get_user_file_from_dialog(name_filter: str) -> str:
"""Gets a file with a dialog.
Parameters:
name_filter: The dialog file filter.
Returns:
The file path.
"""
def get_client_number() -> str:
"""Gets the client number.
Returns:
The client number.
"""
def get_user_point() -> point_3d:
"""Gets a point from the user.
Returns:
The user point.
"""
def disable_auto_display_refresh() -> None:
"""Disables automatic display refresh.
This function prevents the display from updating automatically,
which can significantly improve performance during operations that involve multiple changes or computations.
The display will remain static until explicitly refreshed by the user.
"""
def enable_auto_display_refresh() -> None:
"""Enables automatic display refresh.
This function restores the default behavior where the display updates automatically after each operation.
Use this function to resume normal display updates after previously disabling them with disable_auto_display_refresh().
It's recommended to call this function after completing operations that required disabled display refreshing.
Examples:
>>> import cadwork
>>> import utility_controller as uc
>>> import element_controller as ec
>>> uc.disable_auto_display_refresh()
>>> # Perform operations that require disabled display refresh
>>> your_list_of_elements: List[int] = []
>>> uc.enable_auto_display_refresh()
>>> ec.recreate_elements(your_list_of_elements)
Note:
If elements were created while display refresh was disabled, it's important
to recreate these elements after enabling the display refresh to ensure they
are properly visualized in cadwork.
"""
def create_new_guid() -> str:
"""Creates a new GUID.
Returns:
The new GUID.
"""
def print_to_console(message: str) -> None:
"""Prints a message to the Cadwork debug console.
Parameters:
message: The message.
"""
def export_screen_to_image(file_path: str, factor: int) -> None:
"""Exports the screen to an image.
Parameters:
file_path: The file path.
factor: The image factor.
"""
def get_new_user_file_from_dialog(name_filter: str) -> str:
"""Gets a new file with a dialog.
Parameters:
name_filter: The dialog file filter.
Returns:
The file path.
"""
def api_autostart(api_name: str, option: int) -> int:
"""Sets an API autostart option.
Parameters:
api_name: The name of the API be managed.
option: The autostart option to use.
- -1: Checks if API is configured for autostart without making changes. Returns 1 if API is found, 0 if not, or -1 in case of errors.
- 1: Enables autostart for the specified API.
- 0: Disables autostart for the specified API.
Note:
This function reads and updates alias and module configuration files
to manage the autostart state of the API.
Examples:
>>> api_autostart("my_api", 1) # Enable autostart
>>> api_autostart("my_api", 0) # Disable autostart
>>> api_autostart("my_api", -1) # Check current autostart state
Returns:
The value of option if the operation is successful, or -1 in case of errors.
"""
def enable_autostart(api_name: str) -> None:
"""Enables autostart for a given API.
Parameters:
api_name: The name of the API for which to enable autostart.
"""
def disable_autostart(api_name: str) -> None:
"""Disables autostart for a given API.
Parameters:
api_name: The name of the API for which to disable autostart.
"""
def check_autostart(api_name: str) -> bool:
"""Checks if autostart is enabled for a given API.
Parameters:
api_name: The name of the API to check.
Returns:
True if autostart is enabled, false otherwise.
"""
def delete_project_data(element_id: str) -> None:
"""Deletes the project data.
Parameters:
element_id: The project data id.
"""
def run_external_program(name: str) -> bool:
"""Runs a 3D external program.
Parameters:
name: The external program name.
Returns:
False if the program could not be run, true otherwise.
"""
def save_3d_file_silently() -> None:
"""Saves the 3D file silently.
"""
def get_licence_first_part() -> str:
"""Gets the first part of the licence.
Returns:
The first part of the licence.
"""
def get_licence_second_part() -> str:
"""Gets the second part of the licence.
Returns:
The second part of the licence.
"""
def show_progress_bar() -> None:
"""Shows a ProgressBar in the CommandBar.
"""
def update_progress_bar(value: int) -> None:
"""Updates the ProgressBar with a value.
Parameters:
value: A value between 0 and 100.
"""
def hide_progress_bar() -> None:
"""Hides the ProgressBar.
"""
def get_user_color(initial_color: int) -> int:
"""Gets a color choosen by the user.
Parameters:
initial_color: The initial color.
Returns:
The color number.
"""
def get_3d_linear_units() -> str:
"""Gets the current linear units.
Returns:
The current linear units.
"""
def get_3d_linear_display_units() -> str:
"""Gets the current display units.
Returns:
The current display units.
"""
def get_3d_angular_units() -> str:
"""Gets the current angular units.
Returns:
The current angular units.
"""
def get_3d_angular_display_units() -> str:
"""Gets the current angular display units.
Returns:
The current angular display units.
"""
def get_3d_build_date() -> str:
"""Gets the current build date.
Returns:
The current build date.
"""
def set_project_elevation(elevation: float) -> None:
"""Sets the project elevation.
Parameters:
elevation: The project elevation.
"""
def clear_errors() -> None:
"""Clears all errors.
"""
def push_check_and_query_data() -> None:
"""Pushes the current state of check and query data onto a stack.
"""
def pop_check_and_query_data() -> None:
"""Pops the most recent state of check and query data from the stack.
"""
def change_check_and_query_data_to_no_queries() -> None:
"""Changes the current state of check and query data to no queries.
"""
def change_check_and_query_data_to_queries() -> None:
"""Changes the current state of check and query data to allow queries.
"""
def is_direct_info_enabled() -> bool:
"""Checks if Direct Info is enabled.
Returns:
True if Direct Info is enabled, false otherwise.
"""
def enable_direct_info() -> None:
"""Enables Direct Info.
"""
def disable_direct_info() -> None:
"""Disables Direct Info.
"""
def load_attribute_display_settings(file_path: str) -> None:
"""Loads attribute display settings from a file.
Parameters:
file_path: The path to the file containing the settings.
"""
def set_project_description(description: str) -> None:
"""Sets the project description.
Parameters:
description: The new description for the project.
"""
def start_project_data_dialog() -> None:
"""Starts the project data dialog.
"""
def init_LxSDK() -> None:
"""Initializes the LxSDK.
"""
def load_element_attribute_display_settings(file_path: str, elements: List[ElementId]) -> None:
"""Loads element attribute display settings from a file.
Parameters:
file_path: The path to the file containing the settings.
elements: The element list for which to load the settings.
"""
def get_global_x_offset() -> float:
"""Gets the global X offset.
Returns:
The global X offset.
"""
def set_global_x_offset(offset: float) -> None:
"""Sets the global X offset.
Parameters:
offset: The new global X offset.
"""
def get_global_y_offset() -> float:
"""Gets the global Y offset.
Returns:
The global Y offset.
"""
def set_global_y_offset(offset: float) -> None:
"""Sets the global Y offset.
Parameters:
offset: The new global Y offset.
"""
def get_global_z_offset() -> float:
"""Gets the global Z offset.
Returns:
The global Z offset.
"""
def set_global_z_offset(offset: float) -> None:
"""Sets the global Z offset.
Parameters:
offset: The new global Z offset.
"""
def show_north_arrow() -> None:
"""Shows the north arrow on the 3D view.
"""
def hide_north_arrow() -> None:
"""Hides the north arrow on the 3D view.
"""
def is_north_arrow_visible() -> bool:
"""Checks if the north arrow is visible on the 3D view.
Returns:
True if the north arrow is visible, false otherwise.
"""
def get_north_angle() -> float:
"""Gets the angle of the north direction.
Returns:
The angle of the north direction in degrees.
"""
def set_north_angle(north_angle: float) -> None:
"""Sets the angle of the north direction.
Parameters:
north_angle: The angle of the north direction in degrees.
"""
def get_user_file_from_dialog_in_path(name_filter: str, path: str) -> str:
"""Gets a user file from a dialog in a specified path.
Parameters:
name_filter: The filter for the dialog.
path: The path in which to get the user file.
Returns:
A string containing the user file.
"""
def get_new_user_file_from_dialog_in_path(name_filter: str, path: str) -> str:
"""Gets a new user file from a dialog in a specified path.
Parameters:
name_filter: The filter for the dialog.
path: The path in which to get the new user file.
Returns:
A string containing the new user file.
"""
def enable_update_variant() -> None:
"""Enables the update variant.
"""
def disable_update_variant() -> None:
"""Disables the update variant.
"""
def get_user_points() -> List[point_3d]:
"""Gets user points.
Returns:
A list of user points.
"""
def get_user_points_with_count(count: int) -> List[point_3d]:
"""Gets user points with a specified count.
Parameters:
count: The number of user points to get.
Returns:
A list of user points.
"""
def get_user_path_from_dialog() -> str:
"""Gets the user path from a dialog.
Returns:
A string containing the user path.
"""
def get_user_path_from_dialog_in_path(path: str) -> str:
"""Gets the user path from a dialog in a specified path.
Parameters:
path: The path in which to get the user path.
Returns:
A string containing the user path.
"""
def execute_shortcut(shortcut_key_modifier: shortcut_key_modifier, shortcut_key: shortcut_key) -> None:
"""Executes a shortcut.
Parameters:
shortcut_key_modifier: The modifier key for the shortcut.
shortcut_key: The key for the shortcut.
"""
def run_external_program_from_custom_directory(file_path: str) -> bool:
"""Runs a 3D external program from a custom directory.
Parameters:
file_path: The external program file path.
Returns:
False if error, true otherwise.
"""
def get_3d_file_name() -> str:
"""Gets the 3D file name.
Returns:
The 3D file name.
"""
def get_project_data(element_id: str) -> str:
"""Gets the project data.
Parameters:
element_id: The project data id.
Returns:
The project data.
"""
def get_project_name() -> str:
"""Gets the project name.
Returns:
The project name.
"""
def get_project_part() -> str:
"""Gets the project part.
Returns:
The project part.
"""
def get_project_architect() -> str:
"""Gets the project architect.
Returns:
The project architect.
"""
def get_project_number() -> str:
"""Gets the project number.
Returns:
The project number.
"""
def get_project_customer() -> str:
"""Gets the project customer.
Returns:
The project customer.
"""
def get_project_designer() -> str:
"""Gets the project designer.
Returns:
The project designer.
"""
def get_project_deadline() -> str:
"""Gets the project deadline.
Returns:
The project deadline.
"""
def get_project_user_attribute(number: int) -> str:
"""Gets the project user attribute.
Parameters:
number: The project user attribute number.
Returns:
The project user attribute.
"""
def get_project_user_attribute_name(number: int) -> str:
"""Gets the project user attribute name.
Parameters:
number: The project user attribute number.
Returns:
The project user attribute name.
"""
def get_project_latitude() -> float:
"""Gets the project latitude.
Returns:
The project latitude.
"""
def get_project_longitude() -> float:
"""Gets the project longitude.
Returns:
The project longitude.
"""
def get_project_postal_code() -> str:
"""Gets the project postal code.
Returns:
The project postal code.
"""
def get_project_address() -> str:
"""Gets the project address.
Returns:
The project address.
"""
def get_project_city() -> str:
"""Gets the project city.
Returns:
The project city.
"""
def get_project_country() -> str:
"""Gets the project country.
Returns:
The project country.
"""
def get_project_elevation() -> float:
"""Gets the project elevation.
Returns:
The project elevation.
"""
def get_project_description() -> str:
"""Gets the project description.
Returns:
A string containing the project description.
"""
def get_project_guid() -> str:
"""Gets the project GUID.
Returns:
The project GUID.
"""
def get_3d_userprofil_path() -> str:
"""Gets the 3D userprofil path.
Returns:
The 3D userprofil path.
"""
def get_plugin_path() -> str:
"""Gets the plugin path.
Returns:
A string containing the plugin path.
"""
def get_millimetre_from_imperial_string(value: str) -> float:
"""Converts an imperial string to millimetres.
Parameters:
value: The imperial string to convert.
Returns:
The value in millimetres.
"""
def get_imperial_string_from_millimetre(value: float) -> str:
"""Converts a value in millimetres to an imperial string.
Parameters:
value: The value in millimetres to convert.
Returns:
The value as an imperial string.
"""
def get_user_catalog_path() -> str:
"""Gets the user catalog path.
Returns:
A string containing the user catalog path.
"""
def get_3d_hwnd() -> int:
"""Gets the 3D HWND.
Returns:
The 3D HWND.
"""
def close_cadwork_document_saved() -> None:
"""close cadwork saved.
"""
def close_cadwork_document_unsaved() -> None:
"""close cadwork unsaved.
"""
def get_use_of_global_coordinates() -> bool:
"""Gets the use of global coordinates.
Returns:
True if global coordinates are used, false otherwise.
"""
def set_use_of_global_coordinates(use_of_global_coordinates: bool) -> None:
"""Sets the use of global coordinates.