r/InventorAPI • • Dec 11 '23

Inventor Tutorial: Using iLogic to create a Complex Design

7 Upvotes

r/InventorAPI • • Mar 28 '19

Using Python with Inventor API

5 Upvotes

Hey guys, if you are like me and hate writing Code in VBA you can actually write Python scripts for Inventor using the win32com.client module. To use the module, you have to `pip install pywin32`. Here is a sample of a pretty useless script, but it should be good enough to get you going.

If you have any Questions About what's going on here, feel free to ask.

edit: https://pastebin.com/1ZvSpku5

Code formatting doesn't seem to work.


r/InventorAPI • • Mar 25 '19

So what are you working on at the moment?

5 Upvotes

I'm trying to wrap up an underdefined (yay billing by the hour) project

the configurator was easy once the client decided what they wanted

where I'm charging money is for the final function

Copy assy, subcomponents and drawings to new folder and spit out dxf files to project folder

I've almost had it right a few times, until i remembered no one paths the files and drawings the same


r/InventorAPI • • Apr 06 '25

Inventor API and Python

4 Upvotes

Hello everyone, I'm very new to this sub and have some questions

So I am currently working on my Thesis and I want to create a script that automatically creates Wires in Inventor using Python (maybe it's easier in iLogic if you know please let me know).
Right now the code creates a line and a cricle but I fail to create the Sweep feature and I dont know what I'm doing wrong I was already looking into the Inventor API, searched Reddit and Youtube but cant find any answers.

Maybe some of you know what is wrong and can help me :) Any adivice is appreciated

import win32com.client as wc
inv = wc.GetActiveObject('Inventor.Application')

# Create Part Document
#12290 (Part Document) 8962(Metric System) aus der Inventor API Object Module
inv_part_document = inv.Documents.Add(12290, inv.FileManager.GetTemplateFile(12290, 8962))
#inv_part_document = inv.ActiveDocument
#Set a reference to the part component definition
part_component_definition = inv_part_document.ComponentDefinition

#print(dir(part_component_definition)) 
#print(part_component_definition.Workplanes.Item(3).Name) 
tg = inv.TransientGeometry
#create sketch reference
sketch_path = part_component_definition.Sketches.Add(part_component_definition.Workplanes.Item(3))


# Create a path for the sweep (a line and an angled connection)
Line1 = sketch_path.SketchLines.AddByTwoPoints(tg.CreatePoint2d(0, 0), tg.CreatePoint2d(10, 3))
Line2 = sketch_path.SketchLines.AddByTwoPoints(tg.CreatePoint2d(10, 3), tg.CreatePoint2d(15, 3))
Line3 = sketch_path.SketchLines.AddByTwoPoints(tg.CreatePoint2d(15, 3), tg.CreatePoint2d(15, 0))

# Create a second sketch for the circle (profile for sweep)
sketch_profile = part_component_definition.Sketches.Add(part_component_definition.Workplanes.Item(1))
Circle1 = sketch_profile.SketchCircles.AddByCenterRadius(tg.CreatePoint2d(0, 0), 0.1)
Profile = Circle1


# Sweep-Definition 
sweep_def = part_component_definition.Features.SweepFeatures.CreateSweepDefinition(104451, sketch_profile, path, 20485)

# Sweep-Feature 
sweep_feature = part_component_definition.Features.SweepFeatures.Add(sweep_def)
import win32com.client as wc
inv = wc.GetActiveObject('Inventor.Application')

# Create Part Document
#12290 (Part Document) 8962(Metric System) aus der Inventor API Object Module
inv_part_document = inv.Documents.Add(12290, inv.FileManager.GetTemplateFile(12290, 8962))
#inv_part_document = inv.ActiveDocument

#Set a reference to the part component definition
part_component_definition = inv_part_document.ComponentDefinition

#print(dir(part_component_definition)) (zeigt alle möglichkeiten an)
#print(part_component_definition.Workplanes.Item(3).Name) heraussfinden welche Ebene

tg = inv.TransientGeometry
#create sketch reference

sketch_path = part_component_definition.Sketches.Add(part_component_definition.Workplanes.Item(3))


# Create a path for the sweep (a line and an angled connection)
Line1 = sketch_path.SketchLines.AddByTwoPoints(tg.CreatePoint2d(0, 0), tg.CreatePoint2d(10, 3))
Line2 = sketch_path.SketchLines.AddByTwoPoints(tg.CreatePoint2d(10, 3), tg.CreatePoint2d(15, 3))
Line3 = sketch_path.SketchLines.AddByTwoPoints(tg.CreatePoint2d(15, 3), tg.CreatePoint2d(15, 0))

# Create a sketch for the circle (profile for sweep)
sketch_profile = part_component_definition.Sketches.Add(part_component_definition.Workplanes.Item(1))
Circle1 = sketch_profile.SketchCircles.AddByCenterRadius(tg.CreatePoint2d(0, 0), 0.1)
Profile = Circle1


# Sweep-Definition
sweep_def = part_component_definition.Features.SweepFeatures.CreateSweepDefinition(104451, sketch_profile, path, 20485)

# Sweep-Feature
sweep_feature = part_component_definition.Features.SweepFeatures.Add(sweep_def)

r/InventorAPI • • Feb 06 '21

ConfigLoader Release

Thumbnail
self.autodeskinventor
4 Upvotes

r/InventorAPI • • Jan 25 '21

InventorCode Announcement

Thumbnail
self.autodeskinventor
4 Upvotes

r/InventorAPI • • Jan 14 '21

25 iLogic Routines to Speed Up Drawing Creation

Thumbnail
clintbrown.co.uk
4 Upvotes

r/InventorAPI • • Oct 28 '20

iLogic Quick Tip: Delete Sick Dimensions

Thumbnail
clintbrown.co.uk
4 Upvotes

r/InventorAPI • • Oct 24 '20

iLogic: Supress Constraints & Ground All Components

Thumbnail
clintbrown.co.uk
4 Upvotes

r/InventorAPI • • Jul 11 '20

iLogic – Centre & Arrange Dimensions

Thumbnail
self.autodeskinventor
4 Upvotes

r/InventorAPI • • Jul 04 '20

Setting Dimension Precision with iLogic

Thumbnail
self.autodeskinventor
4 Upvotes

r/InventorAPI • • Jun 02 '20

iLogic View Chopper

Thumbnail
self.autodeskinventor
4 Upvotes

r/InventorAPI • • Feb 25 '20

I made a CSharp template for inventor add-ins

Thumbnail
github.com
4 Upvotes

r/InventorAPI • • Oct 12 '19

I want to access the inventor part history tree through the API using python to add features into folders in the tree. Thoughts ?

4 Upvotes

Specifically I want to be able to organize features into folders using the history tree in the part environment

Currently this is only possible in the assembly environment

My goal is to learn to access the inventor API using python to add this functionality

Please advise


r/InventorAPI • • Sep 30 '19

Assembly Surface Areas & an iLogic Hack

Thumbnail
self.autodeskinventor
4 Upvotes

r/InventorAPI • • Mar 24 '19

Programming for Autodesk Inventor has been created

4 Upvotes

This is a place to discuss Add-ins, iLogic, VBA macros, and interface customization for Autodesk Inventor.


r/InventorAPI • • Aug 20 '24

Bevel Gear generator?

3 Upvotes

Is there an add in or anything similar to help with designing a Bevel gear onto a very specific surface and a corresponding gear onto a shaft?

I tried to use the Bevel gear generator in Inventor, but it looks like it doesnt work like the Spur Gear and the worm gear generator.

Any Idea what i could do about this problem?


r/InventorAPI • • Feb 12 '24

Most of the AddIns won't work after Inventor 2025

3 Upvotes

With version 2025, add-ins based on the .NET Framework will no longer work; they must be migrated to the new .NET, which works differently in many ways than the .NET Framework. Even iLogic scripts may need to be adapted.

I think this is very critical, some companies have been using add-ins for decades, and for many of them the source code will no longer be available... That will have an impact!

Don't get me wrong, I think it's good that Autodesk is moving away from the old .NET Framework, but it will hurt.

What do you think about this? Will it affect your work/company?


r/InventorAPI • • Feb 03 '21

Seeking experienced designer/engineer to complete a design. Your help is appreciated! Send a message to connect! ☺️

3 Upvotes

I am currently working on a project, and am in need of some help/direction on completing the design. I am stuck with coming up with the best concept/functionality for the project.


r/InventorAPI • • Dec 19 '20

Export Flat Patterns iPart: Get Name, Export, Repeat

Thumbnail
clintbrown.co.uk
3 Upvotes

r/InventorAPI • • Nov 28 '20

Run iLogic Rules from the Ribbon

Thumbnail
clintbrown.co.uk
3 Upvotes

r/InventorAPI • • Nov 24 '20

Quick Tip: Run “Before Save” Rule Only Once in Assemblies

Thumbnail
clintbrown.co.uk
3 Upvotes

r/InventorAPI • • Oct 17 '20

Running Inventor in the Cloud - with Forge

Thumbnail
clintbrown.co.uk
3 Upvotes

r/InventorAPI • • Jun 27 '20

iLogic: Using Try - Catch to Open Drawings

Thumbnail
self.autodeskinventor
3 Upvotes

r/InventorAPI • • Jun 07 '20

Automating Detail Views With iLogic

Thumbnail
self.autodeskinventor
3 Upvotes