link Catia to Matlab
이전 댓글 표시
Hi I'm try to connect Matlab to Catia creating a Catia COM server using the command:
C=actxserver('Catia.Application')
C =
COM.Catia_Application
but after this i can't do anything because matlab doesn't know the catia's properties, infact I tried to used the function:
C.get
I obtain the answer:
1x1 struct array with no fields.
And so i can't use any Catia's functions.
What can I do ?
댓글 수: 1
supriya la
2018년 12월 20일
You can refer some youtube videos.
채택된 답변
추가 답변 (8개)
Friedrich
2011년 9월 6일
4 개 추천
Hi,
The communication with CATIA is tricky. The automation interface is not open so you won’t be able to see it. Even from Visual Basic you can’t see much. So you have to program blind.
The interface which CATIA provide can be found here:
You have to work with the set,get and invoke command from MATLAB to call these functions/ methods (e.g. set(C,'visbile',1))
But not all methods will work, e.g. GetInertia
The input is a passed by reference and MATLAB won’t recognize this and won’t return the values.
I think the best way here is to use VB.net and create a .NET DLL which handles the communication with CATIA. You can use this DLL in MATLAB than. In that way are not limited on the MATLAB side.
댓글 수: 3
Raluca
2013년 2월 21일
Hi,
I am interested also in linking Matlab and Catia. Since it has been a while since the last posts on this topic, could you tell me please if you managed to resolve the problem without having to use an .NET DLL?
farzad
2014년 1월 22일
I am really in search of linking Matlab to Catia to pilot the parameters , or it's better to link MATLAB >> EXCEL >> CATIA ?
Jakob Pettersson
2018년 3월 7일
Hey!
I am also searching for a way to change the parameters in Catia through Matlab. I am also thinking about linking Matlab to Excel to Catia like farzad suggested.
Have you learned anything about this topic farzad?
Alessio
2011년 9월 10일
0 개 추천
댓글 수: 1
Friedrich
2011년 9월 12일
Hi,
why the VB code when you use ML for communicating with CATIA?
Looking at the interface discription of AddComponentsFromFiles it seems you forget an inputargument:
http://www.catiadesign.org/_doc/catia/catia_vb/generated/interfaces/ProductStructureInterfaces/interface_products.htm#AddComponentsFromFiles
So I would guess it should like this:
cubo=invoke(prods1,'AddComponentsFromFiles','D:\LELE\Università\TESI\PROVE\cubo.CATPart','All');
In addition you will get troubles with the CATSafeArrayVariant datatype on the CATIA side since "CATSafeArrayVariant are one-dimensional arrays of CATVariants.":
http://www.catiadesign.org/_doc/catia/catia_vb/generated/interfaces/System/typedef_catsafearrayvariant.htm
MATLAB passes 2dimensional arrays by default. To get MATLAB passing only one dimensional arrays you have to enable it through:
feature('COM_SafeArraySingleDim', 1)
But all this code I would do in the VB side and not on ML.
Hello,
This topic was very useful!
I got a matlab script which sets parameters into CATIA and then saving it. But CATIA doesn't update the parameters before saving. I tried to update the CAD model in MATLAB thanks to :
invoke(catia,'update')
But that didn't work. Does anyone has an idea? Thanks a lot!
yasmine yas
2016년 5월 9일
0 개 추천
heloo plllz help me How can i import design in catia to matlab simulink i found programme which is called SANEON but i don't how it does work . Thank you
카테고리
도움말 센터 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!