Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2012 Autodesk Design Patterns Applied to Autodesk® Inventor® API Philippe Leefsma Senior Developer Consultant, Autodesk Developer Network.

Similar presentations


Presentation on theme: "© 2012 Autodesk Design Patterns Applied to Autodesk® Inventor® API Philippe Leefsma Senior Developer Consultant, Autodesk Developer Network."— Presentation transcript:

1 © 2012 Autodesk Design Patterns Applied to Autodesk® Inventor® API Philippe Leefsma Senior Developer Consultant, Autodesk Developer Network

2 © 2012 Autodesk Class Summary This class focuses on developing.Net based add-ins for Autodesk Inventor® using best practices gained from direct hands-on experience of Autodesk software engineers. It exposes design patterns specifically studied for the Inventor® API. The class may benefit any programmer developing applications on top of Autodesk Inventor®.

3 © 2012 Autodesk Philippe Leefsma Developer Technical Services EMEA (Neuchatel, Switzerland) Philippe has a master's degree in Computer Sciences. He carried his studies in Paris at I.S.E.P and in USA, at Colorado School of Mines. He joined Autodesk 6 years ago where he works as developer consultant for Autodesk Developer Network. He supports various products APIs such as AutoCAD®, AutoCAD Mechanical®, and Autodesk® Inventor®. He likes to travel, meet developers from around the world to work with them around challenging programming, CAD and manufacturing topics. About the Presenter

4 © 2012 Autodesk Learning Objectives At the end of this class, you will be able to:  Boost your add-in development with useful functionalities  Strengthen stability and efficiency of your application by using well established software architectures  Save time and effort by taking advantage of design patterns turned into templates  We do not discuss and assume knowledge of  How to program in C# or VB.NET  The basics of the Inventor API  Inventor product usage

5 © 2012 Autodesk I - Creating Custom Project and Item templates

6 © 2012 Autodesk Custom Add-In Template  Custom add-in template can be used to enforce design pattern use  Let you save time and efforts by automating repetitive tasks  Helps standardize development process across company  Provides an efficient framework to developers

7 © 2012 Autodesk Creating Custom Templates Creating your own custom add-in template is straightforward from Visual Studio interface: Web references dealing with more advanced functionalities:   custom-wizard.aspx custom-wizard.aspx

8 © 2012 Autodesk Custom template - Parameters Template parameters are declared in the format $parameter$ Some useful parameters used in the ADN template:  destinationdirectory  GUID [1-10]  itemname  projectname  safeitemname  safeprojectname  time

9 © 2012 Autodesk Custom Template - Parameters Example /////////////////////////////////////////////////////////////////////////////////// // $safeitemname$ Inventor Add-in Command // // Author: $username$ // Creation date: $time$ /////////////////////////////////////////////////////////////////////////////////// namespace $rootnamespace$ { class $safeitemname$: AdnButtonCommandBase { public $safeitemname$(Inventor.Application Application): base(Application) { //... Your code goes here... }

10 © 2012 Autodesk Adding Custom Steps call "%VS90COMNTOOLS%vsvars32"mt.exe -manifest "$(ProjectDir)$projectname$.X.manifest" -outputresource:"$(TargetPath)";#2 xcopy /y "$(ProjectDir)Autodesk.$projectname$.Inventor.addin" "$(AppData)\Autodesk\Inventor Addins\" Post-Build: AfterClean:

11 © 2012 Autodesk Template Installation  On Windows XP:  C:\Documents and Settings\ \My Documents\Visual Studio \Templates\ProjectTemplates \  C:\ Documents and Settings \ \My Documents\Visual Studio \Templates\ItemTemplates \  On Windows Vista/7:  C:\Users\ \My Documents\Visual Studio \Templates\ProjectTemplates\  C:\Users\ \My Documents\Visual Studio \Templates\ItemTemplates\

12 © 2012 Autodesk Templates in Visual Studio Express Visual Studio Express Edition has a few limitations:  Post-Build step not available > Perform manually or use.bat file  AfterClean step not available  New project created on TEMP folder > Call ‘Save All’, select folder and change.addin and post-build accordingly

13 © 2012 Autodesk Template Demo

14 © 2012 Autodesk II - Add-In Utilities

15 © 2012 Autodesk XML Ribbon Builder  Common task for add-ins: create user interface elements  XML-based Ribbon builder presents several advantages:  Fast and easy definition of Ribbon elements  Generate the Ribbon items dynamically at loading  Use external XML > Can be replaced / updated by user / application Ribbon Builder

16 © 2012 Autodesk XML Ribbon Builder - Tags Ribbon builder interprets following XML tags:  RibbonTab  RibbonPanel  QAT  Gallery  SplitButton  SplitButtonMRU  ButtonPopup  Popup  TogglePopup  Button  Separator  ComboBox  Macro

17 © 2012 Autodesk Ribbon items persistence Ribbon builder implements custom items persistence mechanism: Ribbon Builder Ribbons.xml User.Ribbons. xml Add-in unloaded Ribbon Builder Add-in loaded

18 © 2012 Autodesk XML Ribbon Builder - Example


Download ppt "© 2012 Autodesk Design Patterns Applied to Autodesk® Inventor® API Philippe Leefsma Senior Developer Consultant, Autodesk Developer Network."

Similar presentations


Ads by Google