Welcome! Log In Create A New Profile

Advanced

Toolbar Button plugin example?

Posted by 4ndreas 
Toolbar Button plugin example?
August 02, 2014 08:48AM
Hi, I'm trying to write my own Repetier-Host plugin.
I added a button what automatically exports a 3d model from the current open scene in Autodesk Inventor and loads it directly to Repetier-Host. It works good for a first shot.
Is it possible to provide an example of a toolbar button, but I don't get it.

Also in version 1.00 something changed and you need to set the functions
        public void ComponentActivated() { }
and
        private RepetierHostExtender.geom.ThreeDView inThreeD;
        public RepetierHostExtender.geom.ThreeDView Associated3DView { get { return inThreeD; } }
any explanation for that ?

The plugin interface is great, but it's hard to find.

I also get an error message from the plugin at start up:
: Plugin InventorImportPlugin.InventorImportPlugin: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

My next try is a 3DConnexion plugin if i get the SDK.


[chaozlabs.blogspot.de]
Re: Toolbar Button plugin example?
August 04, 2014 04:02AM
Yes, plugin interface was extended a bit. I will publish a updated version soon to help with the new version.

IHost has now 3 getter for the 3 available views:
ThreeDView ObjectsView { get; }
ThreeDView GCodePreviewView { get; }
ThreeDView PrintingView { get; }

public RepetierHostExtender.geom.ThreeDView Associated3DView { get { return inThreeD; } }

should return one of those and not a uninitalized variable.

public void ComponentActivated() { }

is just to update data when user opens the tab. Can be empty if not needed.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Re: Toolbar Button plugin example?
August 07, 2014 11:45AM
Thanks for the hints. It works now, but my error was chaused by:
host.AboutDialog.RegisterThirdParty("InventorImportPlugin", "\r\n\r\Inventor Import Plugin written by 4ndreas");
It's no longer working (not that I care about this feature but it causes the error at startup winking smiley )

I've still no clue how to add a button, but for now I can live with my own tab smiling smiley.


[chaozlabs.blogspot.de]
Re: Toolbar Button plugin example?
August 07, 2014 11:57AM
You are right. AboutDialog gets initalized after FinalizeInitalize which is not very clever. I fixed it for the next 1.0.1 updated coming soon. Until then check if AboutDialog is not null.


Repetier-Software - the home of Repetier-Host (Windows, Linux and Mac OS X) and Repetier-Firmware.
Repetier-Server - the solution to control your printer from everywhere.
Visit us on Facebook and Twitter!
Sorry, only registered users may post in this forum.

Click here to login