Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Update linked design table

332 views
Skip to first unread message

2Q

unread,
Dec 14, 2000, 11:15:15 AM12/14/00
to
Some time ago there was a thread in this NG that talked about linking a
design table to an external spreadsheet which contained the relevant
data. In this thread, the use of an update button in the embedded
design table was mentioned. This button used a VB macro to update the
embedded design table in 1 click.

Does anyone know the code that is used in this update button? Any help
would be appreciated.

Steve


Sent via Deja.com
http://www.deja.com/

elz...@my-deja.com

unread,
Dec 14, 2000, 11:35:29 AM12/14/00
to
In article <91arm9$uqr$1...@nnrp1.deja.com>,
2Q <sk...@my-deja.com> wrote:

I missed that thread, but I would also love to have that info as well.

Robert Hope

unread,
Dec 14, 2000, 12:16:08 PM12/14/00
to
This is a copy of an old message which was posted Nov 30th.
I like to copy valuable tips to a separate folder.
You never knowwwwwwwwwww.........
Robert Hope, Toronto

------------------------------------------------------------------------------

Here is what I do, see if you can understand...

I don't like embedding my design tables because if something goes wrong with
the file I loose the table. I also find it cumbersome to work with.
I always use one Excel spreadsheet to control many parts and assemblies, I
find it easier to work with, and I don't need to have Solidworks for the
editing.

This is what I do.
1) Create the part with all its features.
2) Rename the sketches and dimensions to something more meaningful.
3) Create a design table and insert all the required dimensions etc
4) Copy the entire sheet and paste it into a blank Excel document
5) Make the embedded design table link to this new document: A1 links to A1,
B1-B1 etc
6) Repeat this for all the associated parts in the assembly
7) Create links between the sheet to capture design intent and
associativity.
For example, the size of the shaft on the rotor is linked to the size of the
bush, with appropriate offset etc.
8) Make the first sheet in the workbook with comments, notes, key dimensions
that link to many parts etc.
9) Now you can merrily work away creating all the configurations, formulas
etc in Excel, which is very quick.
10) Create an "Update" button/shortcut for a macro that edits the design
table and then return to SW immediately.

When I work on the project I have the assembly open in SW and the main
workbook open in Excel.
When I see something that needs changing, I flick to Excel, make the change,
go to the SW part, click the "Update" button, go back the assembly and it
is all changed.

This is a little simplistic, I have more tips and tricks but want to avoid
confusion....
Hope this helps

Richard

S. Baugh

unread,
Dec 14, 2000, 12:44:56 PM12/14/00
to
I don't know if this will help, but this some code from a VB
Application that I have been working on. This code let me open a design
table in an assembly update the info. close it and rebuild it.

Private Sub Command1_Click()
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long
Dim Annotation As Object
Dim Gtol As Object
Dim DatumTag As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object

Dim length As String
Dim width As String
Dim height As String

length = Text1.Text
width = Text2.Text
height = Text3.Text

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

retval = designtable.attach
designtable.setentrytext 1, 1, length
designtable.setentrytext 1, 2, width
designtable.setentrytext 1, 3, height

MsgBox (designtable.getentrytext(1, 1))
retval = designtable.detach

Part.EditRebuild

End Sub

Hope this helps,
Scott

Jim Sculley

unread,
Dec 14, 2000, 12:08:29 PM12/14/00
to
elz...@my-deja.com wrote:
>
> In article <91arm9$uqr$1...@nnrp1.deja.com>,
> 2Q <sk...@my-deja.com> wrote:
>
> I missed that thread, but I would also love to have that info as well.

DejaNews is your friend:

http://x64.deja.com/[ST_rn=ps]/threadmsg_ct.xp?AN=699334767

Jim S.

John Picinich

unread,
Dec 14, 2000, 12:50:56 PM12/14/00
to
Go to http://www.cadimensions.com/swugny/apimain.htm

You will find a downloadable example file called updatepallet.zip which
contains a simple SW assembly (Wooden Pallet), and an Excel worksheet to
"drive" it.

The worksheet contains a macro for updating part and assembly dimensions,
component quantity, etc. It's very rudimentary, but might help get you
started.

You will need to "unprotect" the Excel worksheet after opening it to be able
to edit/view the Update macro.

Regards,

John Picinich
www.cadimensions.com

"2Q" <sk...@my-deja.com> wrote in message news:91arm9$uqr$1...@nnrp1.deja.com...

2Q

unread,
Dec 14, 2000, 2:20:50 PM12/14/00
to
Scott,

Thanks, but I think this code is for a different than what I was
looking for. This appears to open the design table, allows you to edit
the length, width and height, then closes the table and rebuilds.

What the previous poster described was a button that would get the data
values from the external design table and pull them into the embedded
design table. It was from the the thread "esign tables". Here is the
bit about the update button:

"Create an "Update" button/shortcut for a macro that edits the design
table and then return to SW immediately.

When I work on the project I have the assembly open in SW and the main
workbook open in Excel. When I see something that needs changing, I
flick to Excel, make the change, go to the SW part, click the "Update"
button, go back the assembly and it is all changed."

Steve

In article <91b0um$3rb$1...@nnrp1.deja.com>,

2Q

unread,
Dec 15, 2000, 11:15:21 AM12/15/00
to

> 10) Create an "Update" button/shortcut for a macro that edits the
> design table and then return to SW immediately.

This is the part that didn't make sense to me. I'm definitely not a
programmer, but I tried this with a recorded macro and it doesn't
update the design table. The macro I recorded in SW is as follows:

Sub Button1_Click()

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

Part.InsertFamilyTableEdit
Part.CloseFamilyTable
Part.EditRebuild

End Sub

I was hoping someone would know what the code should be. Seems to me
it should be separate from SW. Just needs to look to the external file
and update the spreadsheet accordingly. The rest of the process for
linking a design table to an external spreadsheet works fine (thanks to
Krich for that) but it's a pain to update when you change/add something.

0 new messages