Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

New Featurescript: PP Surface Text 2.0

2»

Comments

  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    edited November 2018
    @kevin_o_toole_1
    @stuart_rampy
    @here

    I've created a new version of Surface Text ( v2.1.5 ) that includes ability to use expressions. Thanks @kevin_o_toole_1
    for the pointers on the syntax, that definitely saved time!

    The test case in the new version is pictured below ( it uses Kevin's suggested expression)



    Document Link:  https://cad.onshape.com/documents/cfec40e2b66bb4ddb2f3414b
  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    konstantin_shiriazdanov after a long time, (and another reminder from the community), i finally implemented your suggested edits to this feature. Sorry it too so long!
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 1,948 EDU
    ilya_baran said:
    One thing I'd like at some point is for the user of a feature to be able to replace a parameter like a boolean, string, or enum (or even the suppression state) with an expression.
    I would really like this.
    Should I create an Improvement Request?
    MB - I make FeatureScripts: View FeatureScripts
  • phillip_saboltaphillip_sabolta Member Posts: 1
    Hi @dave_cowden I just stumbled across this handy tool. It has made my life so much easier. Thank you. 
    However, it doesn't recognise Japanese font.. which Onshape does, under Noto Sans Japanese.

    Is there an easy way to add it to the list under fontface library?
  • jmsaltzmanjmsaltzman Member Posts: 15 ✭✭
    Wow @dave_cowden thank you for this! The string expression can be fiddly, so I just make another variable with an "any" type value first to form the string. Anyway, much appreciated!
  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    @jmsaltzman
    You are welcome, thank you for taking the time to comment! Eventually i'll make a new version with various improvements folks have asked for, but I'm glad the current version is helpful!
  • thomas_aathomas_aa Member Posts: 19 ✭✭
    edited May 2020
    Thanks for the great script @dave_cowden !

    I have run into a problem: When I used "Raised Add", the part I add to gets renamed to "Part 1". Also, children break (I'm making an inverted mold) every time I change the text. I think this can be resolved by having the target as the first element in the add/union list. At least it works that way for the Union tool.

    I tried to make a test, but I think the code that actually does this is in the PP_Text_Libraries text.fs, which is not public or I mangled the URL trying to open it.

    edit. For anyone with the same problem, my workaround was to us "Raise New" and then do a 0.1mm extrude from the surface into my part to be able to use "Merge with all" to union all the letters with the part.

    edit2. It turns out that Raise New failed to handle my text when it is "5", but works fine for "25" :S. It worked fine for raised add. It seems that I always need at least 2 letters for Raise New.

    edit3. Work around for the Raise New problem: Do a new on a throw-away part that is then "Merge with all"-merged with my real part. So:
     * Extrude a small throw-away part into my part.
     * Text with Raise Add on the throw-away part.
     * Extrude into my original part and use "Merge with all" to merge the throw-away part with the original part.
  • otaolafrotaolafr Member Posts: 107 EDU
    Hello,
    I am having an issue with using variables in the feature, I want to add 1 mm (the variable is for example #d=1 mm)
    the issue is if i say that it is an expression and use #d I get 0.001 m (when i would like to be displayed in mm)
    I tried: (#d/1mm)~"mm" but now i get "1 milimeter" obviously I was looking to have a small text length so not the best solution.
  • mahirmahir Member, Developers Posts: 1,116 ✭✭✭✭✭
    @dave_cowden, I can confirm the behavior @Otaola_Franco is seeing. Work around is to use the syntax below.

    #Test / m * 1000  ~ " " ~ "mm"
  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    @Otaola_Franco
    @mahir thanks for the heads up/workaround.  I'm glad this thread is here, whenever i do a new version, i can gather up all of the little things and make it nicer. 

    Now if somehow OS made it possible for me to make even a little amount of money on FS development.......    
  • mahirmahir Member, Developers Posts: 1,116 ✭✭✭✭✭
    @dave_cowden I feel you. I've created a handful of FS and who knows how many SW macros. In both cases sharing code is easy enough, but monetization doesn't work well unless it's an addin/API based prospect.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 1,948 EDU
    Hello,
    I am having an issue with using variables in the feature, I want to add 1 mm (the variable is for example #d=1 mm)
    the issue is if i say that it is an expression and use #d I get 0.001 m (when i would like to be displayed in mm)
    I tried: (#d/1mm)~"mm" but now i get "1 milimeter" obviously I was looking to have a small text length so not the best solution.
    The reason this doesn't work is because #d/1 is evaluated first, then multiplied by a millimeter.
    If you just use (#d / mm) ~ " mm" that should work
    MB - I make FeatureScripts: View FeatureScripts
  • mahirmahir Member, Developers Posts: 1,116 ✭✭✭✭✭
    The reason this doesn't work is because #d/1 is evaluated first, then multiplied by a millimeter.
    If you just use (#d / mm) ~ " mm" that should work
    I tried this first. Two things happen. First, it converts the number into scientific notation, dividing by 1000 in the process "1E-6". Next, adding " mm" instead of " " ~ "mm" causes the unit to display as "millimeter" for some reason. There's all sorts of weirdness. Not sure if it's a bug in how expressions are parsed by FS, but it sure seems buggy.
  • otaolafrotaolafr Member Posts: 107 EDU
    mahir said:
    @dave_cowden, I can confirm the behavior @Otaola_Franco is seeing. Work around is to use the syntax below.

    #Test / m * 1000  ~ " " ~ "mm"
    thanks! it worked, i dont get exatly why this happens but thanks a lot!
    @MBartlett21
    as @mahir said if we use directly (#d / mm) ~ " mm" as I mentioned in the first post, you get the "correct" value (I mean the variable in mm) but it shows milimiters instead of mm.
    @dave_cowden I cant imagine how much time have you spend in this FS.... as mahir mentioned i do not think at all that is an issue with the FS itself, I think is more of an bug. nothing to correct in your code, it is great <3.  thanks a lot for you great work! (right now I use your thread creator and the surface text at least that i can remember, they are great FS!) thanks a lot!

     
  • Cache_River_MillCache_River_Mill Member Posts: 223 PRO
    edited June 2020
    @dave_cowden

    Thank you for this! 

    There are so many good things about this feature. After using it for a while, there are only two improvements I would request:

    - When using the option "Raise Add", the feature takes an existing part and adds it to the letters making it a new part, loosing its id and breaking features to follow. A solution to this would be to select the part you want to add to, and have the feature add the letters to that part instead of adding the part to the letters.

    - The text height is not a consistent number when set to one. For example, set the text to center, and text height to 1 inch. The font size will change and adjust to measure what you have typed. A very neat and useful, but could cause problems if you aren't aware it is happening and all of your different text are different font sizes.



    Awesome feature! We really appreciate this great tool.


  • aleks_clarkaleks_clark Member Posts: 5
    @dave_cowden this is awesome, and I'd throw some money at you for this sort of quality of life improvement. could you possibly set up a patreon, and find a way to share your stuff only with patreon subscribers?
  • sebastian_glanznersebastian_glanzner Member, Developers Posts: 204 PRO
    edited August 2020
    @aleks_clark
    Good idea I would also think that something like pareon could be a good solution for @dave_cowdenand other FeatureScript creators.


    Maybe with different tiers:

    Basic $:
    You get access to the newest versions of the FeatureScripts.

    Medium $$:
    You can request improvements for the Basic FeatureScripts.

    Premium $$$:
    You get customized FeatureScripts based on the Basic scripts available.

  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    @aleks_clark @sebastian_glanzner thank you all for the kind words about these FS!

    Limiting access has been the problem for the most part. Onshape just hasn't made it easy to do it.  It would be possible to manually share new features with certain individuals, but there is no way to limit their ability to share further. Version management becomes hard too.

    I have a few other projects right now, but I will consider setting up a patreon, and ill do a few tests to see how far I could get with manual sharing. At the very least I could honor feature requests only for supporters!

    Thanks again everyone for your ideas and support!
  • john_doubledayjohn_doubleday Member Posts: 57 EDU
    Looks like a great script but how does one control the Kerning?......letter spacing right?
     I am using it to make cut out lettering for a Metal work challenge in an Australian high school. Thanks for a great tool
  • otaolafrotaolafr Member Posts: 107 EDU
    hello @dave_cowden
    second time in a row! ehehe, first of all, thanks for another great feature,
    secondly, the other day I found myself with a "bug" in the surface text FS? I was using a variable value concatenate with text and when I was puting "1.3 mm" as value surface text showed "1.30000000000000000000000002 mm" I got around by cutting decimals but not sure why there was a problem as for other values worked correctly, E.G for "1.315 mm" it showed "1.315 mm".
    thirdly ^^, I am offering to make custom icons for the FS of people that I use as I love the idea of helping with what I can....
    i thought of something like this for the surface text (but it is quiet hard to imagine something for it to "visualise" the function...) If you want I could send you the svg file and also if you want modification i could do it with pleasure :smiley: 
     the surface looks a little bit as a leaf :open_mouth: ahahaha

  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    @Otaola_Franco I love it. Your design skills far surpass mine! that's why i didnt even _try_ to make an icon.
    How do you add an icon? i dont even know how to do it.
  • Alex_KempenAlex_Kempen Member Posts: 53 EDU
    Info on adding custom icons can be found here. It looks to me like @Otaola_Franco is having a rounding error, which could possibly be fixed by switching the text FS to using roundToPrecision to output numbers, unless I'm misdiagnosing the issue.
  • otaolafrotaolafr Member Posts: 107 EDU
    edited December 2020
    Info on adding custom icons can be found here. It looks to me like @Otaola_Franco is having a rounding error, which could possibly be fixed by switching the text FS to using roundToPrecision to output numbers, unless I'm misdiagnosing the issue.
    hello @Alex_Kempen
    yes exactly, it was that way i solve it, thanks to god, i was working in a fs and came across this function, but what was intriging me it was that the behavior was not the same for different values.... as you mention I solvid with roundToPrecision, but what was strange that for 2 different values I got different answers. also the roundToPrecision is not a perfect solution, as I dont know the decimals that could change the rounding number in the function will round differently, and for example if in the case of 1.3155 mm i put roundToPrecision(#variable,3) i will get  1.3155 (as the number of decimals will change..)
    @dave_cowden you are way more experiene than me with onshape FS so you might get everything from the doc alex linked but when I was doing it myself I couldnt finish to understand it, here is explained a little bit easier and better in my opinion https://forum.onshape.com/discussion/2499/importing-part-studios-and-feature-studios (septs 1. to 3.)
    also another issue with the FS is that it changes the id of the part? at least I think is doing that as when editing the text in the feature sometimes broke the features applied to the part down the line. I think it could come from the boolean operation type UNION at the end where the first element is not the original body so sometimes it changes as the resulting body saves another ids? I think.... not sure.... 

  • dave_cowdendave_cowden Member, Developers Posts: 456 ✭✭✭
    Ah ok thanks for the 🔗 I'll try to work the roundtoprecision and icon into my next feature version.
Sign In or Register to comment.