@joshM57CN -San.
I used CustomGraphics to display the desired Edges.
# Fusion360API Python script
import traceback
import adsk
import adsk.core as core
import adsk.fusion as fusion
_app: core.Application = None
_ui: core.UserInterface = None
_handlers = []
_edgeIpt: core.SelectionCommandInput = None
_idxIpt: core.BoolValueCommandInput = None
CMD_INFO = {
'id': 'kantoku_test',
'name': 'test',
'tooltip': 'test'
}
class MyCommandCreatedHandler(core.CommandCreatedEventHandler):
def __init__(self):
super().__init__()
def notify(self, args: core.CommandCreatedEventArgs):
try:
global _handlers
cmd: core.Command = core.Command.cast(args.command)
inputs: core.CommandInputs = cmd.commandInputs
onDestroy = MyCommandDestroyHandler()
cmd.destroy.add(onDestroy)
_handlers.append(onDestroy)
onPreview = MyPreviewHandler()
cmd.executePreview.add(onPreview)
_handlers.append(onPreview)
global _edgeIpt
_edgeIpt = inputs.addSelectionInput(
"_edgeIptId",
"Edge",
"Select Edge",
)
_edgeIpt.addSelectionFilter("Edges")
global _idxIpt
_idxIpt = inputs.addBoolValueInput(
"_idxIptId",
"Other Side",
True,
)
except:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
class MyPreviewHandler(core.CommandEventHandler):
def __init__(self):
super().__init__()
def notify(self, args: core.CommandEventArgs):
global _edgeIpt
edge: fusion.BRepEdge = _edgeIpt.selection(0).entity
global _idxIpt
idx = 0 if _idxIpt.value else -1
edges: fusion.BRepEdges = edge.faces[idx].edges
draw_cg_edges(edges)
class MyCommandDestroyHandler(core.CommandEventHandler):
def __init__(self):
super().__init__()
def notify(self, args: core.CommandEventArgs):
adsk.terminate()
def run(context):
try:
global _app, _ui
_app = core.Application.get()
_ui = _app.userInterface
cmdDef: core.CommandDefinition = _ui.commandDefinitions.itemById(
CMD_INFO['id']
)
if not cmdDef:
cmdDef = _ui.commandDefinitions.addButtonDefinition(
CMD_INFO['id'],
CMD_INFO['name'],
CMD_INFO['tooltip']
)
global _handlers
onCommandCreated = MyCommandCreatedHandler()
cmdDef.commandCreated.add(onCommandCreated)
_handlers.append(onCommandCreated)
cmdDef.execute()
adsk.autoTerminate(False)
except:
if _ui:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def draw_cg_edges(edges: fusion.BRepEdges) -> None:
blue = fusion.CustomGraphicsSolidColorEffect.create(
core.Color.create(
0, 0, 255, 255
)
)
app: core.Application = core.Application.get()
des: fusion.Design = app.activeProduct
root: fusion.Component = des.rootComponent
cgGroup: fusion.CustomGraphicsGroup = root.customGraphicsGroups.add()
cgGroup.depthPriority = 1
edge: fusion.BRepEdge = None
for edge in edges:
cgCrv: fusion.CustomGraphicsCurve = cgGroup.addCurve(
edge.geometry
)
cgCrv.color = blue
cgCrv.weight = 2