Skip to content

Commit 5334327

Browse files
author
MichalO
committed
synchronization with RFEM_Python_Client v1.20.0
1 parent e4a871f commit 5334327

File tree

16 files changed

+3902
-688
lines changed

16 files changed

+3902
-688
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ Python client (high-level functions) for [RSTAB 9](https://www.dlubal.com/en/pro
3131
## Description
3232
This Python project is focused on opening RSTAB 9 to all of our customers, enabling them to interact with RSTAB 9 on a much higher level. If you are looking for a tool to help you solve parametric models or optimization tasks, you have come to the right place. This community serves as a support portal and base for all of your future projects. The goal is to create an easily expandable Python library, which communicates instructions to RSTAB 9 through WebServices (WS). WS enables access to RSTAB 9 either via a local instance or a remote internet connection.
3333

34+
35+
## Eyes on Upcoming Developmets! :eyes:
36+
37+
As you may have already heard, brand new WS features are in the works. Having support for Python scripting directly in the RSTAB, we have foundations to build completely new WS API which will be faster, have better access to results, and will have full compatibility with RSTAB Console.
38+
39+
3440
## Architecture
3541

3642
* [![RSTAB](https://img.shields.io/badge/RSTAB-blue)](/RSTAB): folder following the structure of RSTAB 9 navigator containing individual types of objects

RSTAB/BasicObjects/member.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,63 @@ def CouplingHingeHinge(
13501350
# Add Member to client model
13511351
model.clientModel.service.set_member(clientObject)
13521352

1353+
@staticmethod
1354+
def Spring(no: int = 1,
1355+
start_node_no: int = 1,
1356+
end_node_no: int = 2,
1357+
line: int = None,
1358+
spring_type: int = None,
1359+
comment: str = '',
1360+
params: dict = None,
1361+
model = Model):
1362+
"""
1363+
Args:
1364+
no (int): Member Tag
1365+
start_node_no (int): Tag of Start Node
1366+
end_node_no (int): Tag of End Node
1367+
line (int, optional): Assigned Line
1368+
spring_type (int, optional): Assign Member Spring Type
1369+
comment (str, optional): Comment
1370+
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
1371+
model (RSTAB Class, optional): Model to be edited
1372+
"""
1373+
1374+
# Client model | Member
1375+
clientObject = model.clientModel.factory.create('ns0:member')
1376+
1377+
# Clears object atributes | Sets all atributes to None
1378+
clearAttributes(clientObject)
1379+
1380+
# Member No.
1381+
clientObject.no = no
1382+
1383+
# Member Type
1384+
clientObject.type = MemberType.TYPE_SPRING.name
1385+
1386+
# Assigned Line number or Node numbers
1387+
if line is None:
1388+
clientObject.node_start = start_node_no
1389+
clientObject.node_end = end_node_no
1390+
else:
1391+
clientObject.line = line
1392+
1393+
# Spring Type
1394+
clientObject.member_type_spring = spring_type
1395+
1396+
# Comment
1397+
clientObject.comment = comment
1398+
1399+
# Adding optional parameters via dictionary
1400+
if params:
1401+
for key in params:
1402+
clientObject[key] = params[key]
1403+
1404+
# Delete None attributes for improved performance
1405+
deleteEmptyAttributes(clientObject)
1406+
1407+
# Add Member to client model
1408+
model.clientModel.service.set_member(clientObject)
1409+
13531410
@staticmethod
13541411
def DeleteMember(members_no: str = '1 2', model = Model):
13551412

RSTAB/BasicObjects/memberSet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from RSTAB.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString
2-
from RSTAB.enums import SetType
1+
from RSTAB.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString, ConvertStrToListOfInt
2+
from RSTAB.enums import SetType, ObjectTypes
33

44
class MemberSet():
55
def __init__(self,

RSTAB/ImportExport/exports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def ObjectLocations(locationsArray):
102102
return {'location': locationsArray}
103103

104104

105-
def ExportToIFC(targetFilePath: str, IFCSettings: IFCExportSettings, ObjectLoc = None, model = Model):
105+
def ExportToIFC(targetFilePath: str, IFCSettings = IFCExportSettings, ObjectLoc = None, model = Model):
106106
'''
107107
Use this function to export active model t o IFC.
108108

0 commit comments

Comments
 (0)