When multiple CATIA sessions are open GetObject returns the first session. Is it possible to target a specific session CATIA session? I have noticed that when an external program accesses CATIA via COM or the internal VBA editor of CATIA is opened, a child process (CATVBAHostingApplication.exe) starts and stays open. Without terminating this process, the VBA editor cannot be accessed from the second CATIA process. Can anyone explain how CATVBAHostingApplication.exe interacts with CATIA and if it can be manipulated to target a specific instance?
Is it possible to target specific COM Instances of CATIA?
3.2k Views Asked by Jon At
1
There are 1 best solutions below
Related Questions in CATIA
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can target specific instances of CATIA but you have to use the program ID number and some clever coding. What language are you using? From what program are you working? Are you making a stand alone EXE or console app?
Frankly, I have written subs that parse thru the list of running applications and gets this information, but it's a pain. Like when you are accessing multiple instances of Excel, you use the file name that is open, like the workbook in Excel, to access via GetObject. But first you need to do the parsing that I mentioned before.
A much easier approach: Whenever I need multiple instances of Catia open simultaneously, I use CreateObject instead of GetObject, and have my external program launch all my instances.
CATVBAHostingApplication.exe was a [frankly sloppy] solution to maintaining VBA in the 64-bit version of CATIA. VBA in 32-bit CATIA used to be a great thing. Super fast, didn't refresh all the f-ing time, etc etc. Once 64-bits came around, Dassault didn't know what to do with the VBA appendage. So they made this CATVBAHostingApplication.exe to run along side CATIA, and it is slow, needlessly refreshes the CATIA display, and has lots of bugs. It's not uncommon to have your CATVBAHostingApplication.exe running even though you killed CATIA, and when you reopen, the old session is still holding on to your CATVBA files. I probably kill the CATVBAHostingApplication.exe at least three times a day from the Task Manager.
Whenever you initiate some sort of API, whether it be inside of CATIA via ALT+F8 or ALT+F11, or if you connect via COM, this process is always started if you like it or not. There is no workaround. I've programmatically used a similar method I mentioned above to parse the tasks list to programmatically use TaskKill to stop the CATVBAHostingApplication.exe if that is a necessary thing. But for the most part, if I'm connecting via COM, it doesn't matter to the client if that is running until the next time they restart Windows. They aren't usually programming in VBA anyway, just using my plug-ins and modeling manually.
Lastly, I'm not sure why you are connecting to the CATVBAHostingApplication.exe (from what I read in your post), and shouldn't you be connecting to CATIA directly? If you have loaded the references for CATIA, then you don't need to connect to the VBA editor? Maybe I'm misunderstanding. HTH