Keith Rice

Suggestions Wanted: SWW "Macro Mania" Challenge

Discussion created by Keith Rice on Jan 18, 2018
Latest reply on Mar 16, 2018 by Amen Allah Jlili

Hi all, my colleague Amen Allah Jlili and I are exhibiting at SolidWorks World 2018 this year. As you might know, each year at SWW they hold a "model mania" contest where the fastest SolidWorks modelers can receive a prize. We wanted to do an equivalent "macro mania" and wanted your feedback on our rules and what you think would be reasonable SOLIDWORKS API programming puzzles for beginner and intermediate-level SOLIDWORKS API programmers.



  • Participants will be allowed to use the local or online API Help as their only reference.
  • The macro recorder may be used.
  • Participants will be given 30 min max to complete as many of the challenges as they can.


The judging of the code will be subjective. In the past, I have held contests that simply require the shortest code, but this results in very ugly or unrealistic code. This time I will be judging the solution's simplicity, adherence to coding conventions (indentation, reasonable variable names, etc), and robustness (does it make questionable assumptions).


Here were some ideas we had, with various difficulty. Please share your opinion of these ideas and any ideas you have.


  • Delete all suppressed features in the active part.
  • User selects a planar face and runs the macro, which creates an 10mm extrude using the face's profile.
  • Prompt the user with a dialog that asks for 1 - 10 configurations, then creates that many configurations with this name: <part title without extension> - <config number starting with 1>.
  • Take the above macro and modify it so that all previously existing configurations are deleted. Successive executions of the program should produce correct results.
  • Traverse all components in the active assembly and add a document-level custom property called "Author" with the value equaling the participant's initials.
  • For an open assembly, create a drawing using the default drawing template that contains a standard 3-view layout. Automation dimension the front view.


Looking forward to your feedback. Thanks!



SOLIDWORKS API Training and Services