Skip to content

About

Companion code for the Inventor transient-graphics blog series (TransientBRep, TransientGeometry, client graphics)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Transient graphics in Inventor — sample project

Companion code for the blog series on building and rendering transient bodies with Inventor's TransientBRep / TransientGeometry / client-graphics APIs, published at https://basautomationservices.com/blog. Every code block in the posts is lifted from this project. The repository grows with the series: each post's code is added when the post goes live.

Post File
Constructing a transient beam in Inventor (introduction, no code)
The TransientBRep construction tree in Inventor InventorGeometry.cs, Post02_ConstructionTree.cs
Getting a transient body on screen in Inventor Post03_BaseGraphics.cs, TransientGraphics.Demo/
Cap faces for a transient beam Profiles.cs, Post04_CapFaces.cs
Side faces for a transient beam Post05_StraightBeam.cs
Clean angled ends on a transient beam Post06_AngledEnds.cs
Rendering a transient beam in the viewport Post07_Rendering.cs

Two projects:

  • src/TransientGraphics.Samples — a class library with the code from the posts. BaseGraphics / BodyGraphics (Post 3) own the client graphics everything is drawn into.
  • src/TransientGraphics.Demo — a console application that attaches to the running Inventor from outside its process and draws one post's sample into the active document.

Building

Requires the .NET 8 SDK and an Inventor installation (the projects reference Autodesk.Inventor.Interop.dll from C:\Program Files\Autodesk\Inventor <version>\Bin\Public Assemblies; set InventorVersion if yours isn't 2025):

dotnet build

The managed geometry types come from the BasAutomation.Geometry package (MIT, source on GitHub).

Running

Start Inventor, open a part or assembly (or let the demo create a part), then:

dotnet run --project src/TransientGraphics.Demo -- 3

The argument is the post number. Each run replaces the previous drawing (the client graphics live under one client id, and constructing BodyGraphics deletes what is already there); clear removes it. The graphics are non-transacting: nothing lands in the undo list, and the document is not marked modified. The demo draws into whatever document is active — including a real one you have open — so run it against a scratch part.

The samples themselves are plain static methods taking Inventor.Application, so they can equally be called from an add-in or a scripting host attached to Inventor:

var graphics = new BodyGraphics(app, partDoc, "Samples");
graphics.AddBody(Post02_ConstructionTree.BuildSheet(app));
graphics.Update();

About

Made by Bas Automation Services: Autodesk Inventor add-ins and CAD automation from Rotterdam.

License

MIT — see LICENSE.

About

Companion code for the Inventor transient-graphics blog series (TransientBRep, TransientGeometry, client graphics)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages