-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiberModel.py
More file actions
48 lines (43 loc) · 1.83 KB
/
fiberModel.py
File metadata and controls
48 lines (43 loc) · 1.83 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
import sys; import os;
import clr
from winreg import * # for reg. access
addr = r"SOFTWARE\Classes\NextFEM Designer\shell\open\command"
aReg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
aKey = OpenKey(aReg, addr); vkey = QueryValueEx(aKey,None)
dir=os.path.split(vkey[0].replace('"','').replace("%1","").strip())[0]
clr.AddReference(dir + "\\NextFEMapi.dll")
import NextFEMapi
nf=NextFEMapi.API()
# set units
nf.setUnits("m","kN")
# get sections and material
sX=nf.addRectSection(0.30,0.50); sY=nf.addRectSection(0.5,0.24); sZ=nf.addRectSection(0.40,0.40)
matID = nf.addMatFromLib("C25/30")
# add loadcases
nf.addLoadCase("pp"); nf.addLoadCase("perm"); nf.addLoadCase("var")
# set self-weight
nf.setSelfWeight("pp")
# use frame generator
nf.generateFrame(2,4,10,5.0,6.0,3.5,sX, sY, sZ, matID, matID, matID, "perm","var","",-2.0,-3.0,0,True,False)
# add a combination
nf.addLoadCase("ULS")
nf.setCombination("ULS","pp",1.3); nf.setCombination("ULS","perm",1.5); nf.setCombination("ULS","var",1.5)
# load case from combo
nf.LoadCaseFromCombo("ULS")
# set rigid diaphragms for all floors
nf.setRigidDiaphragms()
# auto-rebar
print("Design mat.: " + str(nf.addDesignMatFromLib("B450C")))
# set modelname and run linear analysis
nf.ModelName = "testAPI"; print("Solver messages: " + nf.RunLoadCase("LC_ULS"))
# dimensioning of rebar on the base of static results. 3 stations used.
print(nf.checkModel("LC_ULS","1",1,"Static_Rebar_Design"))
# set OpenSees as default solver - path must be input (OpenSees not included)
nf.changeSolver(1,r"C:\opensees.exe")
# set fiber section
nf.setFiberSection(sX); nf.setFiberSection(sY); nf.setFiberSection(sZ)
# set non-linear analysis - to be run later
nf.setNLSanalysis("LC_ULS",0.1,10,0.001,30)
# save and open model
nf.saveModel(nf.ModelName + ".nxf")
nf.startDesigner(nf.ModelName + ".nxf")