×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Split a custom property output into two lines?

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

Tom Malinski
Sr Design Engineer
OKay Industries
New Britain CT

RE: Split a custom property output into two lines?

You are getting the "-" because that is the file name.

You may be able to use API to read the file name, strip out the "-" and then use the result to populate properties.

cheers

RE: Split a custom property output into two lines?

(OP)
CBL, I just want to split the output into two lnes at the dash, I was hoping I could strip out the dash at the same time.

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?

<alt>+0010

RE: Split a custom property output into two lines?

Also, long single-line properties displayed as part of a note in a table in a drawing will automatically wrap.

batHonesty may be the best policy, but insanity is a better defense.bat
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Split a custom property output into two lines?

Tom,
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?

(OP)
TheTick, The "SW-File Name" custom property is the first of several in a block with attributes. So your suggestion would be to use a note in a table to display the same info rather than a block.

$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?

Thank you for the Star.

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?

I haven't done too much with this.  I did notice this behavior in revision tables.  I assume it carries over to general tables.

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?

In SW 2007 (and 2006 I think), you can create text boxes which automatically wrap text.  Would it work to use one of those in your block?

Eric

RE: Split a custom property output into two lines?

(OP)
Thanks everyone for your replies and help. I am digesting all of this and reviewing the link suggested.
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'm posting to this thread because the answers are tantilizing close to what I think I'm looking for ... but not quite there.

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources