Category: Inventor

  • Texture rotation in the Inventor API

    by Vladimir Ananyev Q: How can I access the rotation and scale data of the texture? All these values are stored in the appearance asset in the Inventor document.  An asset is a collection of values of different types. They can be simple types like floats, integers, strings, and Booleans, but they can also be…

  • Convert VBA to .NET / iLogic

    <?xml encoding=”UTF-8″>By Adam Nagy Most of the sample code I publish is in VBA because that is by far the best place to test things out: it’s part of Inventor, it has intelli-sense, lets you step through code, you can place break points, use Watches window to check variable values, see all the objects and their functions…

  • Purge Appearances and Materials

    <?xml encoding=”UTF-8″>By Adam Nagy When you use an Asset, whether it’s Material or Appearance, it gets copied into the document and can be accessed from the following properties of the Document object:– AppearanceAssets– MaterialAssets– Assets (both Appearances and Materials) If you want to get rid of unused items (i.e. purge the assets collection in the document)…

  • List painted area sizes

    <?xml encoding=”UTF-8″>By Adam Nagy If you want to find out how big the areas are in the assembly that need to be covered with certain paints then you can write a code to collect that data. In this case to take into account any face colour that might have been overridden at the main assembly level,…

  • Get all faces and edges as NURBS

    <?xml encoding=”UTF-8″>By Adam Nagy Through the API it’s possible to get back edges (lines, arcs, etc) and also the faces (plane, cylinder) as NURBS. You can use the AlternateBody property of the SurfaceBody object for this. Based on the parameters you provide either only the faces will be converted to NURBS or both the faces and…

  • AU 2015 classes

    If you are coming to AU and interested in Inventor or Fusion 360 programming then you might want to consider the following classes. Brian is doing an Inventor API lab:IM10601-L – You Can Do It—How to Write Programs for InventorAlso will talk about Fusion 360 programming:CP10574 – Customizing Fusion 360 Using Its Programming InterfacePlus head…

  • Get FullFileName of original AnyCAD component

    <?xml encoding=”UTF-8″>By Adam Nagy AnyCAD functionality enables you to include non-native file formats directly in your assembly. For those files the FullDocumentName/FullFileName will be special because Inventor has proxy documents for those components: FullDocumentName:**C:TempAnyCADWorkspacesWorkspaceAnyCADBase.iam*LocalDocs*xFu0c05ic1y3mu2kv3oevwllrOa*<strong>1000083398swa000.iam</strong> FullFileName:**C:TempAnyCADWorkspacesWorkspaceAnyCADBase.iam*LocalDocs*xFu0c05ic1y3mu2kv3oevwllrOa*<strong>1000083398swa000.iam</strong> ————————— FullDocumentName:**C:TempAnyCADWorkspacesWorkspaceAnyCADBase.iam*LocalDocs*xS5rzpyzj10cluts2Febybwr1Bg*<strong>1000082731swp000.ipt</strong> FullFileName:**C:TempAnyCADWorkspacesWorkspaceAnyCADBase.iam*LocalDocs*xS5rzpyzj10cluts2Febybwr1Bg*<strong>1000082731swp000.ipt </strong> If you need to find the original file which is being referenced then you need to look…

  • Face to PlanarSketch

    <?xml encoding=”UTF-8″>By Adam Nagy If you want to turn a Face into a PlanarSketch (e.g. in order to get RegionProperties for it) then the following should work. Create a sketch based on the face, then project all the edges into it. Then you could create a Profile from it, which will of course have RegionProperties: Sub…

  • Create a SweepFeature with Path

    <?xml encoding=”UTF-8″>By Adam Nagy Creating a Sweep Feature is usually quite straight forward. However, you can run into some issues – like the one I’m going to talk about now. If you have two sketches, one used as the Profile (Sketch2) and one used as the Path (Sketch1), then if they are connected through a sketch…

  • Understanding Reference Keys in Inventor

    Reference keys is a topic that not many people know about or understand and is an area I’ve seen people struggle with and misuse. Reference keys are not something you’ll use often in your programs but can be very handy in certain cases.   What is a Reference Key? A reference key is the ID…