Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello,
I am about to create a parametric model with the geometry relying on text fields that change for different parts of a family. For this I need to either know the dimensions of a text field (height and width) or have the possibility to get points (for changing text fields) on the boarder/edge of the text field. Is there a way to do this? As of what I currently see there is only a way to set/get either the height OR the width (which is the line which the text field is aligned to).
The blue circled area on the screenshot shows an example text field where I want to grab a point or a measurement on the outer line surrounding the text (The text is aligned to a vertical line on the left.).
I'm happy for any help!
Regards,
Lukas
Solved! Go to Solution.
This video details how to add the reference dimension to sketched text. It is not obvious and I do not think it is documented in the help files.
Are you hoping to adjust the text to fit in the available space, or adjust the geometry to be larger than the resulting text?
Hello TomU,
the text size is fixed and set by its height I set in advance. I now want to get the width/length of the text field OR set a point on the right side of the text box, when the text field ends. This should work generalized; so when the text (in the same sketch) changes via another parameter input the length/point on the right edge shall update,
Here is a video explanation and a demo part model (Creo 7) that is set up to derive the width of a text string created in sketch mode. The key is to create a reference dimension for the "measured" dimension on the text. Refer to the video for details.
Very nice!
@TomU ,
Is your suggestion regarding when to use feature relations a general statement about best practices for relations?
Or
In the context of the demo part I posted, do you see potential to have the relations for the bounding box to return different results (or undesired model behavior) as part relations vs feature relations?
It has to do with how Creo regenerates. The top level part relations are evaluated once, and then each feature down the model tree is regenerated sequentially. Since the reference dimension in the sketch may change when the feature is regenerated (due to changing text, etc.), the reference dimension will be updated after the top level part relations have already been evaluated, causing a second full-part regeneration to be required. Creo is smart enough to attempt two full regenerations (if necessary), but it takes longer, and depending on what else is going on can increase the chance of getting the 'some relations are no longer satisfied' message. I find it's better to create relations after the point in the model where those referenced values are being set, typically in the next feature that needs to depend on them.
By the way, I did a quick test of your method. Two additional comments:
Hello tbraxton,
Yes, this is exactly one way how my problem in theory could be solved! I now just struggle with two things:
1. How do you even get a horizontal dimension (that I can then convert to reference) of that text box? I am not able to click the box boundaries or set a measurement there.
2. The coordinate feature is grayed out in my model; how can I change that?
Thanks a lot so far!
@LL_7636801 wrote:
Hello tbraxton,
Yes, this is exactly one way how my problem in theory could be solved! I now just struggle with two things:
1. How do you even get a horizontal dimension (that I can then convert to reference) of that text box? I am not able to click the box boundaries or set a measurement there.
2. The coordinate feature is grayed out in my model; how can I change that?
Thanks a lot so far!
Hi,
if you want measure the distance between the end of text and box, then you can add geometrical point into Sketch 1 feature.
See modified model.
Hello Martin Hanák,
this does not solve my problem (as far as I understand your solution suggestion) because the points/distance doesn't adapt with changing text, does it?
@LL_7636801 wrote:
Hello Martin Hanák,
this does not solve my problem (as far as I understand your solution suggestion) because the points/distance doesn't adapt with changing text, does it?
Hi,
it does because of existing relations. Please edit definition of Sketch 1 feature, modify text and regenerate the model.
I believe the text is dynamic - either family table driven or parameter driven. The number of characters is dynamic and the last character will not remain the same letter of the alphabet. Any type of point placed on the last character will fail when that character changes.
@TomU wrote:
I believe the text is dynamic - either family table driven or parameter driven. The number of characters is dynamic and the last character will not remain the same letter of the alphabet. Any type of point placed on the last character will fail when that character changes.
Hi,
if you open model modified by me you will see that position of the point is driven by dimension ... and value of this dimension is driven by relation. You can change the text inside Sketch 1 feature -OR- relate it to string parameter value >>> it works (after model regeneration).
Ah, sorry. I didn't realize you were doing the same thing as @tbraxton and using a reference dimension from the length to drive everything.
Hello Martin,
thanks for the hint! Can you elaborate how one can add a geometrical point like you did in your model?
@LL_7636801 wrote:
Hello Martin,
thanks for the hint! Can you elaborate how one can add a geometrical point like you did in your model?
Hi,
please replay video geom_point.mp4.
I solved 2., the grayed out coordinate system. I now still don't have/can't create a strong/reference width dimension to the text. How can I get this dimension on my text in the sketcher?
This video details how to add the reference dimension to sketched text. It is not obvious and I do not think it is documented in the help files.
I totally agree! After so much time of searching for anchors on the boarders of text fields it never came to my mind to just click the text itself in order to set dimensions. Thanks a lot!