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.
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
Jason
RE: design table description
[img=http://img
... it will populate the Files > Properties (Summary Information) > Configuration Specific section ...
[img=http:
... it also populates the Configuration Properties seen when RMB clicking on a configuration in the configuration manager ...
[img=http://im
[img=http://im
[img=http://im
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
RE: design table description
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
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
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
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
What is the API call to do this?
Regg
RE: design table description
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
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
RE: design table description
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
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
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
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
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
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
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
The design table could contain the code to add the macro feature.
Jason
RE: design table description
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