First Revit plugin

First Revit plugin

Anonymous
Not applicable
6,943 Views
12 Replies
Message 1 of 13

First Revit plugin

Anonymous
Not applicable
My HelloWorld addin tag does not appear in the external tool pull down menu when I start debug. The Visual studio created a folder HelloWorld for the project and there are two dll files. One is in HelloWorld/ HelloWorld /bin/debug/HelloWorld.dll and one is in HelloWorld/ HelloWorld /bin/debug/HelloWorld.dll. When I create manifest file, which one should I point to? Should I change the addin ID number or it is the same as in sample file?
0 Likes
Accepted solutions (1)
6,944 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable

You got the same path there 2 times, however

 

you should put your .dll file (from bin/debug)

 

into your revit addin folder "C:\ProgramData\Autodesk\Revit\Addins\2017"

 

and then let the .addin file (also in the addin folder) point towards that.

 

Be sure to change the id and that the main class and path is correct

0 Likes
Message 3 of 13

Anonymous
Not applicable

^^ concerning the id - the only important thing is that there are no two addins with the same id, so you probably don't need to change it

0 Likes
Message 4 of 13

jeremytammik
Autodesk
Autodesk

Dear Qianhui2010,

 

Thank you for your query.

 

I would very strongly recommend that you work through the step-by-step instructions in the Revit API getting started material first of all, especially the DevTV and My First Revit Plugin video tutorials:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

 

After that, if you wish to dive in deeper, work through the Revit API training labs:

 

https://github.com/ADN-DevTech/RevitTrainingMaterial

 

That will answer your question above and many, many others besides.

 

In fact, it provides all you need to know to get started, more effectively than any other way I can imagine.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 13

Anonymous
Not applicable
Thanks. Where can I find The AddinId? Is it in AssemblyInfo.cs?
0 Likes
Message 6 of 13

Anonymous
Not applicable
Thanks. For I am using Revit 2014 above. Where can I find VendorId in manifest file?
0 Likes
Message 7 of 13

Anonymous
Not applicable

No - in the "Hello Revit" Project Folder, there should be a File called "HelloRevit.addin"

 

You need to put these addin files into the Revit Addin folder -> the path I specified before.

 

In these Files you have XML code that should look like this:

 

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Assembly>HelloRevit.dll</Assembly>
<ClientId>7d4e1893-3a27-4df2-8075-4fa3754537aa</ClientId>
<FullClassName>Revit.SDK.Samples.HelloRevit.CS.Command</FullClassName>
<Text>Hello Revit (CS)</Text>
<Description>Shows how a basic ExternalCommand can be added to the Revit user interface.</Description>
<VisibilityMode>AlwaysVisible</VisibilityMode>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
</RevitAddIns>

 

The Assembly defines where your .dll file is (e.g you can define a folder structure etc.)

The ClientId (only one Addin with that allowed)

The FullClassName has to be the name of your main class (including namespace etc.)

Text & Description - some basic info and finally the VendorID - basically just the ID of the one who mad the addin

0 Likes
Message 8 of 13

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Qqianhui,

 

Thank you for your updates.

 

First, I will reply to your previous update that you sent me as a private message:

 

Question: I followed every step of Walkthrough-HelloWorld, but still, when start debugging, the add-in tag does not show at pull down menu of external tool of Revit. Attached are my project file and HelloWorld.addin file. The HelloWorld.addin file is saved at below path: image001.jpg.

 

Answer: Please always include a text version of all the text information you provide.

 

The path that you use for placing your add-in manifest is only accessible by opening and performing OCR or manual transcription of an image file.

 

You say that you are placing your add-in manifest in this folder:

 

C:\Program Files\Autodesk\Revit 2016\Addins

 

Where did you get that path from?

 

I hope it is not suggested anywhere in the getting started material.

 

If it is, that is an error. Please point out that spot so that we can correct it.

 

The possible paths to place your add-in manifest are listed both in the getting started tutorials that I pointed out to you and in the developer’s guide in the online Revit Help:

 

http://help.autodesk.com/view/RVT/2017/ENU

 

Developers > Revit API Developers Guide > Introduction > Getting Started > Add-In Integration > Add-in Registration

 

Manifest Files

 

Revit API applications are registered with Revit via a .addin manifest file. Manifest files are read automatically by Revit when they are placed in one of two locations on a user's system:

 

In a non-user-specific location in "application data":

 

  • C:\ProgramData\Autodesk\Revit\Addins\2017\

 

In a user-specific location in "application data":

 

  • C:\Users\<user>\AppData\Roaming\Autodesk\Revit\Addins\2017\

 

All files named .addin in these locations will be read and processed by Revit during startup.

 

I hope this helps.

 

Please follow the instructions in the getting started material to avoid any further problems like this.

 

Thank you!

 

Now to address your subsequent updates:

 

Question: Where can I find The AddinId?

 

Answer: The add-in id is a GUID that you create yourself. There are numerous ways to create a GUID, e.g. using the .NET Guid class or the GUID creation tool built into Visual Studio. Search the Internet how to define a new GUID and use that.

 

Question: Where can I find VendorId in manifest file?

 

Answer: You specify your vendor id in the add-in manifest within the VendorId tag.

 

You can choose your own vendor id. It should be a string that uniquely identifies you or your company.

 

The developer guide suggests using the reversed Internet domain name, e.g.,

 

  • com.typepad.thebuildingcoder

 

for a company whose Internet identity is something like

 

 

All of this information is provided in the Revit API developer guide and the getting started material.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 9 of 13

Anonymous
Not applicable
I put manifest file in the wrong location. Now it is working. Thanks all!
0 Likes
Message 10 of 13

Anonymous
Not applicable
Also, There is a file Assembly.cs within the C#project HelloWorld/Property, and in that files says:........// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d48038f8-ba7c-4894-818d-3f8bef5f802d")]........ My guess is that it is the AddinId, I put it in the code and it works. So I do not need to search the internet how to define a new GUID and use that(even I did so). Is it right? Thanks
0 Likes
Message 11 of 13

Anonymous
Not applicable
Thanks!
0 Likes
Message 12 of 13

Anonymous
Not applicable

Dear Jeremy,

 

I'm a beginner of Revit API and I finished "my first plug-in training" and your training labs, here I want to say thank you to you for your work helped me start the first step to learn Revit API.

 

I want some suggestions on what to do next, because I found  I'm now far from skilled using API and totally understanding each line of code in detail.

I think I need more training and learn to put API skills into practice. However I'm now a student with no working experience, so I have no idea about what

kind of plug-ins to do.

 

best regards

Yuan Ye

0 Likes
Message 13 of 13

jeremytammik
Autodesk
Autodesk

Dear Yuan Ye,

 

Have you completed the DevTV and My First Revit Plugin video tutorials?

 

Next, you can work through the ADN Revit API labs training material:

 

https://github.com/ADN-DevTech/RevitTrainingMaterial

 

It includes fully documented labs and exercises in both VB and C#.

 

Have fun and much success!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes