osis-python 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {osis_python-0.2.0/src/osis_python.egg-info → osis_python-0.2.1}/PKG-INFO +3 -10
- {osis_python-0.2.0 → osis_python-0.2.1}/README.md +2 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/pyproject.toml +1 -10
- {osis_python-0.2.0 → osis_python-0.2.1/src/osis_python.egg-info}/PKG-INFO +3 -10
- {osis_python-0.2.0 → osis_python-0.2.1}/src/osis_python.egg-info/SOURCES.txt +6 -2
- osis_python-0.2.1/src/osis_python.egg-info/requires.txt +11 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/__init__.py +2 -2
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/boundary/interface.py +12 -0
- osis_python-0.2.1/src/pyosis/common/__init__.py +2 -0
- osis_python-0.2.1/src/pyosis/common/project.py +54 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/core/PyInterface.pyi +1 -6
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/core/__init__.py +0 -1
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/core/all_func.py +2 -1
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/element/interface.py +78 -2
- osis_python-0.2.1/src/pyosis/post/__init__.py +3 -0
- osis_python-0.2.1/src/pyosis/post/check.py +116 -0
- osis_python-0.2.1/src/pyosis/post/env.py +37 -0
- osis_python-0.2.1/src/pyosis/post/loadcase.py +58 -0
- osis_python-0.2.1/src/pyosis/post/result.py +42 -0
- osis_python-0.2.1/src/pyosis/property/comp_thickness.py +21 -0
- osis_python-0.2.1/src/pyosis/property/coordinate.py +88 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/io.py +2 -1
- osis_python-0.2.1/src/pyosis/section/numeric.py +34 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/param.py +18 -0
- osis_python-0.2.1/src/pyosis/thickness/interface.py +50 -0
- osis_python-0.2.0/src/osis_python.egg-info/requires.txt +0 -20
- osis_python-0.2.0/src/pyosis/core/project.py +0 -8
- osis_python-0.2.0/src/pyosis/post/__init__.py +0 -2
- osis_python-0.2.0/src/pyosis/post/check.py +0 -133
- osis_python-0.2.0/src/pyosis/post/loadcase.py +0 -96
- osis_python-0.2.0/src/pyosis/property/coordinate.py +0 -5
- osis_python-0.2.0/src/pyosis/section/numeric.py +0 -0
- osis_python-0.2.0/tests/test.py +0 -6
- {osis_python-0.2.0 → osis_python-0.2.1}/LICENSE +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/setup.cfg +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/common/interface.py +0 -0
- {osis_python-0.2.0/src/pyosis/common → osis_python-0.2.1/src/pyosis/control}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/control/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/core/client.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/core/command.py +0 -0
- {osis_python-0.2.0/src/pyosis/control → osis_python-0.2.1/src/pyosis/element}/__init__.py +0 -0
- {osis_python-0.2.0/src/pyosis/element → osis_python-0.2.1/src/pyosis/general}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.2.0/src/pyosis/general → osis_python-0.2.1/src/pyosis/geometry}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/load/static.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.2.0/src/pyosis/geometry → osis_python-0.2.1/src/pyosis/material}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.2.0/src/pyosis/material → osis_python-0.2.1/src/pyosis/node}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.2.0/src/pyosis/node → osis_python-0.2.1/src/pyosis/quick_building}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/common.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/rib.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/section/steel.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.1}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.2.0/src/pyosis/quick_building → osis_python-0.2.1/src/pyosis/thickness}/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,17 +17,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: openai>=2.7.1
|
|
21
|
-
Requires-Dist: agentscope>=1.0.13
|
|
22
|
-
Requires-Dist: fastapi>=0.128.0
|
|
23
|
-
Requires-Dist: httpx>=0.28.1
|
|
24
|
-
Requires-Dist: langchain-community>=0.4.1
|
|
25
20
|
Requires-Dist: matplotlib>=3.10.7
|
|
26
21
|
Requires-Dist: pandas>=2.3.3
|
|
27
|
-
Requires-Dist: pdfplumber>=0.11.9
|
|
28
|
-
Requires-Dist: python-docx>=1.2.0
|
|
29
|
-
Requires-Dist: requests>=2.32.5
|
|
30
|
-
Requires-Dist: uvicorn>=0.40.0
|
|
31
22
|
Provides-Extra: dev
|
|
32
23
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
33
24
|
Requires-Dist: black>=23.0; extra == "dev"
|
|
@@ -116,3 +107,5 @@ osis_solve()
|
|
|
116
107
|
```
|
|
117
108
|
|
|
118
109
|
If everything is normal, you will see OSIS finish the processing.
|
|
110
|
+
|
|
111
|
+
You can also directly execute the code using the code editor (vscode, pycharm, cursor, etc.). You may need to log in to the OSIS software first.
|
|
@@ -30,19 +30,10 @@ classifiers = [
|
|
|
30
30
|
"Programming Language :: Python :: 3.12",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
|
-
# 依赖
|
|
33
|
+
# 依赖
|
|
34
34
|
dependencies = [
|
|
35
|
-
"openai>=2.7.1",
|
|
36
|
-
"agentscope>=1.0.13",
|
|
37
|
-
"fastapi>=0.128.0",
|
|
38
|
-
"httpx>=0.28.1",
|
|
39
|
-
"langchain-community>=0.4.1",
|
|
40
35
|
"matplotlib>=3.10.7",
|
|
41
36
|
"pandas>=2.3.3",
|
|
42
|
-
"pdfplumber>=0.11.9",
|
|
43
|
-
"python-docx>=1.2.0",
|
|
44
|
-
"requests>=2.32.5",
|
|
45
|
-
"uvicorn>=0.40.0",
|
|
46
37
|
]
|
|
47
38
|
|
|
48
39
|
[tool.setuptools.dynamic]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,17 +17,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: openai>=2.7.1
|
|
21
|
-
Requires-Dist: agentscope>=1.0.13
|
|
22
|
-
Requires-Dist: fastapi>=0.128.0
|
|
23
|
-
Requires-Dist: httpx>=0.28.1
|
|
24
|
-
Requires-Dist: langchain-community>=0.4.1
|
|
25
20
|
Requires-Dist: matplotlib>=3.10.7
|
|
26
21
|
Requires-Dist: pandas>=2.3.3
|
|
27
|
-
Requires-Dist: pdfplumber>=0.11.9
|
|
28
|
-
Requires-Dist: python-docx>=1.2.0
|
|
29
|
-
Requires-Dist: requests>=2.32.5
|
|
30
|
-
Requires-Dist: uvicorn>=0.40.0
|
|
31
22
|
Provides-Extra: dev
|
|
32
23
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
33
24
|
Requires-Dist: black>=23.0; extra == "dev"
|
|
@@ -116,3 +107,5 @@ osis_solve()
|
|
|
116
107
|
```
|
|
117
108
|
|
|
118
109
|
If everything is normal, you will see OSIS finish the processing.
|
|
110
|
+
|
|
111
|
+
You can also directly execute the code using the code editor (vscode, pycharm, cursor, etc.). You may need to log in to the OSIS software first.
|
|
@@ -11,6 +11,7 @@ src/pyosis/boundary/__init__.py
|
|
|
11
11
|
src/pyosis/boundary/interface.py
|
|
12
12
|
src/pyosis/common/__init__.py
|
|
13
13
|
src/pyosis/common/interface.py
|
|
14
|
+
src/pyosis/common/project.py
|
|
14
15
|
src/pyosis/control/__init__.py
|
|
15
16
|
src/pyosis/control/interface.py
|
|
16
17
|
src/pyosis/core/PyInterface.pyi
|
|
@@ -18,7 +19,6 @@ src/pyosis/core/__init__.py
|
|
|
18
19
|
src/pyosis/core/all_func.py
|
|
19
20
|
src/pyosis/core/client.py
|
|
20
21
|
src/pyosis/core/command.py
|
|
21
|
-
src/pyosis/core/project.py
|
|
22
22
|
src/pyosis/element/__init__.py
|
|
23
23
|
src/pyosis/element/interface.py
|
|
24
24
|
src/pyosis/general/__init__.py
|
|
@@ -39,8 +39,11 @@ src/pyosis/node/__init__.py
|
|
|
39
39
|
src/pyosis/node/interface.py
|
|
40
40
|
src/pyosis/post/__init__.py
|
|
41
41
|
src/pyosis/post/check.py
|
|
42
|
+
src/pyosis/post/env.py
|
|
42
43
|
src/pyosis/post/loadcase.py
|
|
44
|
+
src/pyosis/post/result.py
|
|
43
45
|
src/pyosis/property/__init__.py
|
|
46
|
+
src/pyosis/property/comp_thickness.py
|
|
44
47
|
src/pyosis/property/coordinate.py
|
|
45
48
|
src/pyosis/property/creep_shrink.py
|
|
46
49
|
src/pyosis/property/damping.py
|
|
@@ -58,4 +61,5 @@ src/pyosis/section/steel.py
|
|
|
58
61
|
src/pyosis/stage/__init__.py
|
|
59
62
|
src/pyosis/stage/define.py
|
|
60
63
|
src/pyosis/stage/overall.py
|
|
61
|
-
|
|
64
|
+
src/pyosis/thickness/__init__.py
|
|
65
|
+
src/pyosis/thickness/interface.py
|
|
@@ -7,8 +7,8 @@ A library for extending OSIS functionality.
|
|
|
7
7
|
A library that allows users to use CAE with great flexibility.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "0.2.
|
|
11
|
-
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心
|
|
10
|
+
__version__ = "0.2.1"
|
|
11
|
+
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
|
|
12
12
|
|
|
13
13
|
# from .core import engine
|
|
14
14
|
# from .ai.agents import BaseAgent
|
|
@@ -181,3 +181,15 @@ def osis_boundary_group(strName: str, eOP: Literal["c", "a", "s", "r", "aa", "ra
|
|
|
181
181
|
tuple (bool, str): 是否成功,失败原因
|
|
182
182
|
'''
|
|
183
183
|
pass
|
|
184
|
+
|
|
185
|
+
@REGISTRY.register("BoundaryDel")
|
|
186
|
+
def osis_boundary_dle(nIndex:int)->tuple[bool, str]:
|
|
187
|
+
"""
|
|
188
|
+
删除边界
|
|
189
|
+
Args:
|
|
190
|
+
nIndex: 边界编号
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
tuple (bool, str): 是否成功,失败原因
|
|
194
|
+
"""
|
|
195
|
+
pass
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# --- project相关的函数
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Tuple
|
|
6
|
+
# from .engine import OSISEngine
|
|
7
|
+
from ..core.client import osis_client
|
|
8
|
+
|
|
9
|
+
def get_project_directory() -> Tuple[bool, str]:
|
|
10
|
+
return osis_client("GetProjectDirectory", {})
|
|
11
|
+
|
|
12
|
+
def open_project() -> Tuple[bool, str]:
|
|
13
|
+
...
|
|
14
|
+
|
|
15
|
+
def create_project() -> Tuple[bool, str]:
|
|
16
|
+
...
|
|
17
|
+
|
|
18
|
+
# class OSISProject():
|
|
19
|
+
# def __init__(self, path):
|
|
20
|
+
# self.root_path = self._parse_project_path(path)
|
|
21
|
+
# # 路径对象(方便后续操作)
|
|
22
|
+
# self.root_path_obj = Path(self.root_path)
|
|
23
|
+
|
|
24
|
+
# def _parse_project_path(self, path: str) -> str:
|
|
25
|
+
# """
|
|
26
|
+
# 私有方法:解析项目路径(核心逻辑)
|
|
27
|
+
# 1. 如果是绝对路径 → 直接返回
|
|
28
|
+
# 2. 如果是项目名 → 拼接当前工作目录返回
|
|
29
|
+
# """
|
|
30
|
+
# # 判断是否为完整绝对路径
|
|
31
|
+
# if os.path.isabs(path):
|
|
32
|
+
# return path
|
|
33
|
+
|
|
34
|
+
# # 不是绝对路径 → 在当前目录创建项目
|
|
35
|
+
# current_dir = os.getcwd()
|
|
36
|
+
# return os.path.join(current_dir, path)
|
|
37
|
+
|
|
38
|
+
# def open(self):
|
|
39
|
+
# return osis_client("GetProjectDirectory", {})
|
|
40
|
+
|
|
41
|
+
# def create(self):
|
|
42
|
+
# return osis_client("GetProjectDirectory", {})
|
|
43
|
+
|
|
44
|
+
# def close(self):
|
|
45
|
+
# return osis_client("GetProjectDirectory", {})
|
|
46
|
+
|
|
47
|
+
# def clear(self):
|
|
48
|
+
# ...
|
|
49
|
+
|
|
50
|
+
# def __str__(self):
|
|
51
|
+
# return f"OSISProject: {self.root_path}"
|
|
52
|
+
|
|
53
|
+
# def __repr__(self):
|
|
54
|
+
# return self.__str__()
|
|
@@ -154,9 +154,4 @@ class PyInterface:
|
|
|
154
154
|
|
|
155
155
|
def OSIS_QBStage(self, eBridgeType: str, stageInfo: list) -> Tuple[bool, str]:
|
|
156
156
|
return True, ""
|
|
157
|
-
|
|
158
|
-
def OSIS_CheckResult(slef, eSheetType: str, eCheckItem: str, strCheckName: str) -> tuple[bool, str, str]:
|
|
159
|
-
return True, "", ""
|
|
160
|
-
|
|
161
|
-
def OSIS_LoadCaseResult(self, fileName:str, eType: str) -> tuple[bool, str, str]:
|
|
162
|
-
return True, "", ""
|
|
157
|
+
|
|
@@ -119,7 +119,7 @@ def osis_element_spring(nEle: int=1, eElementType: str="SPRING", nNode1: int=1,
|
|
|
119
119
|
@REGISTRY.register("Element")
|
|
120
120
|
def osis_element_cable(nEle: int=1, eElementType: str="CABLE", nNode1: int=1, nNode2: int=2, nMat: int=1, nSec: int=1, eMethod: Literal["UL", "IF", "HF", "VF", "IS"]="UL", dPara: float="10.0"):
|
|
121
121
|
'''
|
|
122
|
-
|
|
122
|
+
创建或修改拉索单元
|
|
123
123
|
|
|
124
124
|
Args:
|
|
125
125
|
nEle (int): 单元编号。从 1 开始编号,所有类型的单元均使用同一编号序列。
|
|
@@ -149,7 +149,7 @@ def osis_element_cable(nEle: int=1, eElementType: str="CABLE", nNode1: int=1, nN
|
|
|
149
149
|
@REGISTRY.register("Element")
|
|
150
150
|
def osis_element_shell(nEle: int=1, eElementType: str="CABLE", bIsThin: bool=1, nMat: int=1, nThk: int=1, nNode1: int=1, nNode2: int=2, nNode3: int=3, nNode4: int = None):
|
|
151
151
|
'''
|
|
152
|
-
|
|
152
|
+
创建或修改壳单元
|
|
153
153
|
|
|
154
154
|
Args:
|
|
155
155
|
nEle (int): 单元编号。从 1 开始编号,所有类型的单元均使用同一编号序列。
|
|
@@ -218,3 +218,79 @@ def osis_element_group(strName: str="单元组1", eOP: Literal["c", "a", "s", "r
|
|
|
218
218
|
'''
|
|
219
219
|
pass
|
|
220
220
|
|
|
221
|
+
@REGISTRY.register("TaperEle")
|
|
222
|
+
def osis_taperele(
|
|
223
|
+
nIndex: str,
|
|
224
|
+
strZType: Literal["0", "1"],
|
|
225
|
+
dZTrans: float = 1.0,
|
|
226
|
+
strZpos: Literal["0", "1"] = "0",
|
|
227
|
+
dZdis: float = 0.0,
|
|
228
|
+
strYtype: Literal["0", "1"]="0",
|
|
229
|
+
dYtrans: float = 1.0,
|
|
230
|
+
strYpos: Literal["0", "1"] = "0",
|
|
231
|
+
dYdis: float = 0.0,
|
|
232
|
+
*eles: str,
|
|
233
|
+
|
|
234
|
+
) -> tuple[bool, str]:
|
|
235
|
+
"""
|
|
236
|
+
生成或修改变截面单元组
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
nIndex (str): 变截面单元组名称
|
|
240
|
+
strZType (str): 截面Z向过渡类型,
|
|
241
|
+
* 0=线性
|
|
242
|
+
* 1=多项式
|
|
243
|
+
dZTrans (float): ZType=0时默认1.0
|
|
244
|
+
strZpos (str):
|
|
245
|
+
* 0=i
|
|
246
|
+
* 1=j
|
|
247
|
+
* ZType=0时默认i
|
|
248
|
+
dZdis (float): 对称面距,ZType=0时默认0.0
|
|
249
|
+
strYtype (str): 截面Y向过渡类型
|
|
250
|
+
* 0=线性
|
|
251
|
+
* 1=多项式
|
|
252
|
+
dYtrans (float): YType=0时默认1.0
|
|
253
|
+
strYpos (str):
|
|
254
|
+
* 0=i
|
|
255
|
+
* 1=j
|
|
256
|
+
* YType=0时默认i
|
|
257
|
+
dYdis (float): 对称面距,YType=0时默认0.0
|
|
258
|
+
*eles (str): 单元组编号,示例:1,3,5to10
|
|
259
|
+
|
|
260
|
+
Returns:
|
|
261
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
262
|
+
- bool: 操作是否成功
|
|
263
|
+
- str: 失败原因
|
|
264
|
+
"""
|
|
265
|
+
pass
|
|
266
|
+
|
|
267
|
+
@REGISTRY.register("TaperEleDel")
|
|
268
|
+
def osis_element_tapereledel(strIndex: str) -> tuple[bool, str]:
|
|
269
|
+
"""
|
|
270
|
+
删除变截面单元组
|
|
271
|
+
|
|
272
|
+
Args:
|
|
273
|
+
strIndex (str): 变截面单元组名称
|
|
274
|
+
|
|
275
|
+
Returns:
|
|
276
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
277
|
+
- bool: 操作是否成功
|
|
278
|
+
- str: 失败原因
|
|
279
|
+
"""
|
|
280
|
+
pass
|
|
281
|
+
|
|
282
|
+
@REGISTRY.register("TaperEleMod")
|
|
283
|
+
def osis_element_taperelemod(strOldIndex: str, strNewIndex: str) -> tuple[bool, str]:
|
|
284
|
+
"""
|
|
285
|
+
修改变截面组名称
|
|
286
|
+
|
|
287
|
+
Args:
|
|
288
|
+
strOldIndex (str):
|
|
289
|
+
strNewIndex (str):
|
|
290
|
+
|
|
291
|
+
Returns:
|
|
292
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
293
|
+
- bool: 操作是否成功
|
|
294
|
+
- str: 失败原因
|
|
295
|
+
"""
|
|
296
|
+
pass
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import Literal, Any
|
|
3
|
+
|
|
4
|
+
from ..common import project
|
|
5
|
+
from ..core import command
|
|
6
|
+
import json
|
|
7
|
+
import pandas as pd
|
|
8
|
+
|
|
9
|
+
# /output,D:\\temp\\Temp1\\Check\\频遇组合包络.txt,echk,混凝土_PC腹板斜截面抗裂验算_频遇组合包络
|
|
10
|
+
_CMD = "/output,{out_file_path}.txt,echk,{check_file_name}"
|
|
11
|
+
_CHECK_TXT_PATH = "Temperary"
|
|
12
|
+
|
|
13
|
+
def osis_check_result(
|
|
14
|
+
eSheetType: Literal["一般", "混凝土", "施工阶段荷载包络"],
|
|
15
|
+
eCheckItem: Literal["正截面抗弯验算",
|
|
16
|
+
"斜截面抗剪验算",
|
|
17
|
+
"正截面抗压验算",
|
|
18
|
+
"PC抗扭验算",
|
|
19
|
+
"PS正截面短期抗裂验算",
|
|
20
|
+
"PC正截面长期抗裂验算",
|
|
21
|
+
"PC顶底板斜截面抗裂验算",
|
|
22
|
+
"PC腹板斜截面抗裂验算",
|
|
23
|
+
"裂缝宽度验算",
|
|
24
|
+
"挠度验算",
|
|
25
|
+
"PC正截面压应力验算",
|
|
26
|
+
"PC斜截面主压应力验算",
|
|
27
|
+
"PC钢束拉应力验算",
|
|
28
|
+
"PC施工阶段正截面压应力验算",
|
|
29
|
+
"PC施工阶段正截面拉应力验算",
|
|
30
|
+
"正截面杭拉/压承载力验算",
|
|
31
|
+
"PC斜载面抗裂验算",
|
|
32
|
+
"PC使用阶段正截面压应力验算",
|
|
33
|
+
"PC使用阶段斜载面主压应力验算",
|
|
34
|
+
"RC施工阶段正截面压应力验算",
|
|
35
|
+
"RC施工阶段中性轴处主拉应力验算",
|
|
36
|
+
"RC施工阶段受拉钢筋拉应力验算"],
|
|
37
|
+
strCheckName: str) -> tuple[bool, str, pd.DataFrame]:
|
|
38
|
+
'''
|
|
39
|
+
验算结果导出
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
eSheetType (str): 表格名称
|
|
43
|
+
* "一般"
|
|
44
|
+
* "混凝土"
|
|
45
|
+
* "施工阶段荷载包络"
|
|
46
|
+
eCheckItem (str): 验算类型
|
|
47
|
+
* "正截面抗弯验算"
|
|
48
|
+
* "斜截面抗剪验算"
|
|
49
|
+
* "正截面抗压验算"
|
|
50
|
+
* "PC抗扭验算"
|
|
51
|
+
* "PS正截面短期抗裂验算"
|
|
52
|
+
* "PC正截面长期抗裂验算"
|
|
53
|
+
* "PC顶底板斜截面抗裂验算"
|
|
54
|
+
* "PC腹板斜截面抗裂验算"
|
|
55
|
+
* "裂缝宽度验算"
|
|
56
|
+
* "挠度验算"
|
|
57
|
+
* "PC正截面压应力验算"
|
|
58
|
+
* "PC斜截面主压应力验算"
|
|
59
|
+
* "PC钢束拉应力验算"
|
|
60
|
+
* "PC施工阶段正截面压应力验算"
|
|
61
|
+
* "PC施工阶段正截面拉应力验算"
|
|
62
|
+
* "PC施工阶段正截面拉应力验算",
|
|
63
|
+
* "正截面杭拉/压承载力验算",
|
|
64
|
+
* "PC斜载面抗裂验算",
|
|
65
|
+
* "PC使用阶段正截面压应力验算",
|
|
66
|
+
* "PC使用阶段斜载面主压应力验算",
|
|
67
|
+
* "RC施工阶段正截面压应力验算",
|
|
68
|
+
* "RC施工阶段中性轴处主拉应力验算",
|
|
69
|
+
* "RC施工阶段受拉钢筋拉应力验算"
|
|
70
|
+
strCheckName (str): 验算名称
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
tuple (bool, str):
|
|
74
|
+
- bool: 操作是否成功
|
|
75
|
+
- str: 失败原因(如果操作失败)
|
|
76
|
+
'''
|
|
77
|
+
# e = OSISEngine.GetInstance()
|
|
78
|
+
# # return e.OSIS_CheckResult(base_path, middle_path, end_path)
|
|
79
|
+
# isok, error, result_txt_path = e.OSIS_CheckResult(eSheetType, eCheckItem, strCheckName)
|
|
80
|
+
# if isok:
|
|
81
|
+
# data = read_ansi_file_to_json(result_txt_path)
|
|
82
|
+
# return isok, error, json.dumps(data, indent=2, ensure_ascii=False)
|
|
83
|
+
# else:
|
|
84
|
+
# return isok, error, None
|
|
85
|
+
# 1 获取项目目录
|
|
86
|
+
is_ok, project_path = project.get_project_directory()
|
|
87
|
+
if not is_ok:
|
|
88
|
+
return False, "获取文件夹失败", None
|
|
89
|
+
|
|
90
|
+
project_path = Path(project_path)
|
|
91
|
+
check_name = eSheetType + "_" + eCheckItem + "_" + strCheckName
|
|
92
|
+
|
|
93
|
+
# 2 工况文件路径
|
|
94
|
+
check_file_path = project_path / _CHECK_TXT_PATH / check_name
|
|
95
|
+
|
|
96
|
+
# 3 生成命令
|
|
97
|
+
str_cmd = _CMD.format(out_file_path=check_file_path, check_file_name=check_name)
|
|
98
|
+
|
|
99
|
+
# 4 执行命令
|
|
100
|
+
is_ok, error = command.osis_run(str_cmd, mode="exec")
|
|
101
|
+
if not is_ok:
|
|
102
|
+
return False, error, None
|
|
103
|
+
|
|
104
|
+
# 5 读取结果
|
|
105
|
+
txt_file_path = project_path / _CHECK_TXT_PATH / check_name
|
|
106
|
+
txt_file_path = txt_file_path.with_suffix(".txt")
|
|
107
|
+
df = pd.read_csv(
|
|
108
|
+
txt_file_path,
|
|
109
|
+
sep=r"\s+", # 用正则匹配任意空白(空格/制表符)
|
|
110
|
+
header=2, # 表头在第3行(索引从0开始,这里跳过前两行标题)
|
|
111
|
+
skiprows=[], # 若还有多余空行可在这里加行号
|
|
112
|
+
encoding="gbk", # 若乱码可换成 "gbk" / "gb2312"
|
|
113
|
+
on_bad_lines="skip" # 跳过格式异常行
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return True, "", df
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from typing import Literal, Any
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
|
|
5
|
+
from pyosis.post.result import txt_file_path
|
|
6
|
+
|
|
7
|
+
# 将包络结果转换为txt的命令
|
|
8
|
+
_CMD = "/output,{out_file_path}.txt,{e_type},{check_file_name}"
|
|
9
|
+
|
|
10
|
+
def osis_env_result(strEnvName:str, eType: Literal['EnvBF','EnvEF','EnvES','EnvS','EnvND']) -> tuple[bool, str, pd.DataFrame]:
|
|
11
|
+
"""
|
|
12
|
+
提取包络结果
|
|
13
|
+
Args:
|
|
14
|
+
strEnvName (str): 包络名称
|
|
15
|
+
eType (str): 包络类型
|
|
16
|
+
* EnvBF = 包络/并发结果的边界反力;
|
|
17
|
+
* EnvEF = 包络/并发结果的单元内力;
|
|
18
|
+
* EnvES = 包络/并发结果的单元应变;
|
|
19
|
+
* EnvS = 包络/并发结果的单元应力;
|
|
20
|
+
* EnvND = 包络/并发结果的节点位移;
|
|
21
|
+
Returns:
|
|
22
|
+
tuple (bool, str): 是否成功,失败原因
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
is_ok, err, file_path = txt_file_path(strEnvName, eType, _CMD)
|
|
26
|
+
if not is_ok:
|
|
27
|
+
return False, err, None
|
|
28
|
+
df = pd.read_csv(
|
|
29
|
+
file_path,
|
|
30
|
+
sep=r"\s+", # 用正则匹配任意空白(空格/制表符)
|
|
31
|
+
header=0, # 表头在第3行(索引从0开始,这里跳过前两行标题)
|
|
32
|
+
skiprows=4, # 若还有多余空行可在这里加行号
|
|
33
|
+
encoding="gbk", # 若乱码可换成 "gbk" / "gb2312"
|
|
34
|
+
on_bad_lines="skip" # 跳过格式异常行
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return True, "", df
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from .result import txt_file_path
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
# 将工况结果转换为txt的命令
|
|
7
|
+
_CMD = "/output,{out_file_path}.txt,{e_type},{check_file_name}"
|
|
8
|
+
_LOAD_CASE_TXT_PATH = "Temperary"
|
|
9
|
+
|
|
10
|
+
# def osis_elem_force(strLCName: str, eDataItem: Literal['EF'], eElementType: Literal["BEAM3D", "TRUSS", "SPRING", "CABLE", "SHELL"]):
|
|
11
|
+
# '''
|
|
12
|
+
# 提取内力结果
|
|
13
|
+
#
|
|
14
|
+
# Args:
|
|
15
|
+
# strLCName (str): 工况名称
|
|
16
|
+
# eDataItem (str): 数据类型,不区分大小写。EF = 内力
|
|
17
|
+
# eElementType (str): 单元类型,不区分大小写。BEAM3D = 梁柱单元,TRUSS = 桁架单元,SPRING = 弹簧单元,CABLE = 拉索单元,SHELL = 壳单元
|
|
18
|
+
#
|
|
19
|
+
# Returns:
|
|
20
|
+
# tuple (bool, str):
|
|
21
|
+
# - bool: 操作是否成功
|
|
22
|
+
# - str: 失败原因(如果操作失败)
|
|
23
|
+
# '''
|
|
24
|
+
# e = OSISEngine.GetInstance()
|
|
25
|
+
# eDataItem = eDataItem.upper()
|
|
26
|
+
# eElementType = eElementType.upper()
|
|
27
|
+
# return e.OSIS_ElemForce(strLCName, eDataItem, eElementType)
|
|
28
|
+
|
|
29
|
+
def osis_loadcase_result(strLCName:str, eType: Literal['LCEF','LCED','LCND','LCBF','LCTL','LCS']) -> tuple[bool, str, pd.DataFrame]:
|
|
30
|
+
"""
|
|
31
|
+
提取荷载工况结果
|
|
32
|
+
Args:
|
|
33
|
+
strLCName (str): 工况名称
|
|
34
|
+
eType (str): 荷载工况结果类型
|
|
35
|
+
* LCEF = 荷载工况结果的单元内力;
|
|
36
|
+
* LCED = 荷载工况结果的单元位移;
|
|
37
|
+
* LCND = 荷载工况结果的节点位移;
|
|
38
|
+
* LCBF = 荷载工况结果的边界反力;
|
|
39
|
+
* LCTL = 荷载工况结果的钢束损失;
|
|
40
|
+
* LCS = 荷载工况结果的单元应力;
|
|
41
|
+
Returns:
|
|
42
|
+
tuple (bool, str): 是否成功,失败原因
|
|
43
|
+
|
|
44
|
+
"""
|
|
45
|
+
is_ok, err, file_path = txt_file_path(strLCName, eType, _CMD)
|
|
46
|
+
if not is_ok:
|
|
47
|
+
return False, err, None
|
|
48
|
+
|
|
49
|
+
df = pd.read_csv(
|
|
50
|
+
file_path,
|
|
51
|
+
sep=r"\s+", # 用正则匹配任意空白(空格/制表符)
|
|
52
|
+
header=0, # 表头在第3行(索引从0开始,这里跳过前两行标题)
|
|
53
|
+
skiprows=[], # 若还有多余空行可在这里加行号
|
|
54
|
+
encoding="gbk", # 若乱码可换成 "gbk" / "gb2312"
|
|
55
|
+
on_bad_lines="skip" # 跳过格式异常行
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
return True, "", df
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from pyosis.common import project
|
|
4
|
+
from pyosis.core import command
|
|
5
|
+
|
|
6
|
+
_LOAD_CASE_FILE_PATH = "Temperary"
|
|
7
|
+
_LOAD_CASE_TXT_PATH = "Temperary"
|
|
8
|
+
|
|
9
|
+
def txt_file_path(file_name, e_type, cmd) -> tuple[bool, str, str]:
|
|
10
|
+
"""
|
|
11
|
+
用于获取工况和包络结果的txt路径
|
|
12
|
+
Args:
|
|
13
|
+
file_name: 文件名称
|
|
14
|
+
e_type: 指令名称
|
|
15
|
+
cmd: 命令流
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
tuple (bool, str): 是否成功,失败原因,txt文件路径
|
|
19
|
+
"""
|
|
20
|
+
# 1 获取项目目录
|
|
21
|
+
is_ok, project_path = project.get_project_directory()
|
|
22
|
+
if not is_ok:
|
|
23
|
+
return False, "获取文件夹失败", ""
|
|
24
|
+
|
|
25
|
+
project_path = Path(project_path)
|
|
26
|
+
|
|
27
|
+
# 2 工况文件路径
|
|
28
|
+
load_case_file_path = project_path / _LOAD_CASE_FILE_PATH / file_name
|
|
29
|
+
|
|
30
|
+
# 3 生成命令
|
|
31
|
+
str_cmd = cmd.format(out_file_path=load_case_file_path, e_type=e_type, check_file_name=file_name)
|
|
32
|
+
|
|
33
|
+
# 4 执行命令
|
|
34
|
+
is_ok, error = command.osis_run(str_cmd, mode="exec")
|
|
35
|
+
if not is_ok:
|
|
36
|
+
return False, error, ""
|
|
37
|
+
|
|
38
|
+
# 5 读取结果
|
|
39
|
+
file_path = project_path / _LOAD_CASE_TXT_PATH / file_name
|
|
40
|
+
file_path = file_path.with_suffix(".txt")
|
|
41
|
+
|
|
42
|
+
return True, "", file_path
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
from pyosis.core import REGISTRY
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@REGISTRY.register("AsgnCompThk")
|
|
6
|
+
def osis_property_asgncompthk(dThickness: float, strOp: str, strElem: str) -> tuple[bool, str]:
|
|
7
|
+
"""
|
|
8
|
+
分配或重置单个单元的理论厚度,用于定义收缩徐变特性
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
dThickness (float): 构件理论厚度
|
|
12
|
+
strOp (str): 操作;
|
|
13
|
+
strElem (str): 待分配单元的编号
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
17
|
+
- bool: 操作是否成功
|
|
18
|
+
- str: 失败原因(如果操作失败)
|
|
19
|
+
"""
|
|
20
|
+
pass
|
|
21
|
+
|