-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessNetTemplate.py
More file actions
76 lines (60 loc) · 2.01 KB
/
ProcessNetTemplate.py
File metadata and controls
76 lines (60 loc) · 2.01 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
from recurdyn import *
# from recurdyn import Chart
# from recurdyn import MTT2D
# from recurdyn import FFlex
# from recurdyn import RFlex
# from recurdyn import Tire
# Common Variables
app = None
application = None
model_document = None
plot_document = None
model = None
ref_frame_1 = None
ref_frame_2 = None
# initialize() should be called before ProcessNet function call.
def initialize():
global app
global application
global model_document
global plot_document
global model
app = dispatch_recurdyn()
application = IApplication(app.RecurDynApplication)
model_document = application.ActiveModelDocument
if model_document is not None:
model_document = IModelDocument(model_document)
plot_document = application.ActivePlotDocument
if plot_document is not None:
plot_document = IPlotDocument(plot_document)
if model_document is None and plot_document is None:
application.PrintMessage("No model file")
model_document = application.NewModelDocument("Examples")
if model_document is not None:
model_document = IModelDocument(model_document)
model = ISubSystem(model_document.Model)
return application, model_document, plot_document, model
# dispose() should be called after ProcessNet function call.
def dispose():
global application
global model_document
model_document = application.ActiveModelDocument
if model_document is not None:
model_document = IModelDocument(model_document)
else:
return
if not model_document.Validate():
return
# Redraw() and UpdateDatabaseWindow() can take more time in a heavy model.
model_document.Redraw()
# model_document.PostProcess() # UpdateDatabaseWindow(), SetModified()
model_document.UpdateDatabaseWindow()
# If you call SetModified(), Animation will be reset.
model_document.SetModified()
model_document.SetUndoHistory("Python ProcessNet")
#
application, model_document, plot_document, model = initialize()
#
#
dispose()
#