Split a custom property output into two lines?
Split a custom property output into two lines?
(OP)
Is there a way to split the output of a custom property into two lines? I have a block defined with the following attribute. This works well except our file names are descriptive and sometimes long winded. I need to split the output into two lines using the dash as the split point
This custom property
$PRPVIEW:"SW-File Name"
Returns this file name in one line
“309P Proposed Cap & Blade - DTW01 WEDM Block Die Inserts”
I want two lines without the dash
309P Proposed Cap & Blade
DTW01 WEDM Block Die Inserts
any help is appreciated
This custom property
$PRPVIEW:"SW-File Name"
Returns this file name in one line
“309P Proposed Cap & Blade - DTW01 WEDM Block Die Inserts”
I want two lines without the dash
309P Proposed Cap & Blade
DTW01 WEDM Block Die Inserts
any help is appreciated
Tom Malinski
Sr Design Engineer
OKay Industries
New Britain CT






RE: Split a custom property output into two lines?
You may be able to use API to read the file name, strip out the "-" and then use the result to populate properties.
RE: Split a custom property output into two lines?
Tom Malinski
Sr Design Engineer
OKay Industries
New Britain CT
RE: Split a custom property output into two lines?
Hi Tom,
It sounds like you want to insert a carriage return in a custom property.
The only way I know how to do this is to enter the custom property via a design table using the $prp command and in Excel use a carriage return (Alt-Enter) to get the second line.
Let us know if this helps.
good luck,
RE: Split a custom property output into two lines?
RE: Split a custom property output into two lines?
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Split a custom property output into two lines?
This is none of my business. If you are just starting out in your part numbering system, I would suggest not controlling file names with descriptions. As your company grows, it would be nothing but trouble.
To answer your question you can use visual basic’s “mid$” function to split the part number into SolidWorks properties PartNumber1 and PartNumber2. Then put that property onto the sheet format.
Please forgive me if I have over stepped my bounds. As you probably already know part numbering system is a very touchy subject.
Bradley
SolidWorks Premim 2007 x64 SP3.1
PDM Works, Intel(R) Pentium(R) D CPU
3.00 GHz, 4 GB RAM, Virtual memory 12577 MB, nVidia 3400
RE: Split a custom property output into two lines?
$PRPVIEW:"SW-File Name"
$PRPVIEW:"Material"
$PRPVIEW:"Size"
$PRPVIEW:"Quantity" REQD
$PRPVIEW:"Note"
Tom Malinski
Sr Design Engineer
OKay Industries
New Britain CT
RE: Split a custom property output into two lines?
Bradley
SolidWorks Premim 2007 x64 SP3.1
PDM Works, Intel(R) Pentium(R) D CPU
3.00 GHz, 4 GB RAM, Virtual memory 12577 MB, nVidia 3400
RE: Split a custom property output into two lines?
We use custom properties in parts to carry ECN data, which is then displayed in the drawings. The long descriptions in custom properties will wrap.
RE: Split a custom property output into two lines?
http://www.eng-tips.com/viewthread.cfm?qid=182611
-Shaggy
RE: Split a custom property output into two lines?
Eric
RE: Split a custom property output into two lines?
I think using some vb code for left$ or Mid$ function would be good based on my many years past basic programming skills, but I have no idea on how to add this or to make this work with a $PRPVIEW:"SW-File Name" custom property within an attributed block.
If anybody has a sample they could share I would appreciate it very much.
Tom
Tom Malinski
Sr Design Engineer
OKay Industries
New Britain CT
RE: Split a custom property output into two lines?
I need to split a PDMWorks property $PRP:"revision" into a dash-rev piece and a version piece (a Client doesn't want to change their sheet format). For example, $PRP:"revision" = 01-A-02. I want to create two custom properties: one is 01-A, the other is 02.
I think the VB left type of command seems most interesting, but those that have mentioned it don't know how to apply it in the Custom Properties dialog box. I'm totally clueless and have no VB experience. I understand excel well if that helps.
Any thoughts?
SW2007SP3.0
Thanks.