-
Notifications
You must be signed in to change notification settings - Fork 3
/
sG3DV5Form.py
91 lines (70 loc) · 3.08 KB
/
sG3DV5Form.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from abaqusGui import *
#from abaqusConstants import ALL
#import osutils, os
import sG3DV5DB
###########################################################################
# Class definition
#profile,vf_f,interface_flag,t_interface,modelName,fiber_matname,matrix_matname,mesh_size,elem_type
###########################################################################
class SG3DV5Form(AFXForm):
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def __init__(self, owner):
# Construct the base class.
#
AFXForm.__init__(self, owner)
self.radioButtonGroups = {}
self.cmd = AFXGuiCommand(mode=self, method='create3DV5SG',
objectName='sg3DV5Main', registerQuery=False)
self.profileKw = AFXIntKeyword(self.cmd, 'profile', True, 1,evalExpression=False)
self.fiber_flagKw = AFXIntKeyword(self.cmd, 'fiber_flag', True, 1,evalExpression=False)
self.vf_fKw = AFXFloatKeyword(self.cmd, 'vf_f', True)#, 0.4)
self.interface_flagKw = AFXIntKeyword(self.cmd, 'interface_flag', True, 1,evalExpression=False)
self.t_interfaceKw = AFXFloatKeyword(self.cmd, 't_interface', True, 0.0)
self.modelNameKw = AFXStringKeyword(self.cmd, 'modelName', True, '')
self.fiber_matnameKw = AFXStringKeyword(self.cmd, 'fiber_matname', True, '')
self.matrix_matnameKw = AFXStringKeyword(self.cmd, 'matrix_matname', True, '')
self.interface_matnameKw = AFXStringKeyword(self.cmd, 'interface_matname', True, '')
self.mesh_sizeKw = AFXFloatKeyword(self.cmd, 'mesh_size', True, 0.1)
self.elem_typeKw = AFXStringKeyword(self.cmd, 'elem_type', True, 'Linear')
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def getFirstDialog(self):
import sG3DV5DB
reload(sG3DV5DB)
return sG3DV5DB.SG3DV5DB(self)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def doCustomChecks(self):
# Try to set the appropriate radio button on. If the user did
# not specify any buttons to be on, do nothing.
#
for kw1,kw2,d in self.radioButtonGroups.values():
try:
value = d[ kw1.getValue() ]
kw2.setValue(value)
except:
pass
return True
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def okToCancel(self):
# No need to close the dialog when a file operation (such
# as New or Open) or model change is executed.
#
return False
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Register the plug-in
##
#thisPath = os.path.abspath(__file__)
#thisDir = os.path.dirname(thisPath)
#
#toolset = getAFXApp().getAFXMainWindow().getPluginToolset()
#toolset.registerGuiMenuButton(
# buttonText='SG2DV5Button',
# object=SG2DV5_plugin(toolset),
# messageId=AFXMode.ID_ACTIVATE,
# icon=None,
# kernelInitString='import sg2DMain',
# applicableModules=ALL,
# version='N/A',
# author='N/A',
# description='N/A',
# helpUrl='N/A'
#)