Reading face details using VB macro
Reading face details using VB macro
(OP)
Hi!
I'm would like to read face details (i.e. face vector, and the origin for that vector). Despite many tyrings, I still don't have the solution.
My latest idea is to use the Face object as is thas the methods get:
Sub CATMain()
Set objSel = CATIA.ActiveDocument.Selection
objSel.Search ("Type=Face,all")
Dim SingleFace As Face
For i = 1 To objSel.Count
Dim oSel As objSel.Item(i)
'?????? What to do furhter??
Next
End Sub
Do you now how to read the data of the face/plane? The required data are stored in Plane object and are accessible through the methods GetFirstAxis and GetPosition.
Regards,
Janusz
I'm would like to read face details (i.e. face vector, and the origin for that vector). Despite many tyrings, I still don't have the solution.
My latest idea is to use the Face object as is thas the methods get:
Sub CATMain()
Set objSel = CATIA.ActiveDocument.Selection
objSel.Search ("Type=Face,all")
Dim SingleFace As Face
For i = 1 To objSel.Count
Dim oSel As objSel.Item(i)
'?????? What to do furhter??
Next
End Sub
Do you now how to read the data of the face/plane? The required data are stored in Plane object and are accessible through the methods GetFirstAxis and GetPosition.
Regards,
Janusz





RE: Reading face details using VB macro
I am not sure exactly what you are looking for, but perhaps this can help you:
CODE --> vba
Sub CATMain() Set objSel = CATIA.ActiveDocument.selection objSel.Search ("Type=Face,all") Dim singleFace Dim axes1(2) Dim axes2(2) Dim origin(2) For i = 1 To objSel.Count Set singleFace = objSel.Item2(i).Value singleFace.GetFirstAxis axes1 singleFace.GetSecondAxis axes2 singleFace.GetOrigin origin Debug.Print "FirstAxis: " & Join(axes1, ",") Debug.Print "SecondAxis: " & Join(axes2, ",") Debug.Print "Origin: " & Join(origin, ",") Next End SubTesak
http://scripts4all.eu/txtoncurve/ - Text along a curve for Catia V5
RE: Reading face details using VB macro
Thanks!
Your tip exactly fulfills my needs.
The only problem is that it works when I have cuboid. When I have cylidner, for example, I receive the message "Object doesn't support this property or method".
Do you have any ideas how to cope with this?
Regards,
Janusz
RE: Reading face details using VB macro
Tesak
http://scripts4all.eu/txtoncurve/ - Text along a curve for Catia V5