Open Design Table in new window Macro
Open Design Table in new window Macro
(OP)
Hi. I am trying to set up a simple Macro to open the design table in a new window and to also cancel out of that annoying window that pops up when you edit design table. I thought this would be quite easy simply by recording my actions on the macro tool bar. Unfortunately, when I run my macro it always ends up opening the design table within solidworks. The code looks like this...
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
boolstatus = Part.Extension.SelectByID2("Design Table", "DESIGNTABLE", 0, 0, 0, False, 0, Nothing, 0)
Part.InsertFamilyTableEdit
End Sub
Anyone know what I am doing wrong - sorry I'm no expert in this type of thing.
Myles
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
boolstatus = Part.Extension.SelectByID2("Design Table", "DESIGNTABLE", 0, 0, 0, False, 0, Nothing, 0)
Part.InsertFamilyTableEdit
End Sub
Anyone know what I am doing wrong - sorry I'm no expert in this type of thing.
Myles






RE: Open Design Table in new window Macro
I have not found a way to open a design table in a new window (although I never have asked API support if it was possible). What annoying window are you talking about?
Regards,
Regg
RE: Open Design Table in new window Macro
RE: Open Design Table in new window Macro
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager
swApp.SetUserPreferenceToggle SwConst.swUserPreferenceToggle_e.swEditDesignTableInSeparateWindow, True (this bit is all one line)
boolstatus = Part.Extension.SelectByID2("Design Table", "DESIGNTABLE", 0, 0, 0, False, 0, Nothing, 0)
Part.InsertFamilyTableEdit
End Sub
RE: Open Design Table in new window Macro
If you do want to see the "Add Rows and Columns" dialog when opening a design table, right click on the design table feature in the FeatureManagerTree, select "Edit Feature", uncheck "New parameters" in the Options box, then select the green check to close PropertyManager. Optionally you can uncheck the "New configurations" box too.
As for opening a design table through a macro, there are two other calls: DesignTable:Attach and DesignTable:EditTable. Both open the design table inside SolidWorks without displaying the Add Rows and Columns dialog. I could not find a call or parameter to open the table in a separate window. Which really did not matter to me because the macro I wrote opened the table, compared the number of configurations in the design table to the configurations in the model, then closed the table. No human interaction.
Regards,
Regg