Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Like this? Share it with your network

Share

Design Automation - Simple Solid Works Solutions To Practical Programmatic Packages

on

  • 6,589 views

Design Automation Techniques (session 1) with SolidWorks 2009 and 2010 - Presented to Greenville (SC) SolidWorks User Group September 15, 2009 @ CU-ICAR

Design Automation Techniques (session 1) with SolidWorks 2009 and 2010 - Presented to Greenville (SC) SolidWorks User Group September 15, 2009 @ CU-ICAR

Statistics

Views

Total Views
6,589
Views on SlideShare
5,817
Embed Views
772

Actions

Likes
1
Downloads
162
Comments
0

7 Embeds 772

http://www.razorleaf.com 546
http://razorleaf.com 205
http://www.slideshare.net 12
https://razorleaf.com 6
http://betasite.razorleaf.com 1
http://translate.googleusercontent.com 1
http://www.razorleaf.com.php53-26.dfw1-2.websitetestlink.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Here’s the gratuitous, self-promoting slide that tells you that I’ve been doing this forever and that I’m completely certifiable. And it also explains what a sherpa is, for those of you that don’t know.
  • And of course, so that I can convince my boss to pay my way here, I have to quickly tell you about my company.Razorleaf Corporation is a services-only company focusing on implementing technologies like design automation and PLM and I put this slide in just to let you know that I don’t sell any software. I don’t work for DriveWorks or RuleStream or Tacton, although I do work WITH all of them. I also put this in here in case my boss is in the room, which…he isn’t, so let’s move on. If you want to know more about us, I have cards up here and you can come up afterwards and quiz me about Razorleaf. Like I said, my boss isn’t here, so if I don’t know the answer, I can just make it up. Needless to say, though, Design Automation and its friends are what we do for a living.
  • Per the Microsoft PowerPoint Code, I am required to include at least one graph in every presentation, so here’s mine. The basic idea here is that As the corporate benefit, and notice that is CORPORATE BENEFIT, not how much easier YOUR life is going to be, because the two are NOT the same. The salesfolks will tell you, and remember, I am a services-provider, I do not sell anything, that you can boost your productivity to propel your company instantly into the Fortune 500. They’ll take your salary, add $490,000 per year for health insurance to come up with what your company actually pays for your time, then take 80% of that and tell you that’s the time savings that you’re going to get. Look how much your company is saving! Here’s the reality of the situation, though. Nobody ever SAVED themselves into being a millionaire. It’s not about reducing your costs, it’s about the top line, the revenues, about selling more. The salesperson knows this, that’s why they’re trying to get you to buy more from them. But we in Engineering tend to worry about shaving our mouse clicks and the rest of the company can go ffffigure out how to hone their own jobs. The problem is, that we all know the problem isn’t with Engineering, right? So unless we include the other groups in things like PDM and Design Automation, we’re really not going to see those corporate level gains. The jump from an Engineering-only solution to a corporate solution is a small jump in complexity, but a significant leap in benefit. This of course assumes that you are approaching the corporate system appropriately, targeting how you can produce more quotes and close more and bigger orders.
  • Like the CREATE PROPERTY MANAGER in SW2009, but this allows you to create configs, not just select them. It also adds custom property control, configure assemblies and publish models to 3DContentCentral
  • Like the CREATE PROPERTY MANAGER in SW2009, but this allows you to create configs, not just select them. It also adds custom property control, configure assemblies and publish models to 3DContentCentral
  • Reference dimensions will be able to help you when you go into testing, as you will be able to verify the “output” of given inputs. In many cases, also, you will want to know a resulting value for a given situation. Reference dimensions can act as this output view and can also be captured in custom properties or easily in code.

Design Automation - Simple Solid Works Solutions To Practical Programmatic Packages Presentation Transcript

  • 1. Design Automation: Simple SolidWorks Solutions to Practical Programmatic Packages Part 1: The Basics of Automation and the Pure SolidWorks Approach September 15, 2009 Paul Gimbel
  • 2. DISCLAIMER!!! More Information Than Time • There is so much that you can do with this stuff!! • Mickey wouldn‟t give me a 14 hour session • I may have to talk faster than the guy at the end of a car commercial (“prices not including taxes, tags…”) • Everything is documented in the PowerPoint ▫ Download it from the www.razorleaf.com ▫ Give me a business card and I‟ll email it to you ▫ Read the Presenter Notes • Come on up after the session with any questions • Take my business card...take a few and hand them around Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 3. Agenda • Levels of Design Automation • Tricks and Tools in Basic SolidWorks • Just a Little Programming • Integration with Microsoft Excel • Advanced Excel/VBA Integration • Brief Overview of Third Party Solutions Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 4. OK, Why Should I Listen to This “Sherpa” Guy? • Yes, Business Process Sherpa is really my official title • Certified SolidWorks Professional (since program inception) • Certified SolidWorks Trainer/Support Technician (10+ years) • Only Certified DriveWorks Enterprise Implementer • RuleStream Implementer (Certification Program Pending) • VB and SolidWorks API developer as needed • Design Automation Group - Business Development Leader • Business Process Group - Business Development Leader • Plays Well With Others…most of the time Q: What is a Sherpa anyway? A: A local guide that leads mountaineers on expeditions, showing them the way, showing them what dangers exist how to avoid them, and pulling all of the heavy loads. Copyright © 2009 Razorleaf Corporation www.razorleaf.com Slide 4 of 637,571,462
  • 5. Justifying My Expense Report Razorleaf Corporation • Services-Only Company • Specializing in Engineering Technologies • Design Automation • Data Management • Product Lifecycle Management • Business Process Mapping & Analysis • Collaboration Systems • Custom Programming Copyright © 2009 Razorleaf Corporation www.razorleaf.com Slide 5 of 3.8124e+19
  • 6. Reality Check A couple automation realities you should know about: • 100% automation is generally unachievable • Typically, the last 10% of automation will not be worth it • Something you didn‟t plan for will always come up • Your drawings are probably going to require clean-up • Testing will take you far longer than you expect • Your system will require ongoing maintenance and updates Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 7. Your Options • Pure SolidWorks functionality • SolidWorks Macros • Microsoft Excel (and some VBA, of course) • Maximized use of Excel and VBA • Custom developed application • Commercially available solution partner product • AutoDesk Inven…nah, who are we kidding? Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 8. Mandatory* Graph *Per Microsoft PowerPoint Code Section 6.15.a.9, Subsection 12.vi.p, Paragraph 21 DA Options: Complexity vs. Corporate Benefit 1 Custom Programming Solution Complexity 0.8 3rd Party Solution 0.6 Corporate Excel Engineering Excel 0.4 SolidWorks Macros SolidWorks Only 0.2 0 0 0.2 0.4 0.6 0.8 1 Corporate Benefit Source: Survey of 45,219 independent voices in The Sherpa‟s head Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 9. Pure SolidWorks • Configurations • Design Tables/SW2010 Configuration Publisher • Smart Components • Skeleton Parts/Sketches • Equations • Mate References • SmartParts • Design Checker • SolidWorks Task Scheduler • DriveWorksXpress Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 10. Configurations • Best thing since sliced bread!! (the demo said) • Worst idea…ever! (for design automation) • HUGE Overhead • Virtually impossible to protect • Data management nightmare ▫ Collaboration ▫ Archiving Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 11. Design Table • Same limitations as configurations + OLE XLS • Full Excel embedded in SW??...Well, yeah. • Tips ▫ Use Excel functions (340+) ▫ Use formatting ▫ Use data validation ▫ Use conditional formatting ▫ Pretty counts!!! ▫ Test in Excel before using in SolidWorks Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 12. Quote Break #1 “I told my wife that a husband is like a fine wine; he gets better with age. The next day, she locked me in the cellar." - Unknown Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 13. SW 2008 Create PropertyManager • Set up multiple configs • Configure the PropMgr • Appears when inserting into an assembly • Specify which config to use ▫ Choose by config name ▫ Choose by parameter values Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 14. Configure PropertyManager Any parameter that is different between configurations (i.e. has configuration-specific values) Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 15. Insert Component with PropMgr Specify Configuration Name Specify Parameters Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 16. SW 2010 Configuration Publisher • Set up a single or multi-line Design Table ▫ Must have all variables you want to control • Drag controls for inputs • Tie controls to design table variables • Requires Excel Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 17. 2009 CPM vs. 2010 CP Feature 2009 Create PropMgr 2010 Config Publisher Checkboxes   Pulldown Lists   (Range or typed) Free Entry Numbers   Dimensions and Features   Custom Properties   Parts   Assemblies   Drawings   Select By Config Name   Select By Parameters   Create New Config   (But cannot name it) 3DContent Central   Free MP3 Download   Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 18. Skeleton Parts/Sketches • Single location to drive entire design • Open part alone to avoid assy load time • Test geometry without having to drive entire assy • Leverage geometric relations • Use to drive simplified representations Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 19. Skeleton Part Recommendations • Make “Humongo, the Two Ton Sketch?” No. • Sketch Blocks • Test as you go • Make use of color • Fully define sketches • Add reference dimensions to monitor/validate Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 20. Equations • Part or Assembly level • Create non-dimensional parameters • Send to Custom Properties • Add right in the modify dialog Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 21. Quote Break #2 “When I die, I want to go peacefully like my Grandfather did, in his sleep - - not screaming, like the passengers in his car." - Unknown Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 22. Mate References • Preset Mating Conditions • Must have identical references • Drag component on component with same reference • Easier and faster to smart mate Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 23. Design Checker • Check for conformity to standards • Primarily for annotations • Check for overridden properties • Custom Check option ▫ Specify a macro to be run ▫ Call SetCustomCheckResult  TRUE for pass, FALSE for fail Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 24. SolidWorks Task Scheduler • Bulk process files or folders full of files • Work while sleeping (and stay employed!) • Export • Update • Custom tasks ▫ Macro file ▫ .SWB templates ▫ Pass parameters Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 25. DriveWorksXpress • Create unique versions of a part or assembly ▫ Automatically does the Save As • Create copies of as many drawings as you want • Capture dimensions, features, custom props • Build your own UI • Build model rules based on inputs ▫ Full Excel functionality on rules (shhh!) Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 26. Capture • Interactive capture in SolidWorks working window • Control existing custom properties or add new • Add “master drawings” Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 27. Form Design • Add form controls ▫ Text box Numeric box Check box ▫ Spin button Drop down list • Not tied to parameters (yet) • Min/Max/Increments Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 28. Add Rules • Rule to drive new (unique) file name • Rules to drive parameters (dims, features, props) • Access to all inputs on form • Uses Excel syntax (340+ functions) ▫ IF logic ▫ Math functions ▫ String Manipulation Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 29. What Do You Mean SolidWorks Has Limitations!?!? • All of these functions require user interaction • These functions require a seat of SolidWorks ▫ Great for your reseller, not so great for your budget ▫ Puts non-engineers in an uncomfortable environment ▫ Requires at least some SolidWorks training ▫ Do you really want a salesperson opening your models!?!? Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 30. Data Management Issues • One file with tons of configurations ▫ How big is that file, eh? ▫ Multiple people can not edit one file ▫ Revision questions • Save As Copy every time ▫ What about updates? ▫ Reliant on a manual process Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 31. SolidWorks Macros: Upside • Can be interactive ▫ Dialog boxes ▫ Property Manager ▫ Task Pane • Can act as just another command • Can be embedded in a model (Macro Feature) • VBA is a great segue into programming Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 32. SolidWorks Macros: Downside • Designed to drive the SolidWorks User Interface ▫ Not all that automation-friendly • OK to use for small functions ▫ Some 5 or 6 step operation that you want to hotkey • Can be tough to share due to individual settings • Often requires specific pre-selections • Everything plays on the screen (performance) • Requires a seat of SolidWorks Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 33. Macro Applications • New feature types ▫ Multiple steps that may be tough for library features • Bulk processing of geometry ▫ Select a face and perform an action on every circular edge on that face • Bulk processing of files (beyond Task Scheduler) ▫ Open each drawing, rebuild, save a detached copy • Automated updates of features ▫ Recalculate hole locations to dynamically balance Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 34. Quote Break #3 “Last night I lay in bed looking up at the stars in the sky and I thought to myself, where the heck is the ceiling?" - Unknown Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 35. Macro Recorder To write ANY macro, it‟s as easy as: 1. Start the macro recorder 2. Run through your clicks 3. Stop the macro recorder (and save file) 4. Click play!! Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 36. How To Program In VBA (and programmers, too) The Ultimate Process For Non-Programmers: 1. Determine what you want your program/code snippet to do 2. Think of some “keywords” to describe it (if you know the functions/properties/methods you need to use, you‟re ahead of the game) 3. http://www.google.com (add “VBA” and/or “SolidWorks” to search) 4. Ctrl-C 5. Ctrl-V 6. Tweak Also look to VBA and SW API Help files. They‟re actually helpful. I know! I was shocked, too. Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 37. Programming Tips For VBA • DOCUMENT THE $#^@ OUT OF EVERYTHING!!! ▫ Anything after an apostrophe („) is a comment…use it!! • Option Explicit ▫ It‟s the “Require Fully Defined Sketches” of the VBA world • Intellisense…good. Typing…bad. ▫ If you don‟t see what you need, something‟s wrong. • Compile and Test Often ▫ Programmatic sanity checks ▫ Insert test code • Use Debug Tools ▫ Step Into, Step Over, Watches, Breakpoints, Immediate Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 38. The Object Browser Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 39. VBA: OOPs • OOPs = Object-Oriented Programming (Sort of) ▫ Yes, .NET is the coolest thing in the universe, now leave me alone • SolidWorks macros are based on an object tree ▫ You must get the right object to act on it ▫ Every action requires an object ▫ Every property is held by an object ▫ Unlike fashion models, SolidWorks models don‟t mind being treated like objects Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 40. Object-Oriented Programming (or some facsimile thereof) One of the hardest, most confusing concepts in programming (Or so I‟m told) • Class – A definition of something like a window or bolt • Property – A parameter value that an object has • Method – Something that an object can do • Collection – A bunch of objects, like an array…of objects • Dot (.) – Something you will type a lot of ▫ Separates an object from its property or method ▫ Ex. Bolt.Length or Window.Pane.item(“top”).Glass.Thickness • Instantiate – To make a real thing as defined by a class ▫ Ex. Upper Flange Bolt #3 or Kitchen Window Over Sink  Those are then called “instances” and “objects” Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 41. The SolidWorks API is OOPs • Example: Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Early Bound Object Dim swFeatMgr As SldWorks.FeatureManager Declarations aka “Fully Dim swFeat As SldWorks.Feature Qualified” (+5 Style Points) Dim swWzdHole As WizardHoleFeatureData2 Set swApp = Application.SldWorks Object assignment Set swModel = swApp.ActiveDoc (instantiation) requires the Set swFeatMgr = swModel.FeatureManager keyword Set … Set swWzdHole = swFeatMgr.CreateDefinition(swFmHoleWzd) swWzdHole.HoleDepth = 0.15 swWzdHole.HoleDiameter = 0.0555 CreateDefinition and … HoleDepth and HoleDiameter are Properties CreateFeature are of the WizardHoleFeatureData2 object Methods (functions) Set swFeat = swFeatMgr.CreateFeature(swWzdHole) … Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 42. SolidWorks Macro Basics 1. Try the macro recorder (with low expectations) 2. Grab the SolidWorks Application Object 3. Track down to get the objects that you need 4. Act on those objects 5. Close everything out Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 43. SolidWorks API Programming Tips • Fairly well documented in the SW2008 API Help File • Macro Record, not really as helpful as everyone thinks • All units are in METERS!! • ERROR TRAP EVERYTHING!!! ▫ Check EVERY object If Not(Object Is Nothing) Then… ▫ Check your document types ▫ Check any preselects ▫ Verify data types before passing anything to SolidWorks ▫ Check data types of anything you receive from SolidWorks ▫ Beware of anything that may require user interaction • Close everything out when you are done Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 44. What about .NET? • Is .NET really better than VBA? ▫ Yup • Can you get .NET for free? ▫ Visual Basic 2008 Express Edition – FREE ▫ Visual C# 2008 Express Edition – FREE ▫ Visual C++ 2008 Express Edition – FREE ▫ www.microsoft.com/express • .NET has polymorphic inheritance, does VBA? ▫ Nope. Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 45. Why VBA? Why not .NET? • TOOLS>MACRO>EDIT opens a VBA editor • Macro recorder records in VBA • Microsoft Office 2007 uses VBA (2010 also…rumor) • VBA is simple • VBA is a very easy way to learn programming • VBA books are easy to find cheaply in libraries, clearance racks, yard sales, used book stores • What the heck is “polymorphic inheritance”? Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 46. VBA? Puh-lease OK, Mr. Smart Guy, If VBA is so *&@%ing good, then why not just use Excel? Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 47. Why not indeed!??!?! • SolidWorks macro code and Excel VBA are IDENTICAL! • Excel can call SolidWorks … recursively • Excel provides easy user interfaces • Excel does most of your work for you ▫ (340+ functions, remember?) • Virtually no training for you or end users • So how do we do it? ▫ Well you‟ll just have to wait for part 2, now won‟t you? Copyright © 2009 Razorleaf Corporation www.razorleaf.com
  • 48. Thanks! (for doing your part, you sure are smart!) • Got questions? • Got caffeine? • Feel free to grab me (or my card) after the show Paul Gimbel Business Process Sherpa paul.gimbel@razorleaf.com www.razorleaf.com For the complete version of the presentation, visit www.razorleaf.com after the show! Yes, it‟s free. Sign up for our FREE eNewsletter, too (news, tech tips, and more). Copyright © 2009 Razorleaf Corporation www.razorleaf.com