File tree 10 files changed +17
-133
lines changed
10 files changed +17
-133
lines changed Original file line number Diff line number Diff line change 27
27
# Embed mechanical and set global variables
28
28
29
29
app = mech .App (version = 241 )
30
- globals (). update ( mech . global_variables ( app , True ))
30
+ app . update_globals ( globals ( ))
31
31
print (app )
32
32
33
33
cwd = os .path .join (os .getcwd (), "out" )
@@ -525,21 +525,7 @@ def update(frame):
525
525
# Project tree
526
526
# ~~~~~~~~~~~~
527
527
528
-
529
- def print_tree (node , indentation = "" ):
530
- print (f"{ indentation } ├── { node .Name } " )
531
-
532
- if (
533
- hasattr (node , "Children" )
534
- and node .Children is not None
535
- and node .Children .Count > 0
536
- ):
537
- for child in node .Children :
538
- print_tree (child , indentation + "| " )
539
-
540
-
541
- root_node = DataModel .Project
542
- print_tree (root_node )
528
+ app .print_tree (DataModel .Project )
543
529
544
530
# %%
545
531
# Cleanup
Original file line number Diff line number Diff line change 26
26
# Embed mechanical and set global variables
27
27
28
28
app = mech .App (version = 241 )
29
- globals (). update ( mech . global_variables ( app , True ))
29
+ app . update_globals ( globals ( ))
30
30
print (app )
31
31
32
32
cwd = os .path .join (os .getcwd (), "out" )
@@ -425,21 +425,7 @@ def write_file_contents_to_console(path):
425
425
# Project tree
426
426
# ~~~~~~~~~~~~
427
427
428
-
429
- def print_tree (node , indentation = "" ):
430
- print (f"{ indentation } ├── { node .Name } " )
431
-
432
- if (
433
- hasattr (node , "Children" )
434
- and node .Children is not None
435
- and node .Children .Count > 0
436
- ):
437
- for child in node .Children :
438
- print_tree (child , indentation + "| " )
439
-
440
-
441
- root_node = DataModel .Project
442
- print_tree (root_node )
428
+ app .print_tree (DataModel .Project )
443
429
444
430
# %%
445
431
# Cleanup
Original file line number Diff line number Diff line change @@ -498,24 +498,7 @@ def write_file_contents_to_console(path):
498
498
# Project tree
499
499
# ~~~~~~~~~~~~
500
500
501
-
502
- def print_tree (node , indentation = "" ):
503
- if hasattr (node , "Suppressed" ) and node .Suppressed is True :
504
- print (f"{ indentation } ├── { node .Name } (Suppressed)" )
505
- else :
506
- print (f"{ indentation } ├── { node .Name } " )
507
-
508
- if (
509
- hasattr (node , "Children" )
510
- and node .Children is not None
511
- and node .Children .Count > 0
512
- ):
513
- for child in node .Children :
514
- print_tree (child , indentation + "| " )
515
-
516
-
517
- root_node = DataModel .Project
518
- print_tree (root_node )
501
+ app .print_tree (DataModel .Project )
519
502
520
503
# %%
521
504
# Cleanup
Original file line number Diff line number Diff line change 32
32
# Embed mechanical and set global variables
33
33
34
34
app = mech .App (version = 241 )
35
- globals (). update ( mech . global_variables ( app , True ))
35
+ app . update_globals ( globals ( ))
36
36
print (app )
37
37
38
38
cwd = os .path .join (os .getcwd (), "out" )
@@ -523,21 +523,7 @@ def update(frame):
523
523
# Project tree
524
524
# ~~~~~~~~~~~~
525
525
526
-
527
- def print_tree (node , indentation = "" ):
528
- print (f"{ indentation } ├── { node .Name } " )
529
-
530
- if (
531
- hasattr (node , "Children" )
532
- and node .Children is not None
533
- and node .Children .Count > 0
534
- ):
535
- for child in node .Children :
536
- print_tree (child , indentation + "| " )
537
-
538
-
539
- root_node = DataModel .Project
540
- print_tree (root_node )
526
+ app .print_tree (DataModel .Project )
541
527
542
528
# %%
543
529
# Cleanup
Original file line number Diff line number Diff line change 29
29
# Embed mechanical and set global variables
30
30
31
31
app = mech .App (version = 241 )
32
- globals (). update ( mech . global_variables ( app , True ))
32
+ app . update_globals ( globals ( ))
33
33
print (app )
34
34
35
35
cwd = os .path .join (os .getcwd (), "out" )
@@ -463,21 +463,7 @@ def write_file_contents_to_console(path):
463
463
# Project tree
464
464
# ~~~~~~~~~~~~
465
465
466
-
467
- def print_tree (node , indentation = "" ):
468
- print (f"{ indentation } ├── { node .Name } " )
469
-
470
- if (
471
- hasattr (node , "Children" )
472
- and node .Children is not None
473
- and node .Children .Count > 0
474
- ):
475
- for child in node .Children :
476
- print_tree (child , indentation + "| " )
477
-
478
-
479
- root_node = DataModel .Project
480
- print_tree (root_node )
466
+ app .print_tree (DataModel .Project )
481
467
482
468
# %%
483
469
# Cleanup
Original file line number Diff line number Diff line change 23
23
# Embed Mechanical and set global variables
24
24
25
25
app = mech .App (version = 241 )
26
- globals (). update ( mech . global_variables ( app , True ))
26
+ app . update_globals ( globals ( ))
27
27
print (app )
28
28
29
29
@@ -252,21 +252,7 @@ def write_file_contents_to_console(path):
252
252
# Project tree
253
253
# ~~~~~~~~~~~~
254
254
255
-
256
- def print_tree (node , indentation = "" ):
257
- print (f"{ indentation } ├── { node .Name } " )
258
-
259
- if (
260
- hasattr (node , "Children" )
261
- and node .Children is not None
262
- and node .Children .Count > 0
263
- ):
264
- for child in node .Children :
265
- print_tree (child , indentation + "| " )
266
-
267
-
268
- root_node = DataModel .Project
269
- print_tree (root_node )
255
+ app .print_tree (DataModel .Project )
270
256
271
257
# %%
272
258
# Cleanup
Original file line number Diff line number Diff line change 23
23
# Embed mechanical and set global variables
24
24
25
25
app = mech .App (version = 241 )
26
- globals (). update ( mech . global_variables ( app , True ))
26
+ app . update_globals ( globals ( ))
27
27
print (app )
28
28
29
29
cwd = os .path .join (os .getcwd (), "out" )
@@ -252,21 +252,7 @@ def write_file_contents_to_console(path):
252
252
# Project tree
253
253
# ~~~~~~~~~~~~
254
254
255
-
256
- def print_tree (node , indentation = "" ):
257
- print (f"{ indentation } ├── { node .Name } " )
258
-
259
- if (
260
- hasattr (node , "Children" )
261
- and node .Children is not None
262
- and node .Children .Count > 0
263
- ):
264
- for child in node .Children :
265
- print_tree (child , indentation + "| " )
266
-
267
-
268
- root_node = DataModel .Project
269
- print_tree (root_node )
255
+ app .print_tree (DataModel .Project )
270
256
271
257
# %%
272
258
# Cleanup
Original file line number Diff line number Diff line change 58
58
# Embed mechanical and set global variables
59
59
60
60
app = mech .App (version = 241 )
61
- globals (). update ( mech . global_variables ( app , True ))
61
+ app . update_globals ( globals ( ))
62
62
print (app )
63
63
64
64
cwd = os .path .join (os .getcwd (), "out" )
Original file line number Diff line number Diff line change 38
38
# Embed mechanical and set global variables
39
39
40
40
app = mech .App (version = 241 )
41
- globals (). update ( mech . global_variables ( app , True ))
41
+ app . update_globals ( globals ( ))
42
42
print (app )
43
43
44
44
cwd = os .path .join (os .getcwd (), "out" )
@@ -381,22 +381,7 @@ def update(frame):
381
381
# Project tree
382
382
# ~~~~~~~~~~~~
383
383
384
-
385
- def print_tree (node , indentation = "" ):
386
- print (f"{ indentation } ├── { node .Name } " )
387
-
388
- if (
389
- hasattr (node , "Children" )
390
- and node .Children is not None
391
- and node .Children .Count > 0
392
- ):
393
- for child in node .Children :
394
- print_tree (child , indentation + "| " )
395
-
396
-
397
- root_node = DataModel .Project
398
- print_tree (root_node )
399
-
384
+ app .print_tree (DataModel .Project )
400
385
401
386
# %%
402
387
# Cleanup
Original file line number Diff line number Diff line change 31
31
# Embed mechanical and set global variables
32
32
33
33
app = mech .App (version = 241 )
34
- globals (). update ( mech . global_variables ( app , True ))
34
+ app . update_globals ( globals ( ))
35
35
print (app )
36
36
37
37
cwd = os .path .join (os .getcwd (), "out" )
You can’t perform that action at this time.
0 commit comments