<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
    <title>Mod the Machine</title>
    
    
    <link rel="alternate" type="text/html" href="http://modthemachine.typepad.com/my_weblog/" />
    <id>tag:typepad.com,2003:weblog-1713640</id>
    <updated>2011-08-22T11:39:36-07:00</updated>
    <subtitle>Discussing Autodesk Inventor's Application Programming Interface (API)</subtitle>
    <generator uri="http://www.typepad.com/">TypePad</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/modthemachine" /><feedburner:info uri="modthemachine" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://hubbub.api.typepad.com/" /><entry>
        <title>Self-Pace Inventor API Development Guide</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/DPlGOemN-R8/self-pace-inventor-api-development-guide.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/08/self-pace-inventor-api-development-guide.html" thr:count="4" thr:updated="2011-12-15T00:15:16-08:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc68834014e8adbde1b970d</id>
        <published>2011-08-22T11:39:36-07:00</published>
        <updated>2011-08-22T11:39:36-07:00</updated>
        <summary>The Autodesk Developer Network (ADN) has recently released a self-paced guide for Inventor API development called “My First Plug-in”. The guide is designed for those of you that are new to programming and doesn’t assume any previous programming experience. Most...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>The Autodesk Developer Network (ADN) has recently released a self-paced guide for Inventor API development called “My First Plug-in”.  The guide is designed for those of you that are new to programming and doesn’t assume any previous programming experience.  Most of the content discusses basic programming concepts and then lets you put them into practice utilizing Inventor’s API (Application Programming Interface) to create a simple program to control the display of occurrences within an assembly.</p>  <p>Even for those of you that are experienced Inventor API developers, if you’ve been using VBA this will serve as a good introduction to VB.Net.  It uses Visual Basic Express, which is available as a free download from Microsoft.</p>  <p>Clicking the picture below will take you to the “My First Plug-In Training” page for Inventor.  There is also a similar tutorial for Revit.</p>  <p><a href="http://www.autodesk.com/myfirstinventorplugin"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="FirstPlug-In" border="0" alt="FirstPlug-In" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015390e845ee970b-pi" width="351" height="88" /></a></p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/08/self-pace-inventor-api-development-guide.html</feedburner:origLink></entry>
    <entry>
        <title>Writing Work Points to an Excel File</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/HjcFaozO214/writing-work-points-to-an-excel-file.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/06/writing-work-points-to-an-excel-file.html" thr:count="3" thr:updated="2011-10-07T15:48:16-07:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc6883401538f7a514e970b</id>
        <published>2011-06-27T12:20:48-07:00</published>
        <updated>2011-06-27T13:01:08-07:00</updated>
        <summary>Here’s a solution to another problem that was recently posed. A customer is creating work points in a part and then needs an Excel file that has the coordinates of the work points. Here’s a VBA macro that will create...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>Here’s a solution to another problem that was recently posed.  A customer is creating work points in a part and then needs an Excel file that has the coordinates of the work points.  Here’s a VBA macro that will create a .csv file that contains the coordinates of the work points.  If you select any work points before running the macro, it will give you the option of exporting only the selected work points or exporting all of the work points.  If no work points are selected, then it will export all work points.  Let me know if you find any issues or have suggestions on how to improve it.</p>  <p><font style="background-color: #ffff00">Update: Since I first posted this I received a question about how to have the macro use the current length units of the document.  I’ve modified it so it now does that.  Previously it was using the internal length unit of centimeters.  It now uses the length specified for the document, but it ignores the number of decimal places specified for the document and always writes out up to 8 decimal places.</font></p>  <p style="line-height: 140%; font-family: courier new; background: #eeeeee; color: black; font-size: 8pt">Public Sub ExportWorkPoints()    <br /><font color="#0000ff"><strong>    ' Get the active part document.        <br /></strong></font>    Dim partDoc As PartDocument     <br />    If ThisApplication.ActiveDocumentType = kPartDocumentObject Then     <br />        Set partDoc = ThisApplication.ActiveDocument     <br />    Else     <br />        MsgBox "A part must be active."     <br />        Exit Sub     <br />    End If     <br />    <br /><font color="#0000ff"><strong>    ' Check to see if any work points are selected.        <br /></strong></font>    Dim points() As WorkPoint     <br />    Dim pointCount As Long     <br />    pointCount = 0     <br />    If partDoc.SelectSet.Count &gt; 0 Then     <br /><font color="#0000ff"><strong>        ' Dimension the array so it can contain the full        <br />        ' list of selected items.         <br /></strong></font>        ReDim points(partDoc.SelectSet.Count - 1)     <br />        <br />        Dim selectedObj As Object     <br />        For Each selectedObj In partDoc.SelectSet     <br />            If TypeOf selectedObj Is WorkPoint Then     <br />                Set points(pointCount) = selectedObj     <br />                pointCount = pointCount + 1     <br />            End If     <br />        Next     <br />        <br />        ReDim Preserve points(pointCount - 1)     <br />    End If     <br />    <br /><font color="#0000ff"><strong>    ' Ask to see if it should operate on the selected points        <br />    ' or all points.         <br /></strong></font>    Dim getAllPoints As Boolean     <br />    getAllPoints = True     <br />    If pointCount &gt; 0 Then     <br />        Dim result As VbMsgBoxResult     <br />        result = MsgBox("Some work points are selected.  " &amp; _     <br />                "Do you want to export only the " &amp; _     <br />                "selected work points?  (Answering " &amp; _     <br />                """No"" will export all work points)", _     <br />                vbQuestion + vbYesNoCancel)     <br />        If result = vbCancel Then     <br />            Exit Sub     <br />        End If     <br />    <br />        If result = vbYes Then     <br />            getAllPoints = False     <br />        End If     <br />    Else     <br />        If MsgBox("No work points are selected.  All work points" &amp; _     <br />                  " will be exported.  Do you want to continue?", _     <br />                  vbQuestion + vbYesNo) = vbNo Then     <br />            Exit Sub     <br />        End If     <br />    End If     <br />    <br />    Dim partDef As PartComponentDefinition     <br />    Set partDef = partDoc.ComponentDefinition     <br />    If getAllPoints Then     <br />        ReDim points(partDef.WorkPoints.Count - 2)     <br />        <br /><font color="#0000ff"><strong>        ' Get all of the workpoints, skipping the first,        <br />        ' which is the origin point.         <br /></strong></font>        Dim i As Integer     <br />        For i = 2 To partDef.WorkPoints.Count     <br />            Set points(i - 2) = partDef.WorkPoints.Item(i)     <br />        Next     <br />    End If     <br />    <br /><font color="#0000ff"><strong>    ' Get the filename to write to.        <br /></strong></font>    Dim dialog As FileDialog     <br />    Dim filename As String     <br />    Call ThisApplication.CreateFileDialog(dialog)     <br />    With dialog     <br />        .DialogTitle = "Specify Output .CSV File"     <br />        .Filter = "Comma delimited file (*.csv)|*.csv"     <br />        .FilterIndex = 0     <br />        .OptionsEnabled = False     <br />        .MultiSelectEnabled = False     <br />        .ShowSave     <br />        filename = .filename     <br />    End With     <br />    <br />    If filename &lt;&gt; "" Then     <br /><font color="#0000ff"><strong>        ' Write the work point coordinates out to a csv file.        <br /></strong></font>        On Error Resume Next     <br />        Open filename For Output As #1     <br />        If Err.Number &lt;&gt; 0 Then     <br />            MsgBox "Unable to open the specified file. " &amp; _     <br />                   "It may be open by another process."     <br />            Exit Sub     <br />        End If     <br />        <br /><font color="#0000ff"><strong>        ' Get a reference to the object to do unit conversions.       <br /></strong></font>        Dim uom As UnitsOfMeasure     <br />        Set uom = partDoc.UnitsOfMeasure     <br />        <br /><font color="#0000ff"><strong>        ' Write the points, taking into account the current default       <br />        ' length units of the document.        <br /></strong></font>        For i = 0 To UBound(points)     <br />            Dim xCoord As Double     <br />            xCoord = uom.ConvertUnits(points(i).Point.X, _  <br />                 kCentimeterLengthUnits, kDefaultDisplayLengthUnits)     <br />                     <br />            Dim yCoord As String     <br />            yCoord = uom.ConvertUnits(points(i).Point.Y, _  <br />                 kCentimeterLengthUnits, kDefaultDisplayLengthUnits)     <br />                     <br />            Dim zCoord As String     <br />            zCoord = uom.ConvertUnits(points(i).Point.Z, _  <br />                 kCentimeterLengthUnits, kDefaultDisplayLengthUnits)     <br />                     <br />            Print #1, points(i).Name &amp; "," &amp; _     <br />                Format(xCoord, "0.00000000") &amp; "," &amp; _     <br />                Format(yCoord, "0.00000000") &amp; "," &amp; _     <br />                Format(zCoord, "0.00000000")     <br />        Next     <br />        <br />        Close #1     <br />        <br />        MsgBox "Finished writing data to """ &amp; filename &amp; """"     <br />    End If     <br />End Sub</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/06/writing-work-points-to-an-excel-file.html</feedburner:origLink></entry>
    <entry>
        <title>Moving a Part in a Flexible Assembly</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/CtYEtdyx7Vo/moving-a-part-in-a-flexible-assembly.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/06/moving-a-part-in-a-flexible-assembly.html" thr:count="1" thr:updated="2011-12-14T02:20:02-08:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc6883401538f51b99f970b</id>
        <published>2011-06-20T15:27:38-07:00</published>
        <updated>2011-06-20T15:27:38-07:00</updated>
        <summary>I recently received a question that I thought there might be some general interest in the answer. Here’s the problem. I have the assembly shown below. It’s free to move in the ways you would expect; it can pivot about...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>I recently received a question that I thought there might be some general interest in the answer.  Here’s the problem.  I have the assembly shown below.  It’s free to move in the ways you would expect; it can pivot about the base and the arm can extend.  Everything is fine so far.</p>  <p><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834014e8944fce9970d-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="ArmAssembly" border="0" alt="ArmAssembly" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f51b996970b-pi" width="321" height="321" /></a></p>  <p>Next I insert the arm assembly shown above into a new assembly.  Then I insert the yellow block part into the assembly and constrain it to the tip of the arm, as shown below.</p>  <p><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f51b99b970b-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="ArmAssemblyFull" border="0" alt="ArmAssemblyFull" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834014e8944fcee970d-pi" width="313" height="327" /></a></p>  <p>First, the arm assembly is rigid if I try to move any of its parts.  That’s the behavior I would expect because, by default, subassemblies are rigid within an assembly.  However, you can set the subassembly occurrence to be “flexible” so that it will behave the same as it does when the subassembly is active.  That is, the arms can be dragged and the positions of all of the connected parts will update.  I can also drag the yellow block and that will cause the arms to reposition to follow the block.</p>  <p>The question posed was how to move the block using the API and still get the arms to follow.  The expectation, which I shared, is that setting the transformation for the yellow block to reposition it should automatically reposition everything else that’s connected to it.  This is probably how it should behave but it’s not.  When setting the position of the yellow block nothing happens.  The yellow block doesn’t move and the arm subassembly doesn’t move.</p>  <p>I played around with a couple of ideas and one of them does work.  It’s simple to implement so should be an acceptable workaround.  It temporarily grounds the part that’s being moved.  The API to move a part will move a grounded part and when the assembly computes, the grounded part has a higher priority in the solver than the flexible assembly so the flexible assembly adjusts to the change.</p>  <p>Here’s the code I used to test this.</p>  <p style="line-height: 140%; font-family: courier new; background: #eeeeee; color: black; font-size: 8pt">Public Sub MovePart()    <br /><font color="#0000ff"><strong>    ' Have the occurrence that will be moved selected.        <br /></strong></font>    Dim occ As ComponentOccurrence     <br />    Set occ = ThisApplication.CommandManager.Pick( _  <br />                                       kAssemblyOccurrenceFilter, _  <br />                                       "Select an occurrence.")     <br />    <br /><font color="#0000ff"><strong>    ' Get the current grounded state of the selected occurrence.  <br /></strong></font>    Dim groundState As Boolean     <br />    groundState = occ.Grounded     <br />    <br /><font color="#0000ff"><strong>    ' Ground the occurrence.        <br /></strong></font>    occ.Grounded = True     <br />    <br /><font color="#0000ff"><strong>    ' Change the position of the occurrence.  This repositions it        <br />    ' in a series of steps to create a short animation.  It moves         <br />    ' it 0.5 cm in the Y direction for each step.         <br /></strong></font>    Dim i As Integer     <br />    For i = 1 To 10     <br />        Dim trans As Matrix     <br />        Set trans = occ.Transformation     <br />        trans.Cell(2, 4) = trans.Cell(2, 4) + .5     <br />        occ.Transformation = trans     <br />    Next    <br />    <br /><font color="#0000ff"><strong>    ' Reset the grounded state of the occurrence back to        <br />    ' its original state.         <br /></strong></font>    occ.Grounded = groundState     <br />End Sub</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/06/moving-a-part-in-a-flexible-assembly.html</feedburner:origLink></entry>
    <entry>
        <title>Last Chance for Input</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/qSOQOql0ioo/last-chance-for-input.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/06/last-chance-for-input.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc68834014e8928c3ed970d</id>
        <published>2011-06-15T09:06:48-07:00</published>
        <updated>2011-06-15T09:06:48-07:00</updated>
        <summary>The Inventor API survey has been extended. You now have until June 17th to provide your input. This helps us a lot in determining what we’re going to do in upcoming releases so please give us your opinion on what’s...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>The Inventor API survey has been extended.  You now have until June 17th to provide your input.  This helps us a lot in determining what we’re going to do in upcoming releases so please give us your opinion on what’s important.</p>  <p><a href="http://www.zoomerang.com/Survey/WEB22C9QBPTEZ5"><b>http://www.zoomerang.com/Survey/WEB22C9QBPTEZ5</b></a></p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/06/last-chance-for-input.html</feedburner:origLink></entry>
    <entry>
        <title>Correction to Feature Stepper Macro</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/BcOa636ge20/correction-to-feature-stepper-macro.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/06/correction-to-feature-stepper-macro.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc68834014e891e9fe1970d</id>
        <published>2011-06-13T16:00:08-07:00</published>
        <updated>2011-06-13T16:00:08-07:00</updated>
        <summary>I’ve just corrected a problem to the code from my previous post for the macro that steps through the features in a part. It just shows you that I didn’t test if very thoroughly. The previous version only works on...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>I’ve just corrected a problem to the code from my <a href="http://modthemachine.typepad.com/my_weblog/2011/06/stepping-through-the-features-of-a-model.html">previous post</a> for the macro that steps through the features in a part.  It just shows you that I didn’t test if very thoroughly.  The previous version only works on sheet metal parts.  The new version works on regular parts too.  If you already got the code, you just need to download the zip file, unpack it, delete the form from your VBA project, and re-import the form file.</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/06/correction-to-feature-stepper-macro.html</feedburner:origLink></entry>
    <entry>
        <title>Stepping Through the Features of a Model</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/B_-WAxu-_b4/stepping-through-the-features-of-a-model.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/06/stepping-through-the-features-of-a-model.html" thr:count="3" thr:updated="2011-07-28T05:35:53-07:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc68834015432ecb56f970c</id>
        <published>2011-06-10T13:01:20-07:00</published>
        <updated>2011-06-10T13:01:20-07:00</updated>
        <summary>A recent question came in about a way to make it easy to step through the features in the browser. Of course you can do this manually by dragging the stop node feature-by-feature in the tree, but that quickly becomes...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>A recent question came in about a way to make it easy to step through the features in the browser.  Of course you can do this manually by dragging the stop node feature-by-feature in the tree, but that quickly becomes tedious.  Here’s my answer to problem.  It’s a small VBA program that displays a form as shown below.</p>  <p><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4b9970c-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="FeatureStep" border="0" alt="FeatureStep" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4c1970c-pi" width="165" height="91" /></a></p>  <p>Pressing the buttons let’s you move the stop node to the top, to the bottom, or advanced it one step at a time, either up or down the tree.  A utility like this can be useful when you’ve received a model from someone else and want to understand how it was built.</p>  <p>I think the trickiest part about using this program will be adding it to your VBA project.  Fortunately you only have to do that once.  Below is the step-by-step process to add it to your default VBA project and create a button in the ribbon to execute it.</p>  <ol>   <li>Download and unzip the <a href="http://modthemachine.typepad.com/FeatureStep.zip">code files</a>.  You can unzip them anywhere on your computer. </li>    <li>Run Inventor and open the VBA development environment, (Alt-F11). </li>    <li>Right-click on the “ApplicationProject” node in the Project window and select “Import File…”, as shown below.      <br />      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4c7970c-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="FeatureStep VBA1" border="0" alt="FeatureStep VBA1" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4cd970c-pi" width="379" height="401" /></a>       <br /></li>    <li>Select the “FeatureStep.frm” file that you unpacked previously from the zip file.      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4d3970c-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="FeatureStep VBA3" border="0" alt="FeatureStep VBA3" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4e1970c-pi" width="404" height="284" /></a>       <br /></li>    <li>In the VBA project window, double-click on Module1, within the Modules folder.  This will open up the code window.  <br />      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb4fc970c-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="FeatureStep VBA4" border="0" alt="FeatureStep VBA4" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f196525970b-pi" width="464" height="298" /></a>      <br /></li>    <li>Copy and paste the code below into that window, as shown above.      <br />      <p style="line-height: 140%; font-family: courier new; background: #eeeeee; color: black; font-size: 8pt"><font color="#0000ff"><strong>' Macro to reposition stop node in browser.            <br /></strong></font>Public Sub FeatureStep()         <br />    Dim featureStepForm As New frmFeatureStep         <br />    If featureStepForm.Init Then         <br />        featureStepForm.Show vbModeless         <br />    End If         <br />End Sub   <br /></p>   </li>    <li>The following steps will create a button on the ribbon to run the macro.  Have a part open, making sure you’re in the modeling environment and a sketch is not active.  Right-click anywhere on the ribbon and select the “Custom User Commands…” command from the context menu, as shown below.     <br />      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834014e890c9e85970d-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="FeatureStep VBA5" border="0" alt="FeatureStep VBA5" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f196541970b-pi" width="349" height="328" /></a>       <br /></li>    <li>In the Customize dialog, first choose “Macros” in the “Choose commands from” drop-down.  Next, select the “FeatureStep” macro from the list.  (If it’s not in the list, double-check that you followed the previous steps correctly.)  Finally, click the “&gt;&gt;” button to move that macro the to the right side of the dialog.      <br />      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f196554970b-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="FeatureStep VBA6" border="0" alt="FeatureStep VBA6" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb530970c-pi" width="454" height="369" /></a>       <br /></li>    <li>Edit the settings on the button to display text.      <br />      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f19656f970b-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="FeatureStep VBA7" border="0" alt="FeatureStep VBA7" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f19657c970b-pi" width="320" height="96" /></a>       <br />      <br />You should see the following in the ribbon.  If you want the command available on the Sheet Metal modeling ribbon, you’ll need to repeat steps 6 through 8 while a sheet metal document is open.      <br /><a href="http://modthemachine.typepad.com/.a/6a00e553fcbfc68834015432ecb556970c-pi"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="FeatureStep VBA8" border="0" alt="FeatureStep VBA8" src="http://modthemachine.typepad.com/.a/6a00e553fcbfc6883401538f196598970b-pi" width="163" height="120" /></a>       <br /></li> </ol></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/06/stepping-through-the-features-of-a-model.html</feedburner:origLink></entry>
    <entry>
        <title>Inventor API Survey</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/U_3D2eJVXok/inventor-api-survey.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/05/inventor-api-survey.html" thr:count="1" thr:updated="2011-06-09T21:19:44-07:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc688340154327e4c46970c</id>
        <published>2011-05-23T16:40:05-07:00</published>
        <updated>2011-05-23T16:40:05-07:00</updated>
        <summary>It’s time once again to make your voice heard. The annual Inventor API survey has begun and is all about getting your input about what API functionality we should be working on for future Inventor releases. The questions this year...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>It’s time once again to make your voice heard.  The annual Inventor API survey has begun and is all about getting your input about what API functionality we should be working on for future Inventor releases.  The questions this year a little more specific than they’ve been in the past.  Hopefully, this will help us to be able to more clearly define the areas where there’s the most need.  If there’s something you need and it’s not listed, please feel free to list it.  Just click the link below to go to Kean Walmsley’s blog post for the link to survey and more information.</p>  <p><a href="http://through-the-interface.typepad.com/through_the_interface/2011/05/api-wishlist-surveys-for-autodesk-products.html">Inventor API Survey</a></p>  <p>Thank you for participating.</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/05/inventor-api-survey.html</feedburner:origLink></entry>
    <entry>
        <title>Saving 3D DWG Using the DWG Translator</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/2srlPk4OrJk/saving-3d-dwg-using-the-dwg-translator.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/05/saving-3d-dwg-using-the-dwg-translator.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc68834015432639c6b970c</id>
        <published>2011-05-18T12:19:27-07:00</published>
        <updated>2011-05-18T12:19:27-07:00</updated>
        <summary>Some new functionality in Inventor 2012 is the ability to save 3D part and assembly models to a DWG file. Ok, this isn’t exactly new but the previous way to do it was a bit of a workaround by using...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>Some new functionality in Inventor 2012 is the ability to save 3D part and assembly models to a DWG file.  Ok, this isn’t exactly new but the previous way to do it was a bit of a workaround by using the AEC Exchange application (now known as BIM Exchange) to create the DWG file.  In Inventor 2012 the DWG translator has been expanded to support 3D so you can use the Save Copy As command and select “AutoCAD DWG Files” as the file type.  In the options dialog you can choose which of the following types to write out; Solid, Surface, or Sketch.  You can also specify which version of DWG you want to create; 2000, 2004, 2007, or 2010.</p>  <p>It’s also possible to do the same thing through the API by controlling the DWG translator add-in as shown below.  The result of running the VBA macro below is that it will save the solids in the active part or assembly as an AutoCAD 2010 DWG file called “C:\Temp\DWGOutTest.dwg”.  The options are documented in the comments.</p>  <p style="line-height: 140%; font-family: courier new; background: #eeeeee; color: black; font-size: 8pt">Public Sub SaveCopyAsDWG3D()    <br /><font color="#0000ff"><strong>    ' Get the DWG translator Add-In.  <br /></strong></font>    Dim DWGAddIn As TranslatorAddIn     <br />    Set DWGAddIn = ThisApplication.ApplicationAddIns.ItemById( _     <br />                         "{C24E3AC2-122E-11D5-8E91-0010B541CD80}")     <br />    <br /><font color="#0000ff"><strong>    ' Get the active document.  Can be either a part or assembly.        <br /></strong></font>    Dim doc As Document  <br />    Set doc = ThisApplication.ActiveDocument  <br />    <br />    Dim transObjs As TransientObjects     <br />    Set transObjs = ThisApplication.TransientObjects     <br />    <br /><font color="#0000ff"><strong>    ' Set up the context to define an output file.        <br /></strong></font>    Dim context As TranslationContext     <br />    Set context = transObjs.CreateTranslationContext     <br />    context.Type = kFileBrowseIOMechanism     <br />    <br /><font color="#0000ff"><strong>    ' Get the available options from the translator.        <br /></strong></font>    Dim options As NameValueMap     <br />    Set options = transObjs.CreateNameValueMap     <br />    If DWGAddIn.HasSaveCopyAsOptions(doc, context, options) Then     <br /><font color="#0000ff"><strong>        ' Set the options for what types of data to write out.  <br /></strong></font>        options.Value("Solid") = True      ' Output solids.  <br />        options.Value("Surface") = False   ' Output surfaces.  <br />        options.Value("Sketch") = False    ' Output sketches.     <br />        <br /><font color="#0000ff"><strong>        ' Set the DWG version.        <br />        ' 23 = ACAD 2000         <br />        ' 25 = ACAD 2004         <br />        ' 27 = ACAD 2007         <br />        ' 29 = ACAD 2010  <br /></strong></font>        options.Value("DwgVersion") = 29     <br />    End If     <br />    <br /><font color="#0000ff"><strong>    ' Set the output filename, using a DataMedium object.        <br /></strong></font>    Dim oDataMedium As DataMedium     <br />    Set oDataMedium = transObjs.CreateDataMedium     <br />    oDataMedium.filename = "c:\temp\DWGOutTest.dwg"     <br />    <br /><font color="#0000ff"><strong>    ' Call the SaveCopyAs method of the translator add-in.        <br /></strong></font>    Call DWGAddIn.SaveCopyAs(doc, context, options, oDataMedium)     <br />End Sub</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/05/saving-3d-dwg-using-the-dwg-translator.html</feedburner:origLink></entry>
    <entry>
        <title>Inventor 2012</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/ImAFtW-dBYE/inventor-2012.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/04/inventor-2012.html" thr:count="3" thr:updated="2011-04-19T11:08:35-07:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc688340147e3c16840970b</id>
        <published>2011-04-05T08:50:46-07:00</published>
        <updated>2011-04-05T08:50:46-07:00</updated>
        <summary>Inventor 2012 has been announced and you’ve probably seen various press reports on some of the new features. Inventor 2012 also a lot of new functionality in the API. You can find a presentation of what’s new in the API,...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>Inventor 2012 has been announced and you’ve probably seen various press reports on some of the new features.  Inventor 2012 also a lot of new functionality in the API.  You can find a presentation of what’s new in the API, along with some samples on the <a title="http://www.autodesk.com/developinventor" href="http://www.autodesk.com/developinventor">http://www.autodesk.com/developinventor</a> website.  An updated object model chart is also available there.</p>  <p>There will also be a live showing of this presentation on April 7th, where I’ll be going through the same presentation you can download above.  It’s free and you can sign up for the webcast at <a href="http://www.adskconsulting.com/adn/cs/api_course_sched.php">ADN Course Schedule</a> page.  Look for the class titled “DevDays Online: Inventor 2012 API updates” and click the “Register” link.</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/04/inventor-2012.html</feedburner:origLink></entry>
    <entry>
        <title>Recommended Books</title>
        <link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/modthemachine/~3/zmdp750FbLg/recommended-books.html" />
        <link rel="replies" type="text/html" href="http://modthemachine.typepad.com/my_weblog/2011/03/recommended-books.html" thr:count="2" thr:updated="2011-04-24T12:28:38-07:00" />
        <id>tag:typepad.com,2003:post-6a00e553fcbfc688340147e3407454970b</id>
        <published>2011-03-16T07:07:44-07:00</published>
        <updated>2011-03-16T07:07:44-07:00</updated>
        <summary>With Sanjay moving onto another job and also some other additional responsibilities, I’ve been very busy lately. Part of the other work I’ve been doing has involved quite a bit of code writing. I want to point out a couple...</summary>
        <author>
            <name>Brian Ekins</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://modthemachine.typepad.com/my_weblog/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>With Sanjay moving onto another job and also some other additional responsibilities, I’ve been very busy lately.  Part of the other work I’ve been doing has involved quite a bit of code writing.  I want to point out a couple of books that I have that I keep going to back to for reference.  You have to keep in mind that the primary target audience for these books is someone coming from VB6 and moving to VB.Net, which is my background, so I’m not sure how useful all of you will find these, but I found them well worth the money.</p>  <p>I would also like to hear what books you’ve found useful.  A category of book where I don’t have much experience are those for beginning programmers and would especially like to know if any of you have found books in this category that you would recommend.  Here are the books I can recommend:</p>  <p><strong>The .NET Languages: A Quick Translation Guide</strong> by Brian Bischof    <br />I found this book the most useful when I was first transitioning to VB.Net.  It lists common functionality in VB6 and compares it with the equivalent functionality in both VB.Net and C#.</p>  <p>Used and new copies are available on Amazon for about $5, including postage.</p>  <p><strong>Programming Microsoft Visual Basic .Net</strong> by Francesco Balena    <br />I got my copy of this book in the early days of VB.Net  There’s been one updated edition since then for VB.Net 2003 but the content still applies.  It’s a massive book at over 1500 pages and has answered most of my questions when I need to do something in VB.Net that I haven’t done before.  This is the book that I keep by my keyboard and turn to the most now.</p>  <p>Used copies of this book are also available on Amazon for a good deal.  The only problem with the used copies is that a lot of them may not come with the included CD.  I glanced at the CD content when I first got the book but haven’t used it since then so I’m not sure how useful it is, but if you have a choice you just as well get a copy that contains the CD.</p></div>
</content>



    <feedburner:origLink>http://modthemachine.typepad.com/my_weblog/2011/03/recommended-books.html</feedburner:origLink></entry>
 
</feed><!-- ph=1 -->

