Complete ClientFeature example in C#

By Philippe Leefsma

The attached sample add-in exposes an example of handling a fully functional ClientFeature including the following functionalities:

Creation through InteractionEvents, edit, double-clicked event, associated ClientGraphics.

I wrote this add-in upon request for a customer, so it is very specific to their workflow. It helps quickly creating an extrusion based on the selected edge(s), the resulting shape makes think about a dog bone, hence the name of the plug-in.

I believe it might be a good example for programmers looking for creating advanced ClientFeatures.

img1

img2

img3

<div style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;display: inline;float: none;padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:35abb2be-eb1a-4cce-b101-cd9d43837ddd" class="wlWriterEditableSmartContent"><p> <a href="http://adndevblog.typepad.com/dogbone-feature-add-in.zip" target="_blank">Dogbone Feature Add-in.zip</a></p></div>

Comments

7 responses to “Complete ClientFeature example in C#”

  1. Thanks for the sample,
    Im still a bit confused though, Looking through the api docs (my only other source of information) gives me the idea that i’d need to inherit/implement the ClientFeatureX abstract classes/interfaces. But i dont see anything of that in your code…
    That makes me very curious what is going on inside the AdnInvUtilityLib.dll that you link to in the sample. Would it be possible to peek at the source of that?

  2. Philippe Avatar
    Philippe

    There isn’t any class or interface you can implement in the native Inventor API, however I used this kind of approach in the code from AdnInvUtilityLib.dll. This is my own library to deal with Inventor add-in programming. I feel like it is more intuitive to provide abstract methods to implement.
    The full source code for that lib is available from that previous post:
    http://adndevblog.typepad.com/manufacturing/2012/06/autodesk-manufacturing-devcamp-material.html
    Check the Design Pattern material from advanced topics.

  3. Thanks, makes it a bit clearer now..
    lots of nice stuff in your UtilitLib, are there any limitations on using it for commercial purposes?

  4. Philippe Avatar
    Philippe

    Nope, you are free to use and improve it.
    The code is however copyrighted:
    Copyright (c) Autodesk, Inc. All rights reserved
    Written by Philippe Leefsma 2011 – ADN/Developer Technical Services
    Permission to use, copy, modify, and distribute this software in
    object code form for any purpose and without fee is hereby granted,
    provided that the above copyright notice appears in all copies and
    that both that copyright notice and the limited warranty and
    restricted rights notice below appear in all supporting
    documentation.
    AUTODESK PROVIDES THIS PROGRAM “AS IS” AND WITH ALL FAULTS.
    AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
    MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
    DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
    UNINTERRUPTED OR ERROR FREE.

  5. How do we use WPF form in Inventor AddIn ?

  6. Hi Ranjan,
    Your question has nothing to do with the topic of this post, in the future please use the forum to ask this kind of questions:
    http://forums.autodesk.com/t5/inventor-customization/bd-p/120
    Here is a post about using WPF in an Inventor Dockable Window:
    http://adndevblog.typepad.com/manufacturing/2012/06/embedding-a-wpf-user-control-in-a-dockablewindow-in-inventor.html
    If you want to display a WPF form inside Inventor which is not contained inside a dockable dialog, you can just simply show your dialog, nothing specific to Inventor.

  7. As Philippe said the question is not really Inventor specific, however, since I saw this question asked a few times I decided to write about it:
    http://adndevblog.typepad.com/manufacturing/2015/11/wpf-window-inside-an-inventor-add-in.html

Leave a Reply to RANJANCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading