Skip to content

NextFEM/API-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API-Python

Python scripts using NextFEM API - free environment to model and analyze structures!

Requirements

Python.NET is required to use NextFEM API in Python environment. See also API usage.

Instructions

Please read instructions here.

Python Console plugin also helps learning NextFEM API. It's available for free in NextFEM Designer.

pythonConsole

Python REST API wrapper

A wrapper for using NextFEM REST API is available in the file 'NextFEMapiREST.py'. See also NextFEM API documentation.

Code sample:

import os,json
import NextFEMapiREST
# connects to local copy of NextFEM Designer
nf=NextFEMapiREST.NextFEMrest()
# current dir
dir = os.path.dirname(os.path.realpath(__file__))

# new model
print(nf.newModel())
# load json model
with open(dir + r"\sample.json") as f:
    contents = json.load(f)
nf.modeldata=contents
# get json model and print first node number
print("First node = " + json.loads(nf.modeldata)['nodes'][0]['num'])
# print first node number in the model
print(str(nf.nodesList[0]))
# consider masses in Z direction: property reading and writing sample
nf.autoMassInZ=False; print(str(nf.autoMassInZ))
nf.autoMassInZ=True; print(str(nf.autoMassInZ))
# set combination coefficients
print(str(nf.setCombinationFactors(1.5,1.5,[0.7,0.5,0.3],[0.6,0.2,0.0],[0.5,0.2,0.0],1.3)))

About

Python scripts using NextFEM API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages