Use C# for Catia V5 Automation(使用 C# 实现 Catia V5 自动化)
问题描述
我想用编程语言 C# 为 Catia V5 编写宏/程序.
I want to write Macros/Programs for Catia V5 with the programming language C#.
如何通过 c#(和 Visual Studio)访问 Catia 应用程序.我搜索了一下,发现 Catia 提供了一个 API,Microsoft COM Technologie 为像 c# &蟒蛇.
How is it possible to access the Catia applicataion via c#(and Visual Studio). I searched a bit and found out that Catia provides an API, which the Microsoft COM Technologie provides for 'COM-languages' like c# & python.
这就是我想象的 C# 程序和 Catia 之间的连接/交互方式:
This is how I imagine the connection/interaction between a C# Programm and Catia:
C# - .NET <-双向集成-> COM <-> Catia API
对吗?
另外:如何在 Visual Studio 中设置所有内容,以便可以访问 Catia API(和代码完成等)
Also: How do I setup everything in Visual Studio , so that I can access the Catia API (and code completion etc.)
推荐答案
1) 在引用中添加INFITF typelib库,作为CATIA应用程序的接口
1) Add INFITF typelib library in reference which is interface to CATIA application
2) 像这样将CATIA定义为全局变量
2) Define CATIA as global variable as like
INFITF.Application CATIA;
3) 将 catia 应用程序绑定到您的 CATIA 变量,如下所示
3) Bind the catia application to your CATIA variable as below statement
CATIA = (INFITF.Application)Marshal.GetActiveObject("Catia.Application");
希望这可以帮助您入门.
Hope this would helps you to get started.
这篇关于使用 C# 实现 Catia V5 自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 C# 实现 Catia V5 自动化
基础教程推荐
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
