How to link text font size to a document property.

Hello I am designing a file that lets you choose a capacitor size from a configuration table and update the model. It already works and the value text will update accordingly. My problem lies with the text font size. It needs to stay proportional to the diameter of the top surface, which increases with cap size. How can I link the font size to a document property. From there I can update my excel table and the model will always update. Thank you in advance.

2 Answers

To link the font size to a document property, create a custom property in your design file for the font size. Then, use this property to control the font size in your model. Update the custom property via your Excel table, ensuring the model updates accordingly.

Certainly, let's explore how you can link the font size of your capacitor value text to a document property in SolidWorks, allowing it to adjust dynamically based on the top surface diameter.

1. Define a Custom Property

First, you'll need to create a custom property that stores the desired font size.
Go to File > Properties > Custom
Click on "Configure" and add a new custom property.
Give it a descriptive name like "Capacitor_Font_Size".
Choose the appropriate data type (likely Number or Text).
Initially, you can set a default value.
2. Link the Text to the Property

Select the text entity that displays the capacitor value.
In the PropertyManager, go to the "Link to Property" section.
Choose the custom property you created in step 1 ("Capacitor_Font_Size") for the "Text Height" option.
3. Update the Custom Property

You have a couple of options to update this custom property:
Manually: Go back to File > Properties > Custom and directly edit the value of "Capacitor_Font_Size".
Excel Table (Recommended):
If you have a configuration table linked to your model, add a column for "Capacitor_Font_Size".
For each configuration (capacitor size), input the desired font size in this column.
Make sure the configuration table is set to update the model automatically.
4. Establish the Relationship

The critical step is to define how the font size relates to the top surface diameter. You'll likely need an equation or a lookup table.
Equation:
If there's a simple mathematical relationship (e.g., font size = 0.1 * diameter), you can use equations within the configuration table or design table to calculate the appropriate font size for each configuration.
Lookup Table:
If the relationship is more complex, create a lookup table in Excel that maps diameter values to font sizes.
Then, reference this table in your configuration table using the VLOOKUP function or similar.
Important Considerations:

Units: Ensure consistency in units (e.g., millimeters for both diameter and font size).
Minimum/Maximum Font Size: Set reasonable limits to prevent the text from becoming too small or too large to read.
Testing: Thoroughly test your setup with different capacitor sizes to ensure the font size updates as expected.
By following these steps, you'll create a dynamic link between your capacitor's top surface diameter and the font size of its value text. This ensures that the text remains visually proportional and readable regardless of the capacitor configuration.