r/InventorAPI • u/oomclint • Feb 17 '20
Email your Bill of Materials directly from Inventor
r/InventorAPI • u/oomclint • Feb 17 '20
r/InventorAPI • u/im_on_reddit_dot_com • Jan 31 '20
r/InventorAPI • u/oomclint • Sep 14 '19
r/InventorAPI • u/oomclint • Aug 31 '19
r/InventorAPI • u/oomclint • Jul 07 '19
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/oomclint • May 24 '19
r/InventorAPI • u/oomclint • May 13 '19
r/InventorAPI • u/oomclint • Apr 23 '19
r/InventorAPI • u/im_on_reddit_dot_com • Mar 29 '19
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/oomclint • Mar 25 '19
r/InventorAPI • u/[deleted] • Aug 28 '25
I’m trying to figure out if it’s possible to extract a part from an assembly through code or scripting in Autodesk Inventor.
The main aim is to generate a part file that maintains the same orientation and position as it has inside the assembly (similar to how a derived part works).
Has anyone implemented this through the Inventor API, iLogic, or any external script? Any pointers, examples, or references would be greatly appreciated.
r/InventorAPI • u/jaxetarr • Feb 25 '25
I am a designer drafter using Inventor 2024. I understand rudimentary iLogic rules, but get baffled when looking at the more complex rules. It was suggested once to learn coding to better understand how advanced rules are used.
I am looking for suggestions on a good language to start with that and a good credible online course that I can present to my management for reimbursement.
Thanks
r/InventorAPI • u/HagermanCompany • Dec 20 '23
r/InventorAPI • u/dhillonrobby • Dec 15 '22
Hi as the title says I want to retrieve all the dimensions associated with the sketch block which is used to extrude or sweep.
Is there any way with illogic to a gauge this?
Thanks 🙏
r/InventorAPI • u/jordanrobot • Mar 02 '21
r/InventorAPI • u/oomclint • Dec 05 '20