<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SketchTexts.createInput2 Method Height Parameter Not Applied in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10355276#M8787</link>
    <description>&lt;P&gt;Any workaround suggestions for this please?&lt;/P&gt;&lt;P&gt;Even manually setting .height is ignored. I have a client who replies on this to produce work and now they cannot produce anything of use.&lt;/P&gt;&lt;P&gt;Can the createInput2 be scaled/corrected to the specified height value, using the api?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Urgently need to deploy a fix for this bug please, if anything can be suggested till its fixed in the next update?&lt;/P&gt;</description>
    <pubDate>Tue, 01 Jun 2021 12:24:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-01T12:24:36Z</dc:date>
    <item>
      <title>SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10339851#M8785</link>
      <description>&lt;P&gt;I have been working on a script for some time that sketches text using similar code as found in this example: &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-a611130a-a957-11e5-ac5a-f8b156d7cd97" target="_blank" rel="noopener"&gt;Sketch Text API Sample API Sample&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think I broke anything in my code and it seems like it might be coincidentally tied to the recent update that allows managing text height via parameters (a great update BTW!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did the update maybe break something in the API or is there something else I need to do to set the font height? If I run this script, no matter what I set the height parameter to, I always get a 10mm high font.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code is the same as the sample linked above but fixes an error related to the rootComp variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try: 
        app = adsk.core.Application.get()
        ui = app.userInterface

        doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        design = app.activeProduct

        # Get the root component of the active design.
        rootComp = design.rootComponent

        # Create a new sketch on the XY construction plane.
        sk = rootComp.sketches.add(rootComp.xYConstructionPlane)

        # Get the SketchTexts collection object.
        texts = sk.sketchTexts

        # Add multi-line text.
        input = texts.createInput2('This is a long line that is broken automatically.\n\nAnd this is a defined line break.', 0.5)
        input.setAsMultiLine(adsk.core.Point3D.create(0, 0, 0),
                             adsk.core.Point3D.create(10, 5, 0),
                             adsk.core.HorizontalAlignments.LeftHorizontalAlignment,
                             adsk.core.VerticalAlignments.TopVerticalAlignment, 0)
        texts.add(input)

        # Draw an arc to use to create text along a curve.
        arc = sk.sketchCurves.sketchArcs.addByThreePoints(adsk.core.Point3D.create(-10, 0, 0),
                                                          adsk.core.Point3D.create(-5, 3, 0),
                                                          adsk.core.Point3D.create(0, 0, 0))

        # Create text along the arc.
        input = texts.createInput2('Text Along a Curve', 0.75)
        input.setAsAlongPath(arc, False, adsk.core.HorizontalAlignments.CenterHorizontalAlignment, 0)
        input.isHorizontalFlip = True
        input.isVerticalFlip = True
        input.fontName = 'Comic Sans MS'
        texts.add(input)        
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 02:19:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10339851#M8785</guid>
      <dc:creator>edjohnson100</dc:creator>
      <dc:date>2021-05-26T02:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10340581#M8786</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5500792"&gt;@edjohnson100&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Definitely it something looks like latest update with the text causes the issue. Its been reported to the team and they are looking into it.&lt;/P&gt;
&lt;P&gt;Thanks for reporting this&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 09:58:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10340581#M8786</guid>
      <dc:creator>boopathi.sivakumar</dc:creator>
      <dc:date>2021-05-26T09:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10355276#M8787</link>
      <description>&lt;P&gt;Any workaround suggestions for this please?&lt;/P&gt;&lt;P&gt;Even manually setting .height is ignored. I have a client who replies on this to produce work and now they cannot produce anything of use.&lt;/P&gt;&lt;P&gt;Can the createInput2 be scaled/corrected to the specified height value, using the api?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Urgently need to deploy a fix for this bug please, if anything can be suggested till its fixed in the next update?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 12:24:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10355276#M8787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-01T12:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10355645#M8788</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently, I think the only way to do this is to use TextCommands.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;・・・
        input.fontName = 'Comic Sans MS'
        txt = texts.add(input)

        changeTxtHeight(txt, 0.75)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def changeTxtHeight(
    txt :adsk.fusion.SketchText,
    height :float):

    if txt.height == height:
        return

    app = adsk.core.Application.get()
    ui = app.userInterface
    sels :adsk.core.Selections = ui.activeSelections

    skt :adsk.fusion.Sketch = txt.parentSketch
    sels.clear()
    sels.add(skt)
    app.executeTextCommand(u'Commands.Start SketchActivate')

    sels.clear()
    sels.add(txt)
    cmds =[
        u'Commands.Start EditMTextCmd',
        u'Commands.SetDouble TextHeight {}'.format(height),
        u'NuCommands.CommitCmd',
        u'Commands.Start SketchStop',
    ]
    [app.executeTextCommand(cmd) for cmd in cmds]

    sels.clear()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it is very slow.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 14:32:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10355645#M8788</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-06-01T14:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10356046#M8789</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I think the only way to do this is to use TextCommands.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;・・・
        input.fontName = 'Comic Sans MS'
        txt = texts.add(input)

        changeTxtHeight(txt, 0.75)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def changeTxtHeight(
    txt :adsk.fusion.SketchText,
    height :float):

    if txt.height == height:
        return

    app = adsk.core.Application.get()
    ui = app.userInterface
    sels :adsk.core.Selections = ui.activeSelections

    skt :adsk.fusion.Sketch = txt.parentSketch
    sels.clear()
    sels.add(skt)
    app.executeTextCommand(u'Commands.Start SketchActivate')

    sels.clear()
    sels.add(txt)
    cmds =[
        u'Commands.Start EditMTextCmd',
        u'Commands.SetDouble TextHeight {}'.format(height),
        u'NuCommands.CommitCmd',
        u'Commands.Start SketchStop',
    ]
    [app.executeTextCommand(cmd) for cmd in cmds]

    sels.clear()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it is very slow.&lt;/P&gt;&lt;HR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I think the only way to do this is to use TextCommands.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;・・・
        input.fontName = 'Comic Sans MS'
        txt = texts.add(input)

        changeTxtHeight(txt, 0.75)
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def changeTxtHeight(
    txt :adsk.fusion.SketchText,
    height :float):

    if txt.height == height:
        return

    app = adsk.core.Application.get()
    ui = app.userInterface
    sels :adsk.core.Selections = ui.activeSelections

    skt :adsk.fusion.Sketch = txt.parentSketch
    sels.clear()
    sels.add(skt)
    app.executeTextCommand(u'Commands.Start SketchActivate')

    sels.clear()
    sels.add(txt)
    cmds =[
        u'Commands.Start EditMTextCmd',
        u'Commands.SetDouble TextHeight {}'.format(height),
        u'NuCommands.CommitCmd',
        u'Commands.Start SketchStop',
    ]
    [app.executeTextCommand(cmd) for cmd in cmds]

    sels.clear()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it is very slow.&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3787950"&gt;@kandennti&lt;/a&gt;&amp;nbsp;Thank you. Thankfully it's only the first letter that uses the createInput2 method, any following use the simple method, so it should not be overly slow.&lt;/P&gt;&lt;P&gt;Can I use a path to scale the letter that uses createInput2 instead of using TextCommands, after its added to the sketch?&lt;/P&gt;&lt;P&gt;I had a look at scaling through the UI but I need to use the bottom left point of the entity to scale from, via the api.&lt;/P&gt;&lt;P&gt;Are the points stored as an index, in an intuitive order, so I can identify that specific point?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 17:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10356046#M8789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-01T17:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10357614#M8790</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Text scaling is probably not possible.&lt;/P&gt;
&lt;P&gt;I found a faster way to change the height.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/bug-setting-sketchtext-properties-resets-text-height-since-v-2-0/m-p/10357593#M13441" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/bug-setting-sketchtext-properties-resets-text-height-since-v-2-0/m-p/10357593#M13441&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 08:06:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10357614#M8790</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-06-02T08:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10399049#M8791</link>
      <description>&lt;P&gt;I just noticed this bug has been fixed. The&amp;nbsp;&lt;STRONG&gt;SketchTexts.createInput2&lt;/STRONG&gt; method height parameter is working as expected we're no longer stuck using a 10mm font height.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edjohnson100_0-1623953499376.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/931609iA9F33FB050D4423D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edjohnson100_0-1623953499376.png" alt="edjohnson100_0-1623953499376.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you to the development team for fixing this so quickly. Very impressive response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jun 2021 18:12:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10399049#M8791</guid>
      <dc:creator>edjohnson100</dc:creator>
      <dc:date>2021-06-17T18:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: SketchTexts.createInput2 Method Height Parameter Not Applied</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10399065#M8792</link>
      <description>Awesome, thanks for the update.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jun 2021 18:18:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/sketchtexts-createinput2-method-height-parameter-not-applied/m-p/10399065#M8792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-17T18:18:22Z</dc:date>
    </item>
  </channel>
</rss>

