当前位置:网站首页>CAD to WPF: Tips on converting CAD drawing files to WPF vector code files (xaml files)
CAD to WPF: Tips on converting CAD drawing files to WPF vector code files (xaml files)
2022-08-10 09:01:00 【dotNET cross-platform】
Foreword: In the following article, I will use a few very simple steps to demonstrate the method of converting CAD drawings to XAML code files for reference.
1. In order to demonstrate a simple operation, I will first open a blank CAD here and use it to draw the point content later.
Second, custom draw something casually, including three rectangles, three circles, an ellipse, and a spiral pattern, as well as a line of text, which is used as a test.
3. After the drawing is completed (in normal use, it may be directly after opening the CAD drawing), select File -> Save As, and save the drawing as a .dxf format file for subsequent AI tools to open.
Fourth, use AI tools to open .dxf files
[Remarks] Since the borders are all set to 1px when opened here, the three circles are thinner, please ignore this detail.
5. After the AI tool is opened, select File - Export to .xaml format.Under normal circumstances, it can be exported to silverlight and wpf. Here we choose to export to the xaml format supported by wpf.
[Remarks] The path exported by AI cannot contain Chinese, otherwise the export may be unsuccessful.
6. After the export is successful, in the export directory, you can see that a code file in .xaml format is generated.
Seven, open the text file and take a look, you can see the familiar xaml tag code, which is contained by the
8. Create a new WPF project. At present, the main form does not have any elements. Can the xaml code generated for subsequent testing be used.
9. Copy all the code of the exported xaml code file to the main form, and you can see that the main form designer automatically displays the effect of the element.Basically the same as the CAD drawing.
10. Let's run the program to see the effect after startup, as shown in the figure below, indicating that the exported code can be used directly and meets expectations.
11. For AI tools that do not have the option to export to WPF, a plug-in needs to be added.Plugin download address: http://mikeswanson.com/xamlexport/
The download address opens the following page, as shown in the figure below, a very detailed usage method has been prompted, and you can place the plug-in according to the prompt information.
12. The downloaded plug-in will have two aip files after decompression, one is supported by the MAC system and the other is supported by the Windows system, as shown in the figure below, stored in the plug- under the installation directory of the AI toolins folder.
[Remarks] If the AI installation is a cracked version or is not the default installation path, it may recognize that the plug-in is unsuccessful. For example, when opening the AI program, it may prompt "ai failed to load the plug-in".Category.
The above is the entire content of this article, thank you for your support.I wish the big guys a happy coding~~
If it helps, please like, repost, and watch.
边栏推荐
猜你喜欢
不要把公司当成家,被通知裁员时会变得不幸...
[System Design] S3 Object Storage
原型和原型链
How to use [jmeter regular expression extractor] to solve the problem of returning the value as a parameter
DAY26:GetShell专题
BUUCTF problem solving PWN 】 【 record (4-6 pages continuously updated)
DeepFake换脸诈骗怎么破?让他侧个身
mySQL add, delete, modify and check advanced
Flink快速上手 完整使用 (第二章)
Flink部署 完整使用 (第三章)
随机推荐
dayjs-----time format
2022-08-09:以下go语言代码输出什么?A:否,会 panic;B:是,能正确运行;C:不清楚,看投票结果。
The implementation of the seemingly useless component (text gradient) in NaiveUI is so simple
关于判断单峰数组的几种方法
JVM探究
打工人的第27天-平凡但不平淡的日子
Different command line styles
A File Online Query Display and Download Function Realized by Delphi
FPGA时钟篇(三) MRCC和SRCC的区别
js-----数组转换成树形结构
【Enterprise Architecture】Agile and Enterprise Architecture: Strategic Alliance
Obtain - 65 [chances] : "soldiers, subtlety also - 7-36 meter reading - defeat
ARM结构体系3:ARM指令的寻址和异常中断处理
微信小程序--》小程序生命周期和WXS使用
MUDA:对齐特定域的分布和分类器以实现来自多源域的跨域分类
OLTP and OLAP database architecture 】 【 : actual comparison
Ask next CDC mysql to Doris. Don't show the specific number of lines, how to do?
【业务架构】价值链分析:提高客户价值和盈利能力
人
I don't want to do accounting anymore, Die changed to a new one, moved forward bravely, and finally successfully passed the career change test to double his monthly salary~