catia

Use C# for Catia V5 Automation

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to write Macros/Programs for Catia V5 with the programming language 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. This is how I imagine the connection/interaction between a C# Programm and Catia: C# - .NET <-bi-directional integration-> COM <-> Catia API Is that correct ? Also: How do I setup everything in Visual Studio , so that I can access the Catia API

Use C# for Catia V5 Automation

我只是一个虾纸丫 提交于 2019-12-03 09:54:36
I want to write Macros/Programs for Catia V5 with the programming language 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. This is how I imagine the connection/interaction between a C# Programm and Catia: C# - .NET <-bi-directional integration-> COM <-> Catia API Is that correct ? Also: How do I setup everything in Visual Studio , so that I can access the Catia API (and code completion etc.) Selin Raja M 1) Add INFITF

CATIA macro from python

匿名 (未验证) 提交于 2019-12-03 01:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to use my macro (.CATScript) to open the catia interface and make the changes listed in the macro script to the .CATpart and give output as .stp file. Is it possible to use python to realise this function? There was an example in Run a Catia macro with a python script , but it didn't work in my case. I edited the code as below and gave it a run. import win32com.client catapp = win32com.client.Dispatch("CATIA.Application") catapp.StartCommand('Macro_schweller_model_lsopt.CATScript') The error I had was File "C:\FK-Programme

Instantiate PowerCopy in CATIA V5R19 using VBA macros

£可爱£侵袭症+ 提交于 2019-12-02 15:56:09
问题 I cant figure out how to instantiate Power-copy using VBA macro. I have a CATPart1, that have Power-copy name "MyPC". And I want to instantiate this power-copy in current Part. Just for example, this Power-copy inputs are: "Plane", "Start_point" and "End_point". I found in "CAA V5 VB help" that there are InstanceFactory object, that have methods to instantiate power-copy and UDFs. But my code doesn't work. Sub CATMain() Dim partDocument1 As partDocument Set partDocument1 = CATIA

Instantiate PowerCopy in CATIA V5R19 using VBA macros

ⅰ亾dé卋堺 提交于 2019-12-02 12:45:31
I cant figure out how to instantiate Power-copy using VBA macro. I have a CATPart1, that have Power-copy name "MyPC". And I want to instantiate this power-copy in current Part. Just for example, this Power-copy inputs are: "Plane", "Start_point" and "End_point". I found in "CAA V5 VB help" that there are InstanceFactory object, that have methods to instantiate power-copy and UDFs. But my code doesn't work. Sub CATMain() Dim partDocument1 As partDocument Set partDocument1 = CATIA.ActiveDocument Dim part1 As part Set part1 = partDocument1.part Dim hybridBodies1 As HybridBodies Set hybridBodies1

Catia VBA to .CATScript for type “Collection”

别等时光非礼了梦想. 提交于 2019-12-02 04:35:30
In my VBA code i'm using the following: Dim docsToSave As Scripting.Dictionary Set docsToSave = New Scripting.Dictionary Dim toRemove As Collection Set toRemove = New Collection ... More Code ... For i = 1 To toRemove.Count docsToSave.Remove (toRemove.Item(i)) Next The nice thing about Collections compared to Dictionaries is that you can retrieve keys by using their item numbers. My problem is that I need to convert my VBA-code to CATScript (similar to VBScript). I don't think it's easy to get a code as simple as the above for subtracting one list of "key, item" from another list. What's the

C# Windows Service COM exception 80080005 when starting application

▼魔方 西西 提交于 2019-11-29 08:37:40
I have created a Windows Service that try to start an application (in this case CATIA). I use the following code: private Application GetApplicationObject(string ProgId) { Application AppObject = null; //Try to get allready open instance of the Application try { AppObject = (Application)Marshal.GetActiveObject(ProgId); } catch { //Create a new instance of the Application instead AppObject = (Application)Activator.CreateInstance(Type.GetTypeFromProgID(ProgId)); } return AppObject; } I get the following error when my Service try to start the application: System.Runtime.InteropServices