Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Best practices for Revit Addin #2

Open
2 tasks
fraguada opened this issue Mar 6, 2018 · 8 comments
Open
2 tasks

Best practices for Revit Addin #2

fraguada opened this issue Mar 6, 2018 · 8 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@fraguada
Copy link
Contributor

fraguada commented Mar 6, 2018

Please advise on the proper way to set up a Revit Addin.
For example:

  • How to best integrate into the Add-In Ribbon?
  • How to distribute the addin? Is there such as a thing as an addin installer, or do we have to make one?
    ...
@fraguada fraguada added the help wanted Extra attention is needed label Mar 6, 2018
@fraguada fraguada added this to the 0.5.0 milestone Mar 6, 2018
@radumg
Copy link

radumg commented Mar 6, 2018

How to best integrate into the Add-In Ribbon?

  • create a new Speckle ribbon tab
  • in that tab, create relevant panels, such as Settings/Setup, Senders, Receivers, etc.
  • each action is an ExternalCommand and is represented in the ribbon with 1 button
  • add said buttons to respective panels

How to distribute the addin? Is there such as a thing as an addin installer, or do we have to make one?

There's 2 things required :

  • .addin manifest file, this describes what the addin does and points it to the entry DLL file, placed in C:\ProgramData\Autodesk\Revit\Addins\2018
  • .dll as the entry point assembly that gets loaded, typically in same folder as manifest but not a requirement to do so. Any other dlls/dependencies are in the same folder

Depending on permissions to copy data to that folder, an installer might be required.

@radumg
Copy link

radumg commented Mar 6, 2018

@fraguada , i can extract a pretty good/clear boilerplate & utils from our current Revit tools for the Ribbon creation and post-build steps so the addin is installed on build

@archinate
Copy link
Contributor

@fraguada I have a good Revit VS template setup for this that I can provide. The Ribbon/icons, etc are registered through the ExternalApplication when Revit starts up. ExternalCommands are fired through the ribbon buttons. It may be good to wireframe out the Speckle-Revit interaction a bit. I use Dockable windows for many of our apps which requires some special setup but I could see them being very useful for Speckle

@fraguada
Copy link
Contributor Author

fraguada commented Mar 6, 2018

@radumg really helpful information! At the moment I have this under 'External Tools' in the Add-In ribbon. I didn't get so far as to googling how to make a button yet. Also good to know particularities related to addin distribution.

@archinate That would be very helpful. I just cobbled this together from a few sources on the web. Literally my first Revit addin.

It may be good to wireframe out the Speckle-Revit interaction a bit.

Agreed. You can see how this works in Rhino in the Interop.cs class and in the SpeckleRhinoReceiver.cs / SpeckleRhinoSender.cs. As well as the components in SpeckleView.

I use Dockable windows for many of our apps which requires some special setup but I could see them being very useful for Speckle

100% agree!

@radumg
Copy link

radumg commented Mar 6, 2018

At the moment I have this under 'External Tools' in the Add-In ribbon

If no ribbon/panel is specified, all ExternalCommands end up here, good start.

@archinate if you'd like to share the VS template, that would be a good starting point, happy to contribute to it with anything else i might have. I generally start from Jeremy's VS template before making project-specific ones.

@fraguada - could we get a slightly more digestible list of things that need to happen with the plugin, in chronological order ? I'm getting a bit lost in that Interop.cs.

@fraguada
Copy link
Contributor Author

fraguada commented Mar 6, 2018

For anything to start working, SpeckleRevitConverter #4 has to be started.
Interop deals with the communication between the UI and the plugin. I'll do my best to make this clearer in the coming days.

@archinate
Copy link
Contributor

@fraguada I migrated your stuff to a template Revit project. Nothing fancy. We can wireframe the project a bit. The PR is #13

@arif-hanif
Copy link

arif-hanif commented Mar 7, 2018

@fraguada @archinate @radumg I would love to join in and help on this project, anyone got a slack channel we can hop in?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants