Thu, 08/01/2024 - 11:53
Hi, i am using the following code to get the faces from CATIA, but I don't know how can i calculate the normals for these faces.
There is so way to first convert the CATPart to stp and then use python occ (GProp_GProps) but i don't want to use that method.
import win32com.client
def search_items(searchString):
"""
"""
app = win32com.client.dynamic.Dispatch('CATIA.Application')
objSel = app.ActiveDocument.Selection
# objSel.Clear()
# colour=[158, 26, 100]
objSel.Search(searchString)
items=[]
for i in range(1,objSel.count+1):
items.append( objSel.item(i).value)
# objSel.Clear()
return items
def get_all_faces():
"""
"""
faces=search_items("Type = Face,scr")
return faces
catia = win32com.client.dynamic.Dispatch('CATIA.Application')
# Get the active document
document = catia.ActiveDocument
faces=get_all_faces()