Hello,
If you have more data about the face you are going to select, you can walk through all faces and compare data of every face to the date of selected data. If they match, the face will what you want to select.
You can probably get data of a cylinder face by "BRepFace.geometry and Cylinder.getData()" APIs. Please refer to the following sample codes:
import adsk.core, adsk.fusion, traceback
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
face = adsk.fusion.BRepFace.cast(ui.activeSelections.item(0).entity)
cylinderface = adsk.core.Cylinder.cast(face.geometry)
if cylinderface:
res, origin, axis, radius = cylinderface.getData()
ui.messageBox('origin: ({}, {}, {}), axis: ({}, {}, {}), radius: {}'.format(origin.x, origin.y, origin.z, axis.x, axis.y, axis.z, radius))
else:
ui.messageBox('It is not cylider face.')
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Thanks,
Marshal
Marshal Tu
Fusion Developer
>