pointm / PythonWithCST

This is a repository for modeling using Python to manipulate the CST. 这是一个用Python操纵CST进行建模的库。
4 stars 0 forks source link
api module python

PythonWithCST

This is a repository for modeling using Python to manipulate the CST.

这是一个用Python操纵CST进行建模的库。(没错都是机翻)

在进行测试的时候,Python的版本是3.11.4,CST的版本是2022版

本仓库的灵感来源于这个仓库,这个B站教程以及这个CSDN教程

他们的代码都很有启发性,但是CSDN教程只能在PYTHON老版本(具体来说,是python的3.6到3.9版本)才能运行,B站的教程能在高版本python运行,可以实现参数化建模,但是在进行扫参等操作的时候还是需要借助上面所提到的GitHub库里面提到的COM控件的方法进行操作。

This repository was inspired by this repository , this bilibili tutorial , and this CSDN tutorial

Their code is very enlightening, but CSDN tutorials can only run in older versions of Python (specifically, Python 3.6 to 3.9) , and bilibili tutorials can run in higher versions of Python, parameterized modeling can be achieved, but it is necessary to use the above-mentioned GitHub library in order to scan parameters and other operations of the COM control method.

使用(Usage)

请在运行之前确保自己的CST与Python已经安装正确~

Please make sure you have CST and Python installed correctly before you run it~!

现在集成的代码与VBA语句比较少,直接运行ExampleOfMicrowaveWindow.py模块即可预览里面的一个样例,具体的作用是会在文件当前的路径生成一个微波窗并且将里面的S参数绘制出图形。如果想要使用里面的类或者方法的话,直接将文件与Modeling.py放在同一个子文件夹里,然后from Modeling import *就可以了。

Now that the integrated code has fewer VBA statements, you can run the ExampleOfMicrowaveWindow.py module directly to preview one of its samples, which will generate a microwave window at the current path of the file and draw a graph with the S parameter inside. If you want to use any of the classes or methods in the module, place the file in the same subfolder as Modeling.py, and then from Modeling import *.

如何创建一个cst的文件和如何导入参数的话,直接参考ExampleOfWaveGuide.py文件就行啦。当然后续的话我也会考虑把这些比较重要的功能的使用方式添加到README.md里面的。

For how to create a cst file and how to import parameters, just refer to the main file in Modeling.py. Of course, I will consider adding the usage of these important functions to README.md.

如果有什么想要加的内容的话,欢迎提意见或者创建新的仓库分支!

If there's anything you'd like to add, feel free to comment or create a new branch of the repository!

现阶段BUG(Current Bugs)

后续想添加的一些功能(ToDoList)

尽量把建模部分做好吧。说实话,现在集成的VBA语句还是比较少,希望后续添加更多有用的东西。比如说通过扫描线按照轨迹进行扫描然后形成一个面之类的。

Let's try to get the modeling part right. To be honest, there are still relatively few VBA statements integrated, so I hope more useful things will be added. Like following a trajectory through a scan line and then forming a face or something like that.

注意(Attention)