×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Open Design Table in new window Macro

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

RE: Open Design Table in new window Macro

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

RE: Open Design Table in new window Macro

(OP)
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.

RE: Open Design Table in new window Macro

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

RE: Open Design Table in new window Macro

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources