A powerful tool for civil engineer in their work.
Project description
Civil_Tools
这是一个针对结构工程师开发的,集成了模型设计、结果分析、绘制图纸、出具计算书等多个模块的工具包。
具体包含:
- YDB 数据库加载工具 (
YDBLoader) - 各类图纸绘制工具 (
DXFGenerator) - 各类报告计算书生成工具 (
ReportGenerator) - 各类数据图片绘制工具 (
FigureGenerator)
安装: Installation
最新发布的稳定版(包括其依赖)可以通过 PyPI 进行下载:
The latest stable release (and required dependencies) can be installed from PyPI:
注意: pip 时使用的模块的名字是 civil-tools-v !
Notice: The module name for pip is civil-tools-v !
pip install civil-tools-v
快速上手: Quick Start
YDB 数据库加载工具 ( YDBLoader )
这是一个用于加载 YJK 软件中,以.ydb结尾的数据库文件的 Python 库,可以加载的文件包括 dtlmodel.ydb(基础建模数据库)和dsnModel.ydb(计算结果数据库)。
A python package to load .ydb files created by YJK, including dtlmodel.ydb (which contains the basic building information), and dsnModel.ydb (which conatins the calculate result of the model).
你可以轻易地从.ydb文件中提取出你想要的数据:
You can eaily extract the data you want from .ydb files:
# 导入本模块
# import this lib
from CivilTools.YDBLoader import YDBLoader
# 定义你的.ydb文件路径
# define your .ydb file path
your_ydb_file = r"your_yjk_model/施工图/dtlmodel.ydb"
# 根据文件数据,创建model
# create model by data
model = YDBLoader(your_ydb_file)
# 通过内置的各种方法,获取你需要的数据
# get the data you want, by various built-in funcitons
columns = model.get_columns()
for col in columns:
print(col.joint)
运行上述代码,你应该可以看到如下的输出:
The code is expected to print the data like follow:
Joint(id:1003):[x:54.9286,y:61.9286]:stdFlrId:1001
Joint(id:1004):[x:54.9286,y:9061.9286]:stdFlrId:1001
Joint(id:1005):[x:54.9286,y:18061.9286]:stdFlrId:1001
Joint(id:1006):[x:9054.9286,y:61.9286]:stdFlrId:1001
Joint(id:1007):[x:9054.9286,y:9061.9286]:stdFlrId:1001
Joint(id:1008):[x:9054.9286,y:18061.9286]:stdFlrId:1001
Joint(id:1009):[x:18054.9286,y:61.9286]:stdFlrId:1001
Joint(id:1010):[x:18054.9286,y:9061.9286]:stdFlrId:1001
Joint(id:1011):[x:18054.9286,y:18061.9286]:stdFlrId:1001
Joint(id:1012):[x:27054.9286,y:61.9286]:stdFlrId:1001
Joint(id:1013):[x:27054.9286,y:9061.9286]:stdFlrId:1001
Joint(id:1014):[x:27054.9286,y:18061.9286]:stdFlrId:1001
各类图纸绘制工具 ( DXFGenerator )
这是一个用于绘制各类结构相关图纸的工具,包括各类节点详图、大样,甚至整层楼的模板图等等。
This is a tool used to draw various structural related drawings, including detailed drawings, large samples, and even template drawings of the entire floor.
你可以轻易地从CivilTools.DXFGenerator中导出并使用它:
from CivilTools.DXFGenerator import FloorHeightTableDXF
dxf = FloorHeightTableDXF(10,2,-500)
dxf.font_size = 400
dxf.set_table_title("XXX项目X号楼")
dxf.set_embeding_floor("F3")
dxf.export_dxf("test.dxf")
dxf
如果你在 Jupyter 中运行,则会看到如下的渲染示意图。可以看到层高表被自动生成出来,包括嵌固层等信息。与此同时,相应的 dxf 也已经保存在当前目录下的 test.dxf 文件中。
If you run it in Jupyter, you will see the following rendering diagram. The floor height table is automatically generated, including information such as the embedded floor. At the same time, the corresponding DXF has also been saved in the test.dxf file in the current directory.
各类报告计算书生成工具 ( ReportGenerator )
这是一个用于生成各类文本的工具,目前包括:
- 抗震审查报告(根据 YJK 计算结果生成)
- 混凝土板式楼梯计算书
你可以轻易地从CivilTools.ReportGenerator中导出并使用它:
from CivilTools.ReportGenerator import SeismicReport
report = SeismicReport()
report.creat_doc()
report.save("seismic_review_report.docx")
from CivilTools.ReportGenerator import StairCalculationReport
report = StairCalculationReport()
report.set_stair_data()
report.set_calculate_info()
report.create()
report.save("stair_calculation_sheet.docx")
目前版本中的内容仍待持续完善...
各类数据图片绘制工具 ( FigureGenerator )
这是一个用于绘制各类图标的工具,完善中...
Others
我将持续更新,并且尽快完善本 python 库,如果你有任何问题或者建议,请随时通过邮箱联系我:just_gxy@163.com.
This package will be updated and completed soon.
If you have any questions or suggestion, please let me know.
You may contact with me via e-mail: just_gxy@163.com.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file civil_tools_v-0.0.6.tar.gz.
File metadata
- Download URL: civil_tools_v-0.0.6.tar.gz
- Upload date:
- Size: 52.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33bcd5f3d14b83ded06bc622f0865392bea3964081af5ba26d28558fe4e0e55c
|
|
| MD5 |
ccc8c44be5ce38f94f0fcfee559aa17c
|
|
| BLAKE2b-256 |
bf33069b935df1efa7b70fa192d7874fb901deb78b30902a4334a058f26a38f3
|
File details
Details for the file civil_tools_v-0.0.6-py3-none-any.whl.
File metadata
- Download URL: civil_tools_v-0.0.6-py3-none-any.whl
- Upload date:
- Size: 67.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03f4eb59c7f60eca571b9d4f789e6af0b2d326d0206391ee2d5cb4a540704e0f
|
|
| MD5 |
78cf4a4f9b7b3bd95077572967ec4948
|
|
| BLAKE2b-256 |
316e362d378668eec9b00db58ef85df6475b4e8eb54fdebb4102da09b095a88b
|