Visual studio macro for CATIA
Visual studio macro for CATIA
(OP)
Hello,
i'm starting to look to create macros for catia in visual studio. i have found some disadvantages already. Like only one session of catia should be running, the message box can stay behind of catia window.
My question is, there is any advantages of create macros in visual studio instead of creating them inside catia (CATVBA)?
i'm starting to look to create macros for catia in visual studio. i have found some disadvantages already. Like only one session of catia should be running, the message box can stay behind of catia window.
My question is, there is any advantages of create macros in visual studio instead of creating them inside catia (CATVBA)?





RE: Visual studio macro for CATIA
It has many, many advantages, see bellow a small part of what can be done....the message box can be also put it always in front, search the net for some samples, it can be done in many ways.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
But all the functions of your vídeo can be made with vb6 inside CATIA.
From my research I can adress the following:
-Better vb editor
-You can create "special" toolbars. Better creation of forms.
-Easy to interact with other aplications
-higher code protection, you can delliver only *.exe files, instead of your code.
-the worst for me, only works fine with one CATIA session.
How do you manage several CATIA sessions?
Can you add more advantages/disadvantages?
RE: Visual studio macro for CATIA
http://stackoverflow.com/questions/39331573/regser...
http://stackoverflow.com/questions/26934746/is-it-...
I prefer not to do it
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
RE: Visual studio macro for CATIA
indocti discant et ament meminisse periti
RE: Visual studio macro for CATIA
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
RE: Visual studio macro for CATIA
Sorry for late response, I didn't have CATIA for few days
For what programming environment do you need an example? Catvba, vb.net? I don't have vb6... Can you upload an example and see after that how it can be resolved?
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
If you already grabbed CATIA as COM object, use it for displaying messages
CATIA.MsgBox "Bla bla bla bla", 0, "Title", vbNullString, 0
cilici
RE: Visual studio macro for CATIA
Personally I'm using a customized MessageBox function to stay always in front, no meter what I'm doing in CATIA, till I push a button.
By the way, I've done an update of TST.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
Ferdo TST link please.
RE: Visual studio macro for CATIA
Download link
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
In vb6 i wrote
selection1.Search "((CATPrtSearch.Sketch + CATGmoSearch.Sketch) + CATSpdSearch.Sketch),all"
in visual studio doesn't work. Is it diferent?
RE: Visual studio macro for CATIA
Selection1.Search("CatPrtSearch.Sketch,All")
Works in VS2008
RE: Visual studio macro for CATIA
I'm out of the office now, but on monday morning I will try it.
RE: Visual studio macro for CATIA
I have download your app, and it looks amazing. I had'nt much time to test it but, it's impressive.
I'm starting to make an special app to help me in my daily job. I see that vb.net is slightly diferente from catvba. I'm used to catvba. but from my trials vb.net gives more freedom to make app.
Many thanks
RE: Visual studio macro for CATIA
RE: Visual studio macro for CATIA
What's the advantages?
Ferdo you have made your TST in wich language?
RE: Visual studio macro for CATIA
Sorry for late response, I was out...
I used all versions up to VS2010 including, nothing after that. I'm using vb.net not C# just because is better supported in documentation and I can get more help from different communities. I would love to use C# also but I don't have time now to experiment different things.
You can have different surprises, new releases of VS are not yet supported by DS and there are a lot of changes also in newest releases of CATIA.
I already have some problems with VS2010 running different CATIA releases on my laptop (I have r19, r21, r25, v6r2013x and 3DEx 2017x on cloud) so don't be surprised....you can have also surprises coming from the OS...Win 10 is a little bit different from Win 7
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
But what advantages do you see using c#?
I see that you allready tested it with 3d experience. Does it works in the same way?
RE: Visual studio macro for CATIA
To work with v6 or 3DEx you need to have another approach and again I didn't have so much time to do something with vb.net or VSTA as DS is recomanding (but I done in native CATIA programming tools).
I didn't say there are advantages (peoples have different opinions, pro or against, you can see on Internet this), I said that I would love to do it in C# just because it would be something new for me
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
I hope that in the next few days I have time to share what I'm working on. I have a lot of macro inside CATIA. Some of needs some atention in bug solving, anothers need an upgrade. So i'm trying to convert all macros in a APP, and rebuild some of those. Let's see what I cam build. I'm counting with your help😃.
RE: Visual studio macro for CATIA
I suppose we all can count on their help if we put the right questions.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
RE: Visual studio macro for CATIA
It worked perfectly
RE: Visual studio macro for CATIA
So my problem.
I have mada a selection, from the search function, of parts. then i want to go throw them, and make the partbody in work object.
So I made the following.
Dim myBody As Body
For i = 1 To selection1.Count
part1 = selection1.Item(i).Value
myBody = part1.Bodies.Item("PartBody")
part1.InWorkObject = myBody
Next
and there is an error in, when i=1:
part1 = selection1.Item(i).Value
System.InvalidCastException: 'Unable to cast COM object of type 'System.__ComObject' to interface type 'MECMOD.Part'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{D402D912-39A4-11D1-A26C-0000F87546FD}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).'
any idea to solve this?
Tiago Figueiredo
Tooling Engineer
RE: Visual studio macro for CATIA
RE: Visual studio macro for CATIA
and finally it works :)
Many thanks
Tiago Figueiredo
Tooling Engineer
RE: Visual studio macro for CATIA
Regards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Visual studio macro for CATIA
I've noticed that sometimes, that the API is slow. For example, With api, I'm opening an assembly, and after assembly opening, it runs update and after that is hiding all axis. And between all of this operations, it appears that there is some lag. Between catia is responding, I can make actions on it, and API looks that it's doing something but...
Tiago Figueiredo
Tooling Engineer