r/InventorAPI • u/im_on_reddit_dot_com • Mar 24 '19
Programming for Autodesk Inventor has been created
This is a place to discuss Add-ins, iLogic, VBA macros, and interface customization for Autodesk Inventor.
r/InventorAPI • u/im_on_reddit_dot_com • Mar 24 '19
This is a place to discuss Add-ins, iLogic, VBA macros, and interface customization for Autodesk Inventor.
r/InventorAPI • u/Nordseepirat • May 14 '19
Hello Pros here,
I am quite new with Inventor ilogic but I would like to automatize a project I have.
I want to create an assembly that is given a number ABCDE.VWXYZ.
For this I have 3-6 different parts which again have 12-24 different sizes. For these parts I have created base parts adapted to size and type via ilogic.
The number includes size, type, making, number and so on of the single parts
So my goal is to open the assembly, enter the correct number and Inventor/ilogic then
- adapts the base parts to the (number driven) correct size and type
- saves the parts with the correct number (the number will be slightly different than the assembly number but driven by it)
Is this possible?
Alternatively I would create the parts in all different sizes and then replace the base parts with the parts I have created. All driven by the assembly number.
r/InventorAPI • u/oomclint • Feb 17 '20
r/InventorAPI • u/oomclint • Sep 14 '19
r/InventorAPI • u/oomclint • Jun 24 '19
r/InventorAPI • u/oomclint • Apr 05 '19
Identification of Cosmetic weld via Inventor 2020 API https://adndevblog.typepad.com/manufacturing/2019/04/recognition-of-cosmetic-weld-via-inventor-2020-api.html
r/InventorAPI • u/oomclint • Feb 04 '20
r/InventorAPI • u/tomkennedy1988 • Jan 09 '20
Hoping someone with some knowledge of how external API calls are processed can help and can shed some light on the issue below.
We have quite a unique implementation of Inventor. We have windows servers that run up to 12 instances of Inventor each. Each instance has its own project file and separate inventor files. An application on each server listens for jobs to process, when a job comes along it opens a specified inventor assembly and executes an iLogic rule via a parameter trigger (the models contain very detailed rules written either in iLogic or contained in a .NET dll) Running the rule via parameter trigger ensures that the API processing is handled ‘in-process’ and has dramatic performance improvements compared to the RunRule API call which processes API calls externally.
We’ve just upgraded from 2017 to 2020 and are seeing some terrible processing speeds. I think I’ve narrowed it down the external API calls we execute from the job processing application, namely opening the file and secondly iterating the assembly to build an XML of the BOM. The BOM process is heavy on API calls - among other things we retrieve all iProperty values from each document - each document can have hundreds of iProperties.
As a comparison generating the BOM in 2017 may take up to 15 minutes at worst. In 2020 worst case is well over 60 minutes.
Nothing has changed in the hardware.
We have a Windows 7 physical machine that is the most severely affected. This was previously the most efficient and most reliable server. Changes on there are the 2020 upgrade and the required Microsoft KB that Autodesk specifies. Other machines are a mixture of physical and virtual windows 10 machines.
I can only assume that there have been changes in how external API requests are handled/prioritised within inventor.
We are working with the developer of the job processing application to try and make the BOM processing logic process as in-process and crossing our fingers that gets us 80% back to normal.
Any help and advice would be greatly appreciated.
Thanks Tom
r/InventorAPI • u/im_on_reddit_dot_com • Mar 27 '19
This code is meant to be run as an external iLogic rule from an assembly file. I do not claim this as original code. I just adapted a few rules I found elsewhere to suit my purpose. It goes through each sheet metal part, creates the flat pattern, and saves it as DXF to the desired path. Code below.
Sub Main()
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument
'If document is not assembly, alert user and exit rule
If oDoc.DocumentType <> kAssemblyDocumentObject Then
MessageBox.Show("This rule must be run from an Assembly.", "iLogic")
Exit Sub
End If
'get user input
RUsure = MessageBox.Show ( _
"This will create a DXF file for all sheet metal components." _
& vbLf & " " _
& vbLf & "Are you sure you want to create a DXF for all of the sheet metal components in this assembly?" _
& vbLf & "This could take a while.", "iLogic - SaveAllDXF ",MessageBoxButtons.YesNo)
If RUsure = vbNo Then
Return
Else
End If
'- - - - - - - - - - - - -Establish DXF Save Path - - - - - - - - - - - -
oPath = ("C:\PATH\TO\FOLDER\") 'Must include final backslash
'- - - - - - - - - - - - -Components - - - - - - - - - - - -
Dim oRefDocs As DocumentsEnumerator
Dim oRefDoc As Document
oRefDocs = oDoc.AllReferencedDocuments
'Iterate through referenced docs
For Each oRefDoc In oRefDocs
Dim oCurFile As Document 'current file
Try
oCurFile = ThisApplication.Documents.Open(oRefDoc.FullFileName, False)
'False == open invisible, True == open visible. invisible is much faster.
Catch
GoTo NextIteration
End Try
If oCurFile.DocumentSubType.DocumentSubTypeID <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
'document is not sheet metal.
oCurFile.Close(True) 'True == skip save
Else
oCurFileName = oCurFile.FullFileName
'get the postion of the last backslash in the path
FNamePos = InStrRev(oCurFileName, "\", -1)
'get the file name with the file extension
FName = Right(oCurFileName, Len(oCurFileName) - FNamePos)
'get the file name (without extension)
FName = Left(FName, Len(FName) - 4)
'set dxf filename
DxfName = oPath & FName & ".dxf"
Dim oSMCD As SheetMetalComponentDefinition = oCurFile.ComponentDefinition
If Not oSMCD.HasFlatPattern Then 'If it doesn't have a flat pattern, create one (unfold the model)
oSMCD.Unfold()
oSMCD.FlatPattern.ExitEdit()
End If
'set dxf options
Dim sOut As String = "FLAT PATTERN DXF?AcadVersion=2004" _
+ "&OuterProfileLayer=IV_INTERIOR_PROFILES" _
+ "&InvisibleLayers=IV_TANGENT;IV_FEATURE_PROFILES_DOWN;IV_BEND;IV_BEND_DOWN;IV_TOOL_CENTER;IV_TOOL_CENTER_DOWN;IV_ARC_CENTERS;IV_FEATURE_PROFILES;IV_FEATURE_PROFILES_DOWN;IV_ALTREP_FRONT;IV_ALTREP_BACK;IV_ROLL_TANGENT;IV_ROLL" _
+ "&SimplifySplines=True" _
+ "&BendLayerColor=255;255;0"
Try
oSMCD.DataIO.WriteDataToFile(sOut, DxfName) 'save the dxf
Catch
End Try
oCurFile.Close(True)
End If
NextIteration:
Next
'- - - - - - - Display Results - - - - - - - - - - - - -
MessageBox.Show("New Files Created in: " & vbLf & oPath & vbLf & vbLf & "Please verify that all DXFs are correct.", "iLogic")
'open the folder where the new files are saved
Shell("explorer.exe " & oPath,vbNormalFocus)End Sub
r/InventorAPI • u/drftdsgnbld • Jun 08 '19
Maybe this is an easy one, but I would like to automatically name the solids in a multibody part so that when I use the “make components” command the file names for all the solids are unique and related to the user inputs. Can you create a specific name for solids generated from a specific extrude command and then for instance, if that solid is patterned, duplicate the name with a suffix like “bracket_3” or similar? Consider the resulting assembly might generate 200 solids but is actually maybe 10 unique parts that are patterned.
r/InventorAPI • u/im_on_reddit_dot_com • Mar 25 '19
Disclaimer: I'm an engineer, not a programmer. I still have a lot to learn, and there is plenty of room for improvement in my current setup.
I'm currently using Inventor 2015 and Visual Studio Express 2012. More recent versions of VSE did not work with Inv2015. And I chose Express because I'm using it for work and did not want to run into any license issue with VSCommunity. I installed the Nifty Add-In Template created by Brian Ekins. It's made for Inventor 2018 and later, but I haven't had an issue yet with 2015. The template contains sample code for creating a button in the tools ribbon while a part document is active in Inventor. Within this template, I added this code to CommandFunctions.vb. This allows me to point to an external iLogic rule, instead of having to convert it to VB.NET.
The end result is that I'm able to keep writing external iLogic rules, and when they are polished and ready to share with the rest of the engineering department, I can just give everyone a button. The button will only appear on the document type where it is meant to be run. No chance of running "Print Drawing" on anything but a drawing document. It ends up looking much cleaner and official than asking everyone to always keep the iLogic browser open and just remember which rules work for each document type.
When I have more time, I may make a more detailed step-by-step guide for this setup. But I wanted to give a quick-and-dirty explanation now in case anyone is trying to make the jump from external rules to add-ins.
Everyone feel free to share your setup, and criticize mine!
r/InventorAPI • u/krull01 • Jul 15 '19
I'm trying to write a small adding that will automatically slice graphics when a 2d sketch is created or edited.
Attached is a snip of the program. What it does is looks for any command that is triggered and checks to see if it is "PartNewSketchCmd". Once the correct command is run, I'm able to Step through the program and see that it will go through the ControlDefinition line, then execute the command (no errors) then exit the sub.
The problem is that the screen does not update. Suggestions on what to change?
r/InventorAPI • u/oomclint • Dec 05 '19
r/InventorAPI • u/oomclint • Aug 31 '19
r/InventorAPI • u/im_on_reddit_dot_com • Jan 31 '20
r/InventorAPI • u/oomclint • May 08 '19
r/InventorAPI • u/oomclint • Jul 07 '19
r/InventorAPI • u/oomclint • Aug 05 '19
I ran into this error on the weekend, and the fix was surprisingly simple: https://clintbrown.co.uk/2019/08/04/ilogic-error-the-cloud-file-provider-is-not-running/

r/InventorAPI • u/oomclint • Feb 22 '20
r/InventorAPI • u/oomclint • Mar 21 '20