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.

A way to mark or label part faces using split(?) or engrave text into a face with feature script?

Ben_Ben_ OS Professional, Mentor, Developers Posts: 303 PRO
Wonder if there is a feature script out there that can take a face I select and using a appropriate font split that face using the text I input? Im finding labeling my parts for a assembly document a bit tedious. Or any thoughts on how to automate this is appreciated. I know you can use the emboss feature script but in the end with hundreds of parts it gets a bit tedious. Make a sketch, draw text, align text on center of face, exit, then command to split or emboss.... I cant help but think there has to be a way to select the face and tell it what you want on it text wise, set the font size and be done with it.

Thoughts?

Comments

  • MichaelPascoeMichaelPascoe Member Posts: 1,953 PRO
    edited January 2023

    Definitely possible. Try something like this:

    (Note that I'm using right Shift + Enter to quickly accept and repeat the feature)

    https://cad.onshape.com/documents/b1d09c5e0246be7b23c22292/w/6b512e106c2b29ad8439a31d/e/5325bb774e16c44d8255a0df?renderMode=0&uiState=63ca836f1c7ea5718534e80d




    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • romeograhamromeograham Member, csevp Posts: 675 PRO
    @MichaelPascoe
    That looks very nice. Can you add manipulators (in case I want to drag the marking out of the default center position) and / or a way to position the text with dimensions? Maybe give us a way to select the "bottom left" corner of the face - then add dimensions to move the text away from that position?
  • MichaelPascoeMichaelPascoe Member Posts: 1,953 PRO
    edited January 2023

    @romeograham I'll probably turn this one into a full feature in some spare time and also implement your feedback. This would be a good one to have. While Surface text is an excellent custom feature, it is too complicated and not open source.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • S1monS1mon Member Posts: 2,910 PRO
    Driving the position with an optional inline Mate Connector would add a lot of flexibility.
  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 303 PRO
    edited January 2023
    Awesome thank you! This will handle 90% of what I need. I agree thought being able to 'place' the text via handles or a connector would be the last 10% but I am so grateful this exists. It will save a ton of time.
  • MichaelPascoeMichaelPascoe Member Posts: 1,953 PRO

    Here is that other 10% Text - Custom Feature. Stay tuned for the rest of its functionality  B)


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • S1monS1mon Member Posts: 2,910 PRO
    @MichaelPascoe

    This is great. A few things that would be super helpful:
    1. Being able to reference the location to any one of the four corners or the four centers of the sides of the text. For bonus points being able to do this with both the X height or the bounding box would be great.
    2. Optionally add draft to extruded flavors
    3. Optionally add small fillets to the sharp corners of the text

  • MichaelPascoeMichaelPascoe Member Posts: 1,953 PRO

    @S1mon
    1. Noted!
    2. Tricky, but I'll think about it. Needs to work with curved surfaces and also not fail all the time.
    3. Noted. Might have to be a very small fillet for default as these seem to fail often with letters.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • S1monS1mon Member Posts: 2,910 PRO
    2. I would be happy if it just did this from a planar reference, but if it could do curve driven draft on a curved surface that would be huge.

    3. I'm sure you can figure this out, but @Evan_Reese's Selection Fillet works pretty well at grabbing all the "non-capped" edges and/or capped. It would be nice to have some options here. I was initially thinking just the nominally vertical edges would be good to fillet, but I could see adding options for the letter faces and/or the intersection with the base part. Basically anything which would improve manufacturability (depending on the method) would be nice.
  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 303 PRO
    Seriously this is amazing! Thank you. It has saved me so much time it is crazy. Attached is a photo of a non rectangular part where the text does not land on the face. Being able to adjust the x and y location would be the final thing for me. As it stands it is still way less work for me to take the parts, split them into sections where the text lands on the face and then boolean them back together. Regardless I truly want to thank you for helping me not descend. Also having the split option to be the first default would be great.   into madness :) 
  • MichaelPascoeMichaelPascoe Member Posts: 1,953 PRO
    edited January 2023

    @Ben_ You should be able to press the mate connector button, place the mate and adjust the X and Y. 

    Also, it is supposed to save your last preset, which would save the split option for future operations. Let me know if this is not working and I'll take a look.


    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 303 PRO
    Damn how did I miss this? Feeling foolish now. Thank you. You are also right on the preset. For some reason one document was not playing well with me on this. But testing now it is PERFECT!!!! 
Sign In or Register to comment.