what is the FullClassName when using namespace and multiple extension classes

what is the FullClassName when using namespace and multiple extension classes

Anonymous
Not applicable
2,419 Views
5 Replies
Message 1 of 6

what is the FullClassName when using namespace and multiple extension classes

Anonymous
Not applicable

HI guys, 

 I have written a new addin for revit and I want to trial it out. The project is compiling into a dll file, however when I am loading up Revit I get this error: 

manifest_1.PNG

My addin is running under the name space 'DoorTag' from which I use to group all my external commands together. My main class is MoveDoorTags

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.IExternalCommand;
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;

namespace DoorTag
{
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class MoveDoorTags : IExternalCommand 
    {

From which I use to call other extension classes within the project.  

 

2.PNG

 

These extensions classes all mainly start the same. For example 'DoorArcExtensions'

 

using System;
using System.Collections.Generic;
using System.Linq;
using System;
using Autodesk.Revit.DB;

namespace DoorTag
{
    internal static class DoorArcExtensions 
    {

and FamilyInstanceExtensions

 

using System;
using System.Collections.Generic;
using System.Linq;
using System;
using Autodesk.Revit.DB;

namespace DoorTag
{
    internal static class FamilyInstanceExtensions 

And so on and so forth. My Manifest as it stands is:

 

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Command">    
    <Assembly>
      C:\Users\dobbs\Desktop\GITHUB_SHARING\PTW_Custom_addins\DoorTag\DoorTag\bin\Debug\DoorTag.dll
    </Assembly>
    <ClientId>03639cb0-a2de-4ca8-8022-97976f89387d</ClientId>
    <FullClassName>MoveDoorTags</FullClassName>
    <Text>Fix Door Tags</Text>
    <VendorId>PTW</VendorId>
    <VisibilityMode>AlwaysVisible</VisibilityMode>
    <LongDescription> Move all Door tags in the current opened project to their PTW approved position in a single click. 
    </LongDescription>
  </AddIn>
</RevitAddIns>

Does anyone know what I am doing wrong? 

 

0 Likes
Accepted solutions (1)
2,420 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk
Accepted solution

The full class name in the add-in manifest needs to represent the full class name, i.e., it has to include the namespace prefix.

 

 

Cheers, 

 

Jeremy



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

Message 3 of 6

Anonymous
Not applicable

Does that mean I need to have as my FullClassName:

 

'DoorTag.MoveDoorTag' or 'Revit.DoorTag.MoveDoorTag' or MoveDoorTag.DoorTag' ? I am new to Revit api (and c# for that matter) 

 

I have attached my project as a DoorTagsProject.zip file here including an 'App' file and icon resources for a button. Everything 'should' be working but it isn't. 

 

@BobbyC.Jones gave me some help with this a short time ago in another post: https://forums.autodesk.com/t5/revit-api-forum/place-a-door-tag-at-the-center-of-the-hosting-door-sw...

0 Likes
Message 4 of 6

Troy_Gates
Advocate
Advocate

A quick look at your solution and it appears that you should be using DoorTag.App for your FullClassName. You were trying to use the ExternalCommand instead of the ExternalApplication.

0 Likes
Message 5 of 6

Anonymous
Not applicable

Running into some errors so I'm not able to check to see if it works. Thank you for sharing. I have another question in the mean time, you wouldn't happen to know if I am structuring the project correctly or not? with all my classes inside the project and then correctly calling the methods? I wonder if that has something to do with my failures to load or actually using the program I have built. 

 

Kind regards

0 Likes
Message 6 of 6

BobbyC.Jones
Advocate
Advocate

 

Looking at your posted code, this looks like the correct full class name for your manifest file.

<FullClassName>DoorTag.MoveDoorTags</FullClassName>

 

The error message seems to indicate that it can't find that class in the dll file.  So my first thought would be to ensure that the dll file in the manifest is the correct file.  Are you sure this is the correct path of your current output?  Check the Build tab in the project properties dialog, it will show you the output path.  That path can change with different build configurations.  The manifest you posted specifies the debug folder, indicating it's looking for a file that was generated with the Debug config active, perhaps your most recent builds are using the Release build config, in which case the manifest should point to the dll in the release folder.

--
Bobby C. Jones
0 Likes