×
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

Custom Properties Question
3

Custom Properties Question

Custom Properties Question

(OP)
How can I insert a hard return in the value/text expression column.  I have drawing which have this hard return, and it shows up as a box.

I can copy/paste this function, but I would like to know how to insert it without copy/paste.

RE: Custom Properties Question

3
<alt>0013

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

RE: Custom Properties Question

correction!
<alt>0010

RE: Custom Properties Question

(OP)
Thanks Tick.  It's not exactly what I was looking for but it works.

RE: Custom Properties Question

I'm not clear about what you are asking if Tick's response isn't the answer.  Do you have more details?

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
http://sw.fcsuper.com/index.php

RE: Custom Properties Question

(OP)
I'll try-

Tics method produces the same result, which is to add text directly below original text.  However when viewing the text in the custom property cell, I don't see both lines.  If I click in the cell, then I can toggle back and forth and see the two lines of text.

The method I was looking for is one that keeps both lines of text on the same line in the custom property cell but they are separated by a symbol that looks just like a small box.  Both lines of text are visable in the cell, and you're not required to toggle to see both of them.

It's possible that it is not a solidworks function, maybe a microsoft macro or something.

Does any of that make sense?

RE: Custom Properties Question

deltadog,

I believe the same box you are talking about went away with Windows XP.

SA

RE: Custom Properties Question

I assume you're linking to the custom property in a note on your drawing.  If you use a text box for the drawing note there is no need for the hard return in the custom property.  

When placing a note on the drawing, window a text box rather than picking the location for your note.  Then you can link to the custom property as you normally do.  Resizing the text box will then wrap the text automatically.  I have seen situations where I can't make this work the way I want (center-justified text where I want the lines separated in a particular place).  It may have been possible, but I didn't spend a lot of time on it.

RE: Custom Properties Question

(OP)
Yes this is linked to a macro.

What I'm trying to find, is the way to enter this macro.  Notice the small box between the text lines in the property cell.


When I have this in the property cell:

I get this on the drawing:

RE: Custom Properties Question

Another way to get multiple lines is to have configuration-specific properties controlled in a design table.  The design table is in Excel, and you can use <alt> + <return> to create line breaks within an Excel cell.

The downside is that this only works for configuration-specific properties.

RE: Custom Properties Question

deltadog,

Guess I was wrong, it still shows up.  I know it disappeared somewhere after the upgrade to XP years ago.

But that is besides the point.  Here is something for you to try.  Start a part model.  Next create a custom property in a the custom tab called BOX (use uppercase letters as shown) and give it the value x.  Then run the following macro:

CODE

Sub main()
    
    Dim swApp As Object
    Dim swDoc As Object
    
    Set swApp = Application.SldWorks
    Set swDoc = swApp.ActiveDoc
    
    swDoc.CustomInfo2("", "BOX") = "First Line" & vbLf & "Second Line"
    
End Sub

Now look at the custom property. You should see First Line but when you click on the value in the Value/Text Expression column you should see First Line[]Second Line.

Is this what you want to do?

SA

RE: Custom Properties Question

(OP)
Thanks Tick (and others)  
The consensus around the office here is to use the method that Tick described (<ALT> 0010).
The only problem I see is that it is limited to two lines, and we usually use three for descriptions.
Thanks again.

RE: Custom Properties Question

Since SolidWorks now allows (as of 2005) the user to resize a text box, you can just make the text box the size of your title block enty and the text will automatically wrap.  If you want it to wrap after a specific word, that may be more of an issue.  You may be able to simply add spaces in your custom property entry.



-Shaggy

RE: Custom Properties Question

Don't use the two-line method for description field at all!  Seriously.  Shaggy's solution is correct.  If you don't have 2006 or 2007, there is still a much better method.  If I had known that's what you where trying to do, I woulda mentioned this sooner:

Use this macro to make a word wrapped annotation note:

http://sw.fcsuper.com/index.php?name=UpDownload&req=viewdownloaddetails&amp;lid=10

Original (german) version is here:  http://swtools.cad.de/

Don't even try to control how the lines breaks.  Not worth the effort.  Just let the word land where they may. :)  Just leave your annotation note wide enough to handle most scenarios.

Matt
CAD Engineer/ECN Analyst
Silicon Valley, CA
http://sw.fcsuper.com/index.php

RE: Custom Properties Question

deltadog, the title block you show in your picture above looks very familiar.

RE: Custom Properties Question

deltadog,

One other thing that you can do is use the comments field on the summary tab of your part/assembly properties form.  You can link to this field in the same manner you link to a custom property.  This field allows multiple lines and you can insert line breaks where ever you'd like with a simple return.

The downside is that there's only one field like this, but if you only need this to populate your drawing title this will work.

RE: Custom Properties Question

Your <alt> + <enter> is great even after taking level 3 excel not one ever showed me that little trick. Thanks! Star for you!

Best Regards,

Scott Baugh, CSWP pc2
www.scottjbaugh.com
FAQ731-376

RE: Custom Properties Question

... and a from me too, also, as well.

cheers
SW07-SP3

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