architecture-building-systems / revitpythonshell

An IronPython scripting environment for Autodesk Revit and Vasari
MIT License
502 stars 116 forks source link

creating installer .addin #55

Closed two9seven closed 7 years ago

two9seven commented 7 years ago

I am not able to get my addin to show up on my ribbon panel. I've followed the instructions on the wiki but I'm not having luck. I was able to run the initial deploy script and created the .dll. I think I may have the FullClassName incorrect. The dll is named HelloWorld.dll. Here is my .addin:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<RevitAddIns>
<AddIn Type="Command">
    <Name>HelloWorld</Name>
    <FullClassName>HelloWorld</FullClassName>
    <Text>HelloWorld</Text>
    <Description>Show Hello World</Description>
    <VisibilityMode>AlwaysVisible</VisibilityMode>
    <Assembly>C:\Users\dbwilson\AppData\Roaming\Autodesk\Revit\Addins\2016\Output_HelloWorld\HelloWorld.dll</Assembly>
    <AddInId>239BD853-36E4-461f-9171-C5ACEDA4E723</AddInId>
    <VendorId>VendorME</VendorId>
    <VendorDescription>vendorME</VendorDescription>
  </AddIn>
</RevitAddIns>
daren-thomas commented 7 years ago

Are you getting any error messages? What is the full name of the class? What namespace is it in?

two9seven commented 7 years ago

I figured out the problem on my own. I'll post the error anyway to help anyone else who is looking for it. I used the Revit Add In Manager to load the HelloWorld.dll and identified the class within. Is there a default naming convention when the deploy RPS Addin tool creates the addin? My class ended up being called ec_hellowold.

Original Error: The command shows up in the "External Tools" dropdown. When I click it this error comes up: Revit cannot run the external command "HelloWorld". Contact the provider for assistance Autodesk.Revit.Exceptions.InvalidOperationException. HelloWorld does not inherit IEExternalCommand.

daren-thomas commented 7 years ago

is this on github? can we check your source code?

daren-thomas commented 7 years ago

Also, can you use dotPeek (or similar tool) to check the HelloWorld.dll? I'm under the impression the class should be called HelloWorld.

Oh... waitaminute... You didn't deploy your script with the Deploy RpsAddin function did you? How did you create HelloWorld.dll?

two9seven commented 7 years ago

I created a new repo for you to look at. Thanks for your help. I did use the RpsAddin fuction by the way. https://github.com/two9seven/helloworld

daren-thomas commented 7 years ago

Oops. My Revit License just ran out - and I don't have time to get it renewed. But I did spot something: Your .addin file lists the type as "Command". Use "Application" instead and the FullClassName really should be "HelloWorld".

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<RevitAddIns>
<AddIn Type="Application">
    <Name>HelloWorld</Name>
    <FullClassName>HelloWorld</FullClassName>
    <Text>HelloWorld</Text>
    <Description>Show Hello World</Description>
    <VisibilityMode>AlwaysVisible</VisibilityMode>
    <Assembly>C:\Users\dbwilson\AppData\Roaming\Autodesk\Revit\Addins\2016\Output_HelloWorld\HelloWorld.dll</Assembly>
    <AddInId>239BD853-36E4-461f-9171-C5ACEDA4E723</AddInId>
    <VendorId>VendorME</VendorId>
    <VendorDescription>vendorME</VendorDescription>
  </AddIn>
</RevitAddIns>
two9seven commented 7 years ago

OK works! I fixed the class name to "HelloWorld" and changed the Addin Type to "Application"

Thanks!