import topologic from topologic import Vertex, Edge, Wire, Face, Shell, Cell, CellComplex, Cluster, Topology, FaceUtility import cppyy def classByType(argument): switcher = { 1: Vertex, 2: Edge, 4: Wire, 8: Face, 16: Shell, 32: Cell, 64: CellComplex, 128: Cluster } return switcher.get(argument, Topology) def fixTopologyClass(topology): topology.__class__ = classByType(topology.GetType()) return topology # Change the file path to match your file location filepath = "D:\\WasInDesktop\\CellComplex.brep" file = open(filepath) brepString = file.read() topology = fixTopologyClass(topologic.Topology.DeepCopy(Topology.ByString(brepString))) file.close() print(topology) faces = cppyy.gbl.std.list[Face.Ptr]() _ = topology.Faces(faces) print(faces) for face in faces: cells = cppyy.gbl.std.list[Cell.Ptr]() _ = FaceUtility.AdjacentCells(face, topology, cells) print(len(cells))