Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
skText too big, how can I define its origin and sizes on sketch?
darren_13
Member, Developers Posts: 120 PRO
Think the title says it all, I want to place the text in a certain position (above my aerofoils) also, changing skText to construction doesn't seem to do anything?
Kind regards,
Darren
Kind regards,
Darren
Tagged:
0
Comments
-
Hi Darren,
The box around the sketch text can be dimensioned similarly to other sketch entity. Additionally, you can position sketch text by setting a coincident constraint between any of the 'snap points' on the box and some other sketch vertex. Here is an example of sketch text which is dimensioned and anchored to the origin:
https://cad.onshape.com/documents/0d853e17ab2575bee74ac3a6/w/d0bc950f7cd53294625170ba/e/bc1d1373efc9578dc2b2f2f2
Currently sketch text cannot be made into a construction entity. Out of curiosity, what is your use case for construction text? Feel free to submit an improvement request on the right if you would like to see this functionality in Onshape
--->
Jake Rosenfeld - Modeling Team0 -
Assuming you mean to use skText via FeatureScript:
You can do it with skContraint, but setting the initial guess correctly becomes tricky. Instead, what people usually do is to just create the sketch with huge text, then use opTransform to move and scale the resulting entities to the desired position and size.
Here's a document which demonstrates the idea:
https://cad.onshape.com/documents/cdbad61ec176b39049f8d4c1/w/0cb06ca7cb2788345cc7a448/e/c1778a16ae172747eaf7b147
In this doc's feature, the transform (both position and scale) is determined by a selected sketch line. The doc for opTransform might illuminate other methods of creating the transform you need.
1 -
Oops! Thanks Kevin. Didn't realize this was in the FeatureScript category.Jake Rosenfeld - Modeling Team0
-
Thanks, @kevin_o_toole_1 I'll go this way I think. On the subject of setting initial guess, I created a post asking about it previously but nobody has commented on it... is there anywhere I can go for this information? I have another script 'Parametric Aerofoil' which requires it to advance it further, so any input here would be helpful. I need skConstraint coincident and tangent when I set initial guesses to approximate coordinates nothing materialised.
Many Thanks,
Darren0 -
I think they forgot to document some of the inherited mapped properties of the skText function. Try adding the following lines to your sketch map (in the section where you define "text" : "this is my text", "fontName" : "OpenSans-Regular.ttf", etcetera)
"firstCorner" : vector( xPosition, yPosition),
"secondCorner" : vector(xPosition+1*inch, yPosition + textHeight)
Further explanation posted in the thread https://forum.onshape.com/discussion/8269/how-do-i-scale-sktext-in-situ-from-featurescript
0



