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/
I missed that thread, but I would also love to have that info as well.
------------------------------------------------------------------------------
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
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
DejaNews is your friend:
http://x64.deja.com/[ST_rn=ps]/threadmsg_ct.xp?AN=699334767
Jim S.
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...
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>,
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.