- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Inventor - vb.net Visual Studio - getting started
Some of my previous requests relate to a grand idea to import a list of files into Inventor for further processing - printing, converting, replacing references on drawings, shrinkwrapping - a little like the task scheduler but the list can be exported from the PDM system & imported to excel & tweaked accordingly.
A VBA version to replace drawing references has been produced but VBA is 'unsupported' so a VB.net tool is being sort. (thanks: https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/set-drawing-scale-from-list-using-vb... )
My guess is to move data between Excel & Inventor I need a better understanding of sub, function, public & private - relating to Inventor & Excel & how the lines of code target the information - there is a lot of code available & I can have it trigger error messages.
Here is 'Hello Inventor' - just finding code to launch Inventor took some searching..
After creating a windows form this was added in the button sub & it works, as in it will open Inventor:
Dim proc As New System.Diagnostics.Process()
proc = Process.Start("C:\Program Files\Autodesk\Inventor 2018\Bin\Inventor.exe", "")
Dim oPart As Document
Dim oPartPath As String
Dim Thisdoc As Inventor.DocumentIt was just a test to see how to open Inventor ( ideally Apprentice will be used for the finished tool).
Further testing to open specific files is throwing up errors which don't happen in iLogic because iLogic sits on Inventor & Visual Studio is outside Inventor. This project is to chop & change from file to file which (I'm advised) isn't iLogic friendly. ( also compared to iLogic efforts the VBA version is fast!).
The code between lines 18-35 was pasted in from an iLogic post with the intention it could be converted but the error messages are stumbling blocks.
Lines 33/34 are for the next test - have them opened/closed in Inventor by the form - just to test it can be done.
Great to see this tutorial:
http://www.hjalte.nl/60-creating-an-inventor-addin
Would be ideal if a pure vb.net version could be offered ( @JelteDeJong ) ; I did read if there are other ideas out there forward them on!
Back to the search...
Regards
Andrew
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thankyou, trying to figure this out..
'<typename>' is an interface type and cannot be used as an expression
A type name occurs where an expression is required. An expression must consist of a combination of variables, constants, literals, properties, and Function procedure calls.
Error ID: BC30111
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As far as I know, is the entire tutorial in pure VB.net. So I'm not sure what you would like to see.
If you want to create a standalone application then you might want to have a look at the 3e part of the tutorial "Debugging without restating Inventor".
- Creating an Inventor Addin
- Adding icons to your buttons
- Debugging without restarting Inventor
- Adding a form to your addin
There I create a application that connects to Inventor and runs as a standalone application. Here are the basics for getting the Inventor object. (It will start Inventor if it is not started jet.)
Dim ThisApplication As Inventor.Application
Try
ThisApplication = Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
Catch ex As Exception
Dim oType As Type = Type.GetTypeFromProgID("Inventor.Application")
ThisApplication = System.Activator.CreateInstance(oType)
ThisApplication.Visible = True
End Try
Dim ThisDoc As Document = ThisApplication.ActiveDocument
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks for the reply.
Think I've started off on the wrong foot (again), used a windows form & not a method?
Not 100% sure - trying again with a different template.
Misunderstood the iLogic tutorial.
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Many thanks for the effort that's gone into the tutorials - I have a button!
Need to figure out how to use the button now.
Working through MyDebug & not seeing ThisRule() to add as a reference - should ThisRule() have a .dll?
Progressing, slowly..
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Forgive my ignorance.. is the 'myiLogicAddin' designed to allow iLogic to run from VB.net?
When adding an iLogic line of code a 'Not Declared' error is returned.
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
No that will not work!
Regards,
Arthur Knoors
Autodesk Affiliations:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report