Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sketch Text Linked to Custom Property - Possible in 2009! 3

Status
Not open for further replies.

handleman

Automotive
Jan 7, 2005
3,411
This has been asked for in the past. It is now possible.

SolidWorks forums said:
Attached is a file with some sketch text in Sketch2. This text is linked to the thickness of the part. You can link the sketch text to anything you can get into the custom property. If you're into API and the weird fringe of SW, you can dig into how it works. Otherwise, you can use this file as a sort of template as long as you only need to control one sketch text entity. There are four important things in it. You can delete anything else.

1. The custom property called "NameOfSketchWithText". Its value should be the name of the sketch that contains only one Sketch Text entity. The sketch can contain any other geometry, construction geometry, etc. If you put your text in a sketch that is not called "Sketch2", modify this custom property value to match.

2. The custom property called "Text4Sketch". Whatever text it contains will go to the Sketch Text entity in the Sketch named above.

3. The custom property called "code". This is where the magic is. Peek behind the curtain if you must.

4. The equation "Dummy" = "code".

Note: this is lunatic fringe, unsupported, undocumented behavior. I tried to make it config-specific, but it crashed SW. It seems pretty stable with a single configuration though. Enjoy!

-------------------------
I'll get you Eh Steve, if it's the last thing I dooooo!

-handleman, CSWP (The new, easy test)
 
Very clever!!! A star for you!

- - -Updraft
 
Here's a version that is somewhat configuration-specific. The text is driven by a config-specific custom property generated by a design table. It does require an extra manual rebuild after changing configurations, but it's very stable on its own. It's a bit unpredictable if you try to put more than one configuration at a time into an assembly. This is due to the fact that SW simply doesn't support different sketch text in different configurations. It will really only solve it one way at a time. This makes it not exactly so useful I guess, since only one configuration can really exist at any given time.



-handleman, CSWP (The new, easy test)
 
 http://files.engineering.com/getfile.aspx?folder=b2bf25fb-9484-44b9-843a-d34a643f8be4&file=SketchTextCustomPropsByCfg.SLDPRT
can you send 2008 part with properties or give me the properties and values
regards
 
Unfortunately, no. This is only possible in 2009 due to the new capability of using custom properties inside equations.

-handleman, CSWP (The new, easy test)
 
handleman,
Very nice.
Now I have to figure out something to use it on. Maybe engraving text on silk screen drawing.
A star for you.

Bradley
SolidWorks Pro 2009 x64, SP2.0
PDMWorks Workgroup, SolidWorks BOM,
HP xw8600,
64-bit Windows Vista Business
Service Pack 1
Intel Xeon CPU, 3.00 GHz, 16 GB RAM, Virtual memory 166682 MB,
nVidia Quadro FX 4600 Driver 7.15.11.6956
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor