テキストの向きを・・・難しいです。
こちらをちょっとだけ考えています。
handle text orientation ? - Autodesk Community
同じテキストでも、見る方向の影響があり
逆だ逆だって言っても”どっちから見た時の話なの?”
と言う気持ちになります。
一応、確認用のスクリプトを作成してみました。
# Fusion360API Python script import traceback import adsk.fusion import adsk.core import math 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 planes = [ root.xYConstructionPlane, root.yZConstructionPlane, root.xZConstructionPlane, ] [initSketchText(p) for p in planes] except: if ui: ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) def initSketchText( plane: adsk.fusion.ConstructionPlane): comp: adsk.fusion.Component = plane.parent skt: adsk.fusion.Sketch = comp.sketches.add(plane) sktLines: adsk.fusion.SketchLines = skt.sketchCurves.sketchLines # p1: adsk.core.Point3D = adsk.core.Point3D.create(0, 0, 0) # uVec: adsk.core.Vector3D = plane.geometry.uDirection # uVec.scaleBy(2) # p1.translateBy(uVec) # p1 = skt.modelToSketchSpace(p1) # sktLines.addByTwoPoints(adsk.core.Point3D.create(0, 0, 0), p1) # p2: adsk.core.Point3D = adsk.core.Point3D.create(0, 0, 0) # vVec: adsk.core.Vector3D = plane.geometry.vDirection # vVec.scaleBy(5) # p2.translateBy(vVec) # p2 = skt.modelToSketchSpace(p2) # sktLines.addByTwoPoints(adsk.core.Point3D.create(0, 0, 0), p2) skt.isComputeDeferred = True angle = 10 mat: adsk.core.Matrix3D = adsk.core.Matrix3D.create() mat.setToRotation( math.radians(angle), # plane.geometry.uDirection.crossProduct(plane.geometry.vDirection), adsk.core.Vector3D.create(0, 0, 1), adsk.core.Point3D.create(0, 0, 0), ) p1: adsk.core.Point3D = adsk.core.Point3D.create(5, 0, 0) p2: adsk.core.Point3D = adsk.core.Point3D.create(15, 0, 0) pnts = [(p1, p2)] for _ in range(int(360 / angle)): p1.transformBy(mat) p2.transformBy(mat) pnts.append((p1.copy(), p2.copy())) guides = [sktLines.addByTwoPoints(p1, p2) for p1, p2 in pnts] texts: adsk.fusion.SketchTexts = skt.sketchTexts input = texts.createInput2('Text Along a Curve', 0.75) for guide in guides: input.setAsAlongPath( guide, True, adsk.core.HorizontalAlignments.CenterHorizontalAlignment, 0 ) texts.add(input) skt.isComputeDeferred = False
無くしちゃいそうなので、バックアップとして残しておくのが
本音です。