Parametric Text

Parametric Text

IanP0rter
Explorer Explorer
8,192 Views
13 Replies
Message 1 of 14

Parametric Text

IanP0rter
Explorer
Explorer

Is it possible to control the text content parametrically?

 

Eg, If i engrave some text into a part, following the text outline. Can i change the content of the text via the parameters menu, rather than going to edit the actual sketch and then the text dialog box.

 

IanP0rter_0-1597292630748.png

 

8,193 Views
13 Replies
Replies (13)
Message 2 of 14

g-andresen
Consultant
Consultant

Hi,

It does not work as you would expect. > Text menue

Try the  workaround :

Dimension the height of the textbox with your parameter

 

günther

0 Likes
Message 3 of 14

jean-michel_legoff
Collaborator
Collaborator

Hi,

 

I guess that the request is about the « string » entered as « text » not the height, or font.

 

it could be valuable to declare the « string » as a user variable editable as any numbered parameter.

Message 4 of 14

thomasa88
Advocate
Advocate

I just got my  ParametricText  add-in published in the app store. You might want to try it.

 

I don't have a Mac to test on, so only a Windows version is published so far. However, you can grab it from Github  instead to install it on Mac. If you do, please report your expirence. I might publish for Mac to, if users report success.

 

Also, please note that editing texts from add-ins is a bit quirky, so it's best to assign a value to the text first - as it might jump - and then tweak the size/position. See the Limitations section.

Message 5 of 14

jean-michel_legoff
Collaborator
Collaborator

Hello,

 

I'm trying to use this add-in on a MAc (Mac Pro late 2013 running Catalina 10.15.6).

 

Things looks running good,

 

I've a question.

Is there a default parameter for "Part Name" or "Model Name" or "Component_name" 

So you can make an assembly with multiple parts and when you print them, the part is printed by it's name as well plus the version.

 

For example, you may a part ("my_part")on the left of the model, and copy/mirror it and want the part named "my_part_left" only by renaming it in the tree.

 

Many Thanks

0 Likes
Message 6 of 14

thomasa88
Advocate
Advocate

Hi,

 

Is there a default parameter for "Part Name" or "Model Name" or "Component_name" 

So you can make an assembly with multiple parts and when you print them, the part is printed by it's name as well plus the version.

 

 

That is currently not possible. Just to be clear, is this correct?

* Model = Name of the file in the file browser side panel

* Part =Body (solid or surface)

 

Note that all instances of a component must have the same name, and the sketch will be the same in all instances. Copied components is another story.

 

I might take a look at it, although it might slow down the text evaluation, since each parameter will then have to be computed for each sketch text where it appears , instead of once.

 

Also, can you exemplify where this is useful? I'm trying to weigh it against the added complexity and risk of bugs.

0 Likes
Message 7 of 14

thomasa88
Advocate
Advocate

@jean-michel_legoff 

As I think most users will have a low number of text parameters, I'm considering this feature. However, it is not as simple as just getting the name of the sketch parent component (seems to be quite simple), as users will expect the texts to update when components are renamed.

 

To start somewhere, what do you think is most important: Component name or Body name?

 

edit. Actually, Body name is a quite complex problem, as a Sketch does not inherently belong to a body, so the text can along belong to a body through another feature (e.g. Extrude). Also, a sketch might be used to affect multiple bodies.

With a component, we can look in the component tree (browser) and find the parent component of the sketch (so this might still be a "miss", if the user creates a sketch in component A, but extrudes it in component B).

0 Likes
Message 8 of 14

johannesJGAKQ
Contributor
Contributor

My use case is similar - I want to identify the parts by printing the dimension parameter. For example, a hole sized at  10mm would have an engraved marking next to it with "10mm".
Or a part would be labelled with a combination of "OuterDiameter"/"Thickness"/"HoleDistance". On the part, this would generate an engraving of e.g. "300/12/100".

Message 9 of 14

troyostrander
Advocate
Advocate
0 Likes
Message 10 of 14

thomasa88
Advocate
Advocate

Just to be clear for the non-programmer that don't mind some clicking: The ParametricText add-in can set text based on component name and user parameters (so if you have the hole size as a parameter, it can shown in the sketch text.)

 

https://apps.autodesk.com/FUSION/en/Detail/Index?id=2114937992453312456&ln=en&os=Win64

0 Likes
Message 11 of 14

raph1974
Participant
Participant

I still have an issue with  text height.  no matter  i have already set text height value as variable/parameter, After the update text parameter is updated ,  the Text height is always change back to nominal value. 

 

And the Add-ins is also not running/updated automatically if I change the value of sketch dimensions directly in sketch. (not in change parameter table).  The solution is to open the change parameter edit the text height value and click "Ok".  Then the parametric Text will be updated.  it Seems The button "compute All" doesn't work as it should. 

However, I still like it. Thanks alot ... 

 

@thomasa88 

0 Likes
Message 12 of 14

thomasa88
Advocate
Advocate

@raph1974  Are you running version 2.2.0? It has a workaround for this behavior. (Release details: https://github.com/thomasa88/ParametricText/releases/tag/v2.2.0 )

 

The way the workaround works, is that the first time you edit a text parameter after starting Fusion, it will try modifying the height to 2.0 cm and see if the value persists or if Fusion sets it to 1.0 cm. If that is the case, each time text parameters are updated, the add-in will save and restore the text height for each sketch text.

 

If you already have the latest version, try this:

1. Edit a text parameter

2. Press Ctrl+Alt+C to open the Text Commands window

3. Set it to "Py" in the lower right

4. Write 1 and press enter (just the digit 1).

5. In the output, if you scroll up, you should see if the add-in has decided to use the workaround:

ParametricText TEXT HEIGHT WORKAROUND: WorkaroundState.Disabled

 

0 Likes
Message 13 of 14

raph1974
Participant
Participant
hi .. 
my version is 2.2.0 .. I believe it's the latest one . I just download from app store. 



But the problem still exists.  

Every time I change the text height with parameter, Every time I change the diameter of the circle The text height is updated but the text didn't update, But If I open the " Change Parameter" and replace the diameter of the circle and hit " ok" .. the parametric Text will update, but it the Text Height Will back to the nominal value. 





I try The workaround but still it shows like below 


did I make something wrong?  


0 Likes
Message 14 of 14

thomasa88
Advocate
Advocate

I think I get what you mean.

 

Please try this new beta version. It updates the text when one edits a sketch dimension inside a sketch (e.g. d21):

 

  1. Uninstall Parametric Text using Add/Remove programs
  2. Download the beta release zip: https://github.com/thomasa88/ParametricText/releases/tag/v2.3.0-beta.2
  3. Follow the installation instructions here: https://parametrictext.readthedocs.io/en/v2.3.0-beta.2/installation.html#from-github-github-version
0 Likes