catia

C# Windows Service COM exception 80080005 when starting application

扶醉桌前 提交于 2019-12-29 07:17:15
问题 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

C# Windows Service COM exception 80080005 when starting application

我怕爱的太早我们不能终老 提交于 2019-12-29 07:17:09
问题 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

How to control a 3D model via the API in Catia

天大地大妈咪最大 提交于 2019-12-25 06:39:23
问题 I have the following scenario: i am building a animatronic hand using some flex sensor, arduino board and 5 servo. No problem on this side. But i have the following idea: to build a 3D CAD model of the hand in Catia, and in real time the virtual hand to copy the movements of the real hand in real time. I used something in Matlab when i did some plots in real time with some data from some sensor. It is posible to do that in Catia? To get the data from arduino and based on that data to simulate

Catia VBA to .CATScript for type “Collection”

左心房为你撑大大i 提交于 2019-12-20 05:10:50
问题 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

How to change sketch support in CATIA using vba?

为君一笑 提交于 2019-12-12 03:18:16
问题 I want to Change a sketch Support from one plane to another in macro. I tried with StartCommand but that did not work. How can this be done without user Input? I have tried the following code but it did not work. CATIA.StartCommand "Change Sketch Support" selection1.Add sketch3 SendKeys "{ENTER}", True selection1.Add Plane_a SendKeys "{ENTER}", True part1.Update 回答1: This link says to select the sketch then select the plane and run StartCommand "Change Sketch Support" 'Get the part object

Design a Part in Catia by clicking an Excel Button

╄→尐↘猪︶ㄣ 提交于 2019-12-12 02:16:47
问题 I already wrote some Macros in Catia V5 built in Macro Editor, but i can't figure out how to access Catia commands from Excel. I would like to know how can I create for instance a simple straight cylinder by only having in the excel file cylinder's radius and length. I want to make different pressure vessels in Catia by entering their diameter and height in Excel and after clicking on a button in that excel sheet the vessel should appear in Catia. I have no problem if I already need to have

CatiaV5 macro: how to insert background view?

僤鯓⒐⒋嵵緔 提交于 2019-12-11 14:17:42
问题 I'm making a macro to automatically open a new drawing on the correct sheet format with filled in title block but I can't seem to figure out how to insert a pre-made .CATDrawing in the same way the following option in the page setup dialog box would: see here: https://i.imgur.com/goClGIh.png my current progress looks like this: Sub CATMain() Dim partDoc As PartDocument Set partDoc = CATIA.ActiveDocument Dim myParam As Parameter Set myParam = partDoc.Part.parameters.Item("Description") Dim

Change cut view text in CATIA

你。 提交于 2019-12-11 11:54:02
问题 I'm currently working with CATIA V5, and I want to use Macros (VBA), but I have some problems! My question is: how to change the text of a cut view? (see the picture) I tried to use : myView.Texts.item(1) to access to this "text" but I think that CATIA dont consider it as text ... I want to change this text without the intervention of the user ( without selections), can I do that? 回答1: IME, VBA scripting in drafting workbench is quite tricky at first..."MyTexts" is a collection of DrawingText

Catia VBA - Automation Error Get Object

浪子不回头ぞ 提交于 2019-12-11 06:19:44
问题 I am getting an Automation error, when Catia is trying to write values in a selected Excel sheet. It's a bit confusing because on the first try of the code there was no error and the values were in the Excel sheet. I didn't change the code, but on the second try I get: Run-time error '-2147417846 (8001010a)': Automation error "The Message filter indicated that the application is busy." on the line: Set MyXL = GetObject(FPath) Sub CATMain() FPath = CATIA.FileSelectionBox("Select the Excel file

CATIA V5 VBA: get CATPart linked documents

混江龙づ霸主 提交于 2019-12-10 12:11:24
问题 Is there a way for a catscript/catvbs/catvba to access all the Pointed Documents of a CATPart? I need to retrieve a list of all the Pointed Documents filepaths (similarly to what an interactive user gets with the menu View-->Edit Links-->Pointed Documents tab) CATIA V5 Automation seems to expose such APIs only for CATDrawings. For each DrawingView object you can get the Pointed Document with: PointedDocFullPath = MyDrawingView.GenerativeBehavior.Document.Parent.FullName But , how can I get