Add-In not loading (Rider IDE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello! I'm a newby in programming, i have only 3 month in Inventor API via C# direct work, but now i need to make some Add-In's to work with specification. Unfortunatly, i'm JetBrains Rider IDE user, so i "re-make" VS original samples.
A found a few HOW-TO's and went through first steps, in result i can see my Add-In and information in Inventor, but as soon as i try to load it - nothing happens.
Also i connect to Inventor process to debug, but all Errors that i see are those in ref. What am i doing wrong? How can i see why my Add-In is visible, but not loading?
Ref:
System.Windows.Data Error: 40 : BindingExpression path error: 'Current' property not found on 'object' ''QuickAccessUndoButton' (HashCode=47915903)'. BindingExpression:Path=Current; DataItem='QuickAccessUndoButton' (HashCode=47915903); target element is 'ContentPresenter' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 40 : BindingExpression path error: 'Current' property not found on 'object' ''QuickAccessRedoButton' (HashCode=22724462)'. BindingExpression:Path=Current; DataItem='QuickAccessRedoButton' (HashCode=22724462); target element is 'ContentPresenter' (Name=''); target property is 'NoTarget' (type 'Object')
My Add-In code:
using System;
using System.Runtime.InteropServices;
using Inventor;
using Microsoft.Win32;
using Application = Inventor.Application;
namespace SimpleSpecification
{
/// <summary>
/// This is the primary AddIn Server class that implements the ApplicationAddInServer interface
/// that all Inventor AddIns are required to implement. The communication between Inventor and
/// the AddIn is via the methods on this interface.
/// </summary>
[GuidAttribute("69B0E76B-C139-41C7-A88F-030ED1E19448"), ComVisible(true)]
public class AddIn : ApplicationAddInServer
{
// Inventor application object.
private Application? _mInventorApplication;
public AddIn(Application? mInventorApplication)
{
_mInventorApplication = mInventorApplication;
}
#region ApplicationAddInServer Members
public void Activate(ApplicationAddInSite addInSiteObject, bool firstTime)
{
// This method is called by Inventor when it loads the addin.
// The AddInSiteObject provides access to the Inventor Application object.
// The FirstTime flag indicates if the addin is loaded for the first time.
// Initialize AddIn members.
_mInventorApplication = addInSiteObject.Application;
MessageBox.Show("Success load!");
}
public void Deactivate()
{
// This method is called by Inventor when the AddIn is unloaded.
// The AddIn will be unloaded either manually by the user or
// when the Inventor session is terminated
// TODO: Add ApplicationAddInServer.Deactivate implementation
MessageBox.Show("Success unload!");
// Release objects.
_mInventorApplication = null;
GC.Collect();
GC.WaitForPendingFinalizers();
}
public void ExecuteCommand(int commandID)
{
// Note:this method is now obsolete, you should use the
// ControlDefinition functionality for implementing commands.
}
public object? Automation
{
// This property is provided to allow the AddIn to expose an API
// of its own to other programs. Typically, this would be done by
// implementing the AddIn's API interface in a class and returning
// that class object through this property.
get
{
// TODO: Add ApplicationAddInServer.Automation getter implementation
return null;
}
}
#endregion
}
}