catia

Run a Catia macro with a python script

回眸只為那壹抹淺笑 提交于 2019-12-10 11:24:59
问题 I was looking for some help with handling Catia V5 with a python script from the windows PowerShell. I need help building a script that tells Catia to run a macro which I already recorded. Also, some help to find a command that closes or doesn't let message boxes appear would be greatly appreciated. 回答1: If I understand correctly, you're trying to run a recorded CATIA macro (.catvba?) and call it from Python which is called by PowerShell. I'll assume your PowerShell calling Python is working

CATIA macro from python

丶灬走出姿态 提交于 2019-12-08 05:36:02
问题 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'

Create new Product in CATIA with Python

跟風遠走 提交于 2019-12-08 04:13:54
问题 I am automating the creation of a new product with a Python script and have run into a problem with the interactive events getting stuck at the "Part Number" dialog. This does not occur when creating a new part, just a new product. Here is the applicable portion of the script (CATIA is open): import win32com.client.dynamic CATIA = win32com.client.Dispatch("CATIA.Application") catDocs = CATIA.Documents # Create a new product newProductDoc = catDocs.Add("Product") # "Part Number" window appears

Create new Product in CATIA with Python

怎甘沉沦 提交于 2019-12-07 15:30:39
I am automating the creation of a new product with a Python script and have run into a problem with the interactive events getting stuck at the "Part Number" dialog. This does not occur when creating a new part, just a new product. Here is the applicable portion of the script (CATIA is open): import win32com.client.dynamic CATIA = win32com.client.Dispatch("CATIA.Application") catDocs = CATIA.Documents # Create a new product newProductDoc = catDocs.Add("Product") # "Part Number" window appears, requesting a name for the product # Interactive processes will not proceed newProduct = newProductDoc

CATIA macro from python

跟風遠走 提交于 2019-12-07 08:15:25
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\python36-32\Anaconda\Install\lib\site-packages\win32com

Run a Catia macro with a python script

♀尐吖头ヾ 提交于 2019-12-06 14:13:34
I was looking for some help with handling Catia V5 with a python script from the windows PowerShell. I need help building a script that tells Catia to run a macro which I already recorded. Also, some help to find a command that closes or doesn't let message boxes appear would be greatly appreciated. If I understand correctly, you're trying to run a recorded CATIA macro (.catvba?) and call it from Python which is called by PowerShell. I'll assume your PowerShell calling Python is working as intended. Here's one way to bridge the gap between Python and CATIA VBA: Bind your CATIA macro to a

VBA composition for java-like inheritance

一世执手 提交于 2019-12-06 11:05:55
问题 Expanding a bit on this question VBA inheritance pattern I'm reproducing a basic inheritance pattern in VBA, but I would like to understand If there is a more efficient and terse way to accomplish that. Consider this little test-case. IAnimal.cls 'declaration Public Sub eat() End Sub Public Sub breathe() End Sub Animal.cls : the superclass Implements IAnimal ' method implementation Private Sub IAnimal_eat() Debug.Print "I'm eating something..." End Sub Private Sub IAnimal_breathe() Debug

VBA composition for java-like inheritance

狂风中的少年 提交于 2019-12-04 15:00:18
Expanding a bit on this question VBA inheritance pattern I'm reproducing a basic inheritance pattern in VBA, but I would like to understand If there is a more efficient and terse way to accomplish that. Consider this little test-case. IAnimal.cls 'declaration Public Sub eat() End Sub Public Sub breathe() End Sub Animal.cls : the superclass Implements IAnimal ' method implementation Private Sub IAnimal_eat() Debug.Print "I'm eating something..." End Sub Private Sub IAnimal_breathe() Debug.Print "I'm brething..." End Sub Cat.cls : a subclass of Animal Private super As IAnimal Implements IAnimal

CATIA VBA Enable use of “Scripting.Dictionary” in .CATScript

别等时光非礼了梦想. 提交于 2019-12-04 05:51:52
问题 When running a .CATScript whose code was copied from the VBA environment and functions as intended when run in the VBA environment I get the following error: The scripting engine has reported the following error: Source: Microsoft VBScript runtime error Description: Variable is undefined: 'Scripting' Line: 9 Column: 4 How can I have this script use the "Microsoft Scripting Runtime" reference library? 回答1: Your solution should work. To be able to use "Scripting.Dictionary" in VBA, go to Tools-

Getting a specific instance of COM object in VB.Net

六月ゝ 毕业季﹏ 提交于 2019-12-03 17:09:34
I am writing a Windows Form application in .Net to list all running instances of a third-party CAD/CAM software (in this case CATIA) and let user to choose one of them to perform couple of automated tasks. For performing automated tasks, I need to get the specific instance of COM objects - compared to Getobject() which gives me a non-specific COM instance. Is there a way to get a specific COM instance using window handle or any other methods? UPDATE: As Raymond said there is no single solution for all COM objects; however I managed to get CATIA COM objects using following code (Which uses ROT