My First Plugin - Lesson 3 "GetActiveObject" error

My First Plugin - Lesson 3 "GetActiveObject" error

llorden4
Collaborator Collaborator
299 Views
5 Replies
Message 1 of 6

My First Plugin - Lesson 3 "GetActiveObject" error

llorden4
Collaborator
Collaborator

I'm getting a "GetActiveObject" is not a member of "Marshal" error when attempting this tutorial using VS 2022.

 

A Google search on this leads me to believe I might not have the correct Framework loaded.  The VS setup tutorial left a lot of gray area on modules to select so perhaps my selections weren't on the mark and I'm not to the point where I'm fully understanding what I'm doing just yet.  I've taken a screenshot to show my current loaded Frameworks, perhaps someone can identify what I might be off on (and steps to correct would be appreciated).

Error.png

Autodesk Inventor Certified Professional
0 Likes
300 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor

For a "plug in" this is not the correct way:

This method is used for a standalone app.

Use this method instead:

bradeneuropeArthur_0-1650059085277.png

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


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:
My 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 !


 


EESignature

Message 3 of 6

Ralf_Krieg
Advisor
Advisor

Hello

 

In addition, as I can see you reference to .Net Core Framework. What kind of template did you used to create your project?


R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 4 of 6

llorden4
Collaborator
Collaborator

Interesting, this is the tutorial code "as-is" provided.  I wonder what other code might turn out to be unreliable?

Autodesk Inventor Certified Professional
0 Likes
Message 5 of 6

llorden4
Collaborator
Collaborator

I'm new to Visual Studio and again the tutorial wasn't helpful with which modules to select so I had to completely guess at it.  I believe I chose the "WindowsFormsApp" and the "NetCoreFramework", figured those picks were pretty safe.

 

I haven't figured out yet how to get back to that selection menu to add or remove other framework features, I'm still in that learning curve.  Perhaps these options weren't available in the 2017 version and the experience was a bit easier with this tutorial?

Autodesk Inventor Certified Professional
0 Likes
Message 6 of 6

JelteDeJong
Mentor
Mentor

I don't have a tutorial for you. But on GitHub, I have 2 (simple) working addons. You can use them as examples or as a starting point for your own addons. (These addons are also in the Autodesk app store.) If you are going to use them as a start point don't forget to update the GUID or people will get into problems if they load your addons and mine at the same time.  have a look at them:

https://github.com/hjalte79/ShowFullyConstraint

https://github.com/hjalte79/OccurrenceBundler

 

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.

EESignature


Blog: hjalte.nl - github.com