@ChaosComb さん こんにちは。
これは9月のUpdateで発生しているバグです。
取りあえずテキストコマンドを呼び出して対応出来るサンプルです。
# Fusion360API Python script
import traceback
import adsk.fusion
import adsk.core
def run(context):
ui = adsk.core.UserInterface.cast(None)
try:
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
des: adsk.fusion.Design = app.activeProduct
root: adsk.fusion.Component = des.rootComponent
# 拡張メソッド
adsk.fusion.Sketch.projectLike = projectLike
# スケッチ作成
skt: adsk.fusion.Sketch = root.sketches.add(
root.xYConstructionPlane
)
# スケッチ-+プロジェクト
skt.projectLike(root.bRepBodies[0].faces[1])
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def projectLike(
self: adsk.fusion.Sketch,
entity) -> adsk.core.ObjectCollection:
tokens = [c.entityToken for c in self.sketchCurves]
tokens.extend([p.entityToken for p in self.sketchPoints])
entities = None
if hasattr(entity, "__iter__"):
entities = entity
else:
entities = [entity]
app: adsk.core.Application = adsk.core.Application.get()
sels: adsk.core.Selections = app.userInterface.activeSelections
sels.clear()
sels.add(self)
app.executeTextCommand(u'Commands.Start SketchActivate')
sels.clear()
app.executeTextCommand(u'Commands.Start ProjectNewCmd')
app.executeTextCommand(u'Commands.SetString infoFilterType {}'.format('infoFilterTypeEntities'))
[sels.add(e) for e in entities]
app.executeTextCommand(u'NuCommands.CommitCmd')
app.executeTextCommand(u'Commands.Start SketchStop')
projectedEntities = [c for c in self.sketchCurves if not c.entityToken in tokens]
projectedEntities.extend([p for p in self.sketchPoints if not p.entityToken in tokens])
pros: adsk.core.ObjectCollection = adsk.core.ObjectCollection.create()
[pros.add(e) for e in projectedEntities]
return pros
添付したデータで実行すると、こんな感じでリンク付きのスケッチ要素が出来ます。

欠点としては、テキストコマンドの場合GUIで作業を行う事に近い為、
画面が動いてしまうことと、選択している要素が有った場合、未選択で
終了してしまう事です。(あと、処理が遅い)
時期は分かりませんが、何れ修正されるはずなので、修正された際は
def run(context):
ui = adsk.core.UserInterface.cast(None)
try:
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
des: adsk.fusion.Design = app.activeProduct
root: adsk.fusion.Component = des.rootComponent
# 拡張メソッド
# adsk.fusion.Sketch.projectLike = projectLike
# スケッチ作成
skt: adsk.fusion.Sketch = root.sketches.add(
root.xYConstructionPlane
)
# スケッチ-+プロジェクト
# skt.projectLike(root.bRepBodies[0].faces[1])
skt.project(root.bRepBodies[0].faces[1])
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
この様に修正するだけで済むように、projectLike関数を作っています。
(引数と戻り値は一致させています)