Category: Inventor

  • Rotate assembly component around axis

    <?xml encoding=”UTF-8″>By Adam Nagy There is already a blog post on rotating inside a drawing, now we’ll do the same with an assembly component / component occurrence. Once you have the matrix of the rotation and the current transformation of the component, you just have to combine them and assign that to the component. Just select…

  • Querying a sketch profile to get regions

    <?xml encoding=”UTF-8″>By Adam Nagy Since many people are looking for info on the web I’m also adding here this API Help Sample, which in case of Inventor 2016 can be found in “C:Program FilesAutodeskInventor 2016Local Helpadmapi_20_0.chm”  Description  This sample demonstrates getting region properties from a sketch profile.  VBA Sample Code  To run the sample you must…

  • Slicing a part and getting mass / section properties from resulting bodies

    <?xml encoding=”UTF-8″>By Balaji Ramamoorthy If you wish to slice a part and get mass properties of the resulting bodies and the section properties along the section plane, here are the steps that would be needed using the Inventor API : Slice the part by creating a “SplitFeature” and using the SplitBody API to retain both the…

  • delete and add rows to existing CustomTable

    By Xiaodong Liang Question: Given there is a drawing with at least one custom table,and the existing table is not empty. Can I delete the existing rows and add the new data I need? Solution: Each Row object of CustomTable.Rows provides Delete method that can remove this row. And CustomTable.Rows also provides Add method to…

  • Get constrained occurrences

    <?xml encoding=”UTF-8″>By Adam Nagy When you select a component occurrence in the UI the context menu provides you with the Constrained To option to select all constrained occurrences: If you want to retrieve the same occurrences programmatically, then you can iterate through the constraints of the selected occurrence and store all the occurrences those constraints reference:…

  • Get to iPart factory from a member

    <?xml encoding=”UTF-8″>By Adam Nagy If there are some features that you would like to get from an iPart instance, then you’ll have to get inside the factory, because the instance is just like a derived part referencing the solid from another part document: If you’re using an iPart member inside an assembly then the Open command…

  • Model geometry in different contexts

    <?xml encoding=”UTF-8″>By Adam Nagy There is already a blog post on a similar topic here, and so this one is just to clarify that not only transformations, but model geometry is also affected by it.   a) If you have a part and you modify its PartComponentDefinition then all occurrences of it in assemblies will be…

  • Set Prompted Entry for Sketched Symbol

    <?xml encoding=”UTF-8″>By Adam Nagy You can do it in a similar way to Borders: http://adndevblog.typepad.com/manufacturing/2012/07/getset-the-prompted-text-in-the-border-of-a-sheet-in-inventor-api.html We have the following drawing with a single SketchedSymbolDefinition and instance of it: If we select it in the UI then the following VBA code will change its PrompterEntry value to “NewValue“: Sub MofidyPromptedEntry() Dim oSS As SketchedSymbol Set oSS = ThisApplication.ActiveDocument.SelectSet(1)…

  • Retrieve sketch dimension of part document inside derived assembly

    <?xml encoding=”UTF-8″>By Adam Nagy If you want to retrieve only specific dimensions from the document that is shown in a drawing view then you can use Sheet.DrawingDimensions.GeneralDimensions.Retrieve() We start with this this set of documents (can be found in this forum post):  Here is the d0 dimension in Sketch1 we are trying to get back: Here is…

  • Attribute Helper Update

    Quite a few years ago I wrote a little utility that lets you create, view, and edit attributes within a document.  If you’re relatively new to the Inventor API and are wondering what attributes are, here’s a post giving a quick introduction.  I’ve used the utility quite a bit over the years and haven’t had…