当前位置:网站首页>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.
边栏推荐
猜你喜欢
随机推荐
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~
00后女孩月薪3200,3年买两套房,这个程序员变现新风口千万要把握住
CAD转WPF: 关于CAD图纸文件转换为WPF矢量代码文件(xaml文件)的技巧
Flink运行时架构 完整使用 (第四章)
Mongo的简单操作-数据库用户的查询、创建与删除
UGUI—事件,iTween插件
封装和使用通用的工具栏组件
FPGA的虚拟时钟如何使用?
乐观锁与悲观锁
DeepFake换脸诈骗怎么破?让他侧个身
【Unity入门计划】2D游戏实现敌人来回移动控制脚本
[Learn Rust together | Advanced articles | RMQTT library] RMQTT message server - installation and cluster configuration
Johnson全源最短路
ARM体系结构2:处理器内核和汇编指令集
并发的基本概念,操作,容器
debezium-connector-mysql拉起docker报错:debezium启动docke
Question brushing tool h
郭晶晶家的象棋私教,好家伙是个机器人
不想再干会计了,蝶变向新,勇往直前,最后成功通过转行测试实现月薪翻倍~
DAY25: Logic vulnerability recurrence