Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations The Obturator on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Design Table in new window Macro

Status
Not open for further replies.

mylestheslasher

Mechanical
Nov 24, 2005
2
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
 
Replies continue below

Recommended for you

Myles,

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
 
The annoying window asking if you would like to add such and such parameters to your design table. I wanted the Macro to include the clicking of cancel on that window. It would be odd if this wasn't included.
 
There is a user preference toggle that governs the behaviour when editing a design table. Change your code to show the following....

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
 
Myles,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor