Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing macro for CATIA if CATIA is not installed on computer 1

Status
Not open for further replies.

Azzazil

Automotive
Feb 1, 2020
95
HR
I am curious is it possible to write macro for CATIA if I have installed Visual Sutdio but don't have installed CATIA, also is possible to have IntelliSense with CATIA references when I am writing macro? When I have access for CATIA in my company I will test macro there.
 
Replies continue below

Recommended for you

Yes.

You can do it without any references by using late binding (dynamic keyword in c#).

If you want intellisense then copy all .tlb files from CATIA's code/vin directory to your computer and use them as references.
 
Thanks Little Cthulhu will try to use .tlb files as reference, if I stuck will as for help on this :).
 
Hm I get .tlb files for 3D Experience and I manage to import some of the files as reference some not. For one that I couldn't get references I got error message "Please make sure that the file is accessible and that it is a valid assembly or COM component". This is strange because it looks to me that one that are referenced to CATIA V5 I manage to import the ones that are referenced to 3DExperince I couldn't import.
 
Run tlbimp.exe utility on a computer that have CATIA installed and copy output interop dlls to yours
 
Thanks I manage to convert them all, but somewhere I got message

TlbImp : warning TI3008 : Type 'StrReference' is invalid and may only be partially converted.
TlbImp : warning TI3008 : Type 'StrRefOffset' is invalid and may only be partially converted.
TlbImp : warning TI3008 : Type 'StrService' is invalid and may only be partially converted.
TlbImp : Type library imported to StrTypeLib.dll

Should I be concerned with this message that type is invalid and only partially converted? Will try know is my script working on 3DX, and see if there will be any issues.
 
Little Cthulhu thanks a million I test it and it works smoothly :). Also have one question more, since I have now my script as exe file can I import exe file and connect it somehow to CATIA and have it like icon in toolbar?
 
CATIA tlbs have dependecies from each other so you should run tlbimp in correct order and provide path to already generated dlls with /reference argument.

Also provide /asmversion argument and then check that all of resulting dlls have version specified. If any have 0.0.0.0 version then you've missed a dependency and .net has generated dll overwriting one of yours.

Connecting .exe to CATIA is a subject for a separate thread although I'm sure this question has been answered numerous times.
 
Thanks I will try to check with argument /asmversion this week when I have time but for now I manage to import them and so far I didn't notice any issues.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top