×
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

design table description

design table description

design table description

(OP)
When working with design tables and configurations there appear to be two different descriptions.  One is the Component Description which can be edited in the design table, right click properties, click custom properties, and select description from pull down menu.  The second I believe is called the Component Configuration Description, right click to select properties.  
I like managing the description in the design table, that way I can link its name to dimension values or whatever.  The problem is when I am in an assembly drawing the properties tab gives me config name, but not the design table description.  I have been using the same meaningless 5 digit part numbers for config name, BOM part number, and drawing number.  I can not tell the differences in configs from the name.  How can I link the two descriptions or get Solidworks to display the design table description in the assembly drawing environment?

Thanks.

RE: design table description

Submit an enhancement request, the design table has no syntax for filling out the congs description property. This can however be done in the API and can therefore be added to your excel design table vb code such that it enters it on close.

Jason

RE: design table description

If you use the $PRP@Description parameter in the DT ...
[img=http://img237.imageshack.us/my.php?image=configpartdt1jm.jpg]

... it will populate the Files > Properties (Summary Information) > Configuration Specific section ...
[img=http://img237.imageshack.us/my.php?image=configpartsummary8tl.jpg]

... it also populates the Configuration Properties seen when RMB clicking on a configuration in the configuration manager ...
[img=http://img237.imageshack.us/my.php?image=configtest19bo.jpg]
[img=http://img237.imageshack.us/my.php?image=configtest24mj.jpg]
[img=http://img237.imageshack.us/my.php?image=configtest33tr.jpg]

Note the options available at the bottom of the dialgue box.


Helpful SW websites every user should be aware of FAQ559-520
How to get answers to your SW questions  FAQ559-1091

RE: design table description

(OP)
I’m with you so far.  My dilemma is once I get to assembly files.  The description I want to see when choosing which config to use is the value in $PRP@Description, ie  “Test 1” or “Test 2”

RE: design table description

Check the SW Help files ... under Index, search for parameters, configurations. You should be presented with several choices ... select Summary of Design Table Parameters. This shows the various parameters which can be used in a DT. The one you want is $configuration@part_name


Helpful SW websites every user should be aware of FAQ559-520
How to get answers to your SW questions  FAQ559-1091

RE: design table description

Ooops ... that should have been $configuration@component<instance>


Helpful SW websites every user should be aware of FAQ559-520
How to get answers to your SW questions  FAQ559-1091

RE: design table description

(OP)
That's pretty close, but not quite what I was looking for.

In an assembly drawing of many parts you can RMB over an individual part, choose properties--named configuration and see a list of names (in my case a five digit number), but not the $PRP@description value from the design table.  That description would help me pick the correct instance for the assembly.  

RE: design table description

Ahhh ... All clear, now it is

In that case I have to agree with Gildashard ... submit an ER to your VAR & SW. I don't know of a way to see that info in the config selection box.

BTW, to avoid confusion, please use the term "model" when referring to the "solid" parts & assemblies ... and "drawing" when referring to the 2D views on a sheet.


Helpful SW websites every user should be aware of FAQ559-520
How to get answers to your SW questions  FAQ559-1091

RE: design table description

Gildashard,

What is the API call to do this?

Regg

RE: design table description

This from the api help:

This property gets and sets the description of the configuration.
 
retVal = Configuration.Description (VB Get property)
Configuration.Description = description (VB Set property)




Jason

RE: design table description

Here's the code I use, I'm not really a programmer so be gently. And this is just a piee of the code, it may reference variables elsewhere.


Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc

Set currentconfig = Part.GetActiveConfiguration()   'Get current configuration
configname = currentconfig.Name                     'Set the configuration name string
configcomment = currentconfig.comment               'Set configuration comment string to current configuration comment
BomChildren = currentconfig.ShowChildComponentsInBOM    'Get ShowBom Children state

Part.SelectByID configname, "CONFIGURATIONS", 0, 0, 0   'Select config
Part.EditConfiguration3 configname, configname, configcomment, txt_partnum.Text, 1  'Edit configuration, adds part number to BOM field
currentconfig.description = txt_configdesc.Text 'Sets configuration description to be the same as the config description field
currentconfig.ShowChildComponentsInBOM = BomChildren    'Set showBom Children state back to above

Jason

RE: design table description

(OP)
All right so now I think I must be out in left field.  What are other people’s numbering/ naming conventions so that you can find the correct part configuration from an assembly model?  Do you really open an assembly model, open a part model, open the design table to find the correct configuration, then back your way out of all the windows?  I don’t want to use significant part numbers as there is always some variation you did not consider when setting it up.  

RE: design table description

Do a search for numbering, there have been many threads about this, with as many differing opinions. Basically you have to use one that suits your company & its product.

When making the initial design I use a descriptive name only (no numbers). When the design is complete I add numbers to the description. The number matches the drawing sheet.


Helpful SW websites every user should be aware of FAQ559-520
How to get answers to your SW questions  FAQ559-1091

RE: design table description

(OP)
I've read some of those posts until my head spins.

We spend twice as much time managing data and the information on 2D drawings so they jive with manufacturing process improvements as we do designing new items (I work at a furniture factory).  New items are usually an existing item with different options.  That's why I was looking to differentiate between configurations from a list. (12mm plywood drawer side instead of 5/8” hardwood etc).  I wanted  the $description to be the description on the drawing title block (drawer side), but the component config description to be some like “P, 22.5 x 9.125 x 12mm” or “H, 22.5 x 9.125 x .625”.

Get it?

RE: design table description

We follow two different config naming schemes, one for manufactured parts and one for library purchased parts.

Our manufactured part configs are named by part number.
Purchased items configs are named by size, color or whatever the distinction in the family is.

I have used a combination of both for nuts, screws, washers etc. Originally I named them by their size but found out it was difficult for users to find them if they where looking for them by part number. We also had some cases of one screw size have two or three part number due to people assigning them and not realizing we already had them.

Example Screw,

"Size"-"Thread" x "Length" "Finish/Material Code" (Part Number)

0.250-20 x 1.000 Z (123456)

I did this back around Swx 99-2000, since then I think if you have the part number field entered for each config, it will show up in the component properties dialogue in the assy. The config description may show up in other places too, but I haven't really investigated it much.

This is one area in swx that really needs attention.

Jason

RE: design table description

Forget to mention custom properties we use.

We use custom and config specific custom properties with a property editor I wrote in VB.

Custom properties apply to the whole family

Number (The drawing number)
Description (Drawing description)
Revision

Config Properties

PartNo (The final part number, it's the drawing number, plus a suffix)
Partnosuffix (Storage string for the part no. suffix)
ConfigDesc (Final part description, drawing desc plus suffix)
ConfigDescSuffix (Storage string for description suffix)

The program concantenates the "Number" and the "Partnosuffix" to get the Part no for that config.
Same thing for description, "Description" and "ConfigDescSuffix" to get ConfigDesc.

It also enters the final part number in the part number box on the config and sets the Configs description to be equal to the "ConfigDesc" property.

Confused yet?

The drawing titleblock notes are linked to the Number, Description, and Revision properties in the part.

Jason

RE: design table description

Gildashard,

Thanks for the API call.  I just talked to my VAR last week about this and I was told they did not think any call existed.  Anyway, I tried the call out in a simple macro and I was able to read and write to it.  Tommorrow I will try it out with a design table to see how it works.  A star for you.

Regards,

Regg

RE: design table description

I never did implement the code in our excel design table template, let me know how it goes, I may want to steal that code from ya.

If I remember, it was more difficult in a design table because you had to get and write this out to all configs, not just the current one. I wasn't to up on my VB skills to loop this through all the configs in the part.

Also, if you open the design table embedded instead of as a separate window, I couldn't get the code to run on close. Since you just select outside the window to close it, it doesn't seem to kickoff the Close and Update section. Maybe it could be done as an update button instead.

Hope you have better luck it than I did.

Jason

RE: design table description

Gildashard,

Getting the code to work to from inside a design table will require some effort it appears.  I tried putting the code in the BeforeClose event but it appears SolidWorks does not update the model until the design table closes.  The work around may be to close the desing table, re-open it and then close it again.  I will have to do further research if there is a way to run code after the workbook (or excel) closes and the model is updated.  A quick and dirty method would be to write a separate macro that is run after the configurations are updated.  A custom property could be created from the design table that contains the description information.  This property would then be read by the macro and transferred to the configuration description.  Another possibility: I found API calls for attaching to an existing design table (although it opens inside solidworks), then you can read cells, update the  configuration description and then close the table.  Again this would be after the fact.  Another thought:  Write a SolidWorks event handler that you would run before editing/creating the design table and then trap the event that detects when a configuration is created.  Again a custom property would have to contain the desired description information.  I will have to think about it some more.

Regards,

Regg

RE: design table description

Wonder about a macro feature that runs the code on every rebuild. May take to long on parts with lots of configs though.

The design table could contain the code to add the macro feature.

Jason

RE: design table description

Gildashard,

I finally came up with a macro to update a configuration description from a design table.  Unfortunately, the code is long, required the SolidWorks object variables to be declared using early binding, it would not close gracefully depending on the way the user closed the design table and would not function if the design table was opened inside SolidWorks.  It also did not work in SolidWorks 2004.  So I threw it out.

My other idea of writing a separate macro and using a custom property set by the design table to populate the configuration description worked too but portability was sacrificed;  You always had to make sure you had access to the macro.

In the end, I decided my other idea of opening the design table, adding a configuration, closing the design table then re-opening and re-closing it is the way to go.  The code is much simpler, always stays with the design table, does not require the SolidWorks object variables to be declared using early binding (for those of us {like me} who forget to set the correct references), does not care how the user closes the design table and, works if the design table is opened inside SolidWorks or in a separate window.  I also have tested it and found it works in SolidWorks 2004 SP4.1 and SP5.0, SolidWorks 2005 SP5.0, and SolidWorks 2006 SP0.0.

I have attached my code below in case you are still interested in it.  However, let me make one disclaimer.  I have come to believe that no two installations of SolidWorks are the same; even on supposedly identical computers.  After reading posts in this forum for the past few years and from the experiences of the 50 some users we have at work, there is no guarantee that the code will work for you or anyone else without some “tweaks”.

Enjoy,

Regg


CODE

'******************************************************************************
'Macro description:
'Creates/changes a Configuration's description from a design table.
'For first time run or new configuration requires design table to
'be opened and closed a second time for update to take place.
'Macro works when design table is opened inside SolidWorks or in a new window.
'
'Install instructions:
'From a SolidWorks model, open a design table in a new window.
'From the Excel menu, select Tools, Macro, Visual Basic Editor.
'In the Visual Basic Editor, double click on ThisWorkbook in the Project Explorer window.
'(If the Project Explorer is not visible, select View, Project Explorer from the menu.)
'(If the ThisWorkbook icon is not visible, expand the Microsoft Excel Objects folder.)
'Paste this code into the code window.
'
'Use instructions:
'This macro assumes row two is the header row which contains the design table parameters
'and row three is start of the configuration data.
'Parameter name for configuration description is $DESCRIPTION (not case sensitive) in hopes
'SolidWorks will sometime honor my enhancement request(s) and add this functionality.  Because
'$DESCRIPTION is not a recognized parameter, leave a blank column between the $DESCRIPTION
'colum and the end of the last column in the design table so SolidWorks will ignore it.
'Type in a description for each configuration in the $DESCRIPTION column.
'Close the design table.  If this is the first time the macro is run, a message will be
'displayed asking you to open and close the design table (A similar message will be displayed
'when a new configuration is added to the table).  Open and close the design table to update
'the configuration descriptions.
'
'******************************************************************************
Option Explicit


Dim swApp As Object
Dim swModel As Object
Dim swConfig As Object

Private Sub Workbook_Open()

    'get SolidWorks object
    Set swApp = GetObject(, "SldWorks.Application")
    
    'get model that design table belongs to in case users changes active document
    '(on open is only time can guarantee calling model will be active)
    Set swModel = swApp.ActiveDoc

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)

    Dim yRow As Long, xCol As Long, FoundNew As Boolean
    Dim ConfigName As String
    
    'find $Description column
    For xCol = 2 To 256
    
        If StrComp(Cells(2, xCol).Value, "$Description", vbTextCompare) = 0 Then Exit For
        
    Next 'xCol
    
    'check if $Description column exists; exit sub if not
    If xCol > 256 Then Exit Sub
    
    'check for SolidWorks object
    '(this code should only run when macro is first pasted into workbook)
    If swApp Is Nothing Then
    
        'display message for first time use of macro
        MsgBox "This design table contains configuration description data" & vbLf & _
               "that may need to be updated in the model.  To preform     " & vbLf & _
               "update, re-open this design table and then close it again.     ", vbOKOnly + vbExclamation, ThisWorkbook.Name
        
        Exit Sub
        
    End If
    
    'update existing configuration descriptions
    For yRow = 3 To 65536  'hopefully table never gets this long
    
        'get configuration name from design table
        ConfigName = Cells(yRow, 1).Value
        
        'check for end of table
        If Trim$(ConfigName) = "" Then
        
            Exit For
            
        Else
        
            'get configuration object
            Set swConfig = swModel.GetConfigurationByName(ConfigName)
            
            'check for new configuration
            If swConfig Is Nothing Then
            
                'set flag
                FoundNew = True
                
            Else
            
                'just update description in model
                swConfig.Description = Cells(yRow, xCol).Value
                
            End If
            
        End If
        
    Next 'yRow
    
    'display re-open message if new configurations found
    If FoundNew Then
        
        MsgBox swModel.GetTitle & ":     " & vbLf & _
               "     This model's design table will create new configurations that     " & vbLf & _
               "     will need to have the configuration description added to them.     " & vbLf & _
               "     To add, re-open design table and then close again.     ", vbOKOnly + vbExclamation, ThisWorkbook.Name
        
    End If

End Sub

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