Revit "My First Plugin" lesson 1 error message

Revit "My First Plugin" lesson 1 error message

kohogg1782
Contributor Contributor
818 Views
4 Replies
Message 1 of 5

Revit "My First Plugin" lesson 1 error message

kohogg1782
Contributor
Contributor

I've just done lesson 1 of the "my First Plugin" tutroials and i get the attached error message.

As far as i can tell i haven't made any errors in the code and manifest file, but any advice would be really great!

 

code:

 

 

using System;
using System.Collections.Generic;
using System.Linq;

using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;

namespace Lab1PlaceGroup
{
[TransactionAttribute(TransactionMode.Manual)]
[RegenerationAttribute(RegenerationOption.Manual)]
public class Lab1PlaceGroup : Autodesk.Revit.UI.IExternalCommand
{
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)

{
// Get application and document objects
UIApplication uiApp = commandData.Application;
Document doc = uiApp.ActiveUIDocument.Document;

// Define a reference object to accept the pick result
Reference pickedRef = null;

// Pick a group
Selection sel = uiApp.ActiveUIDocument.Selection;
pickedRef = sel.PickObject(ObjectType.Element, "Please select a group");
Element elem = doc.GetElement(pickedRef);
Group group = elem as Group;

// Pick a point
XYZ point = sel.PickPoint("Please pick a point to place a group");

// Place the group
Transaction trans = new Transaction(doc);
trans.Start("Lab");
doc.Create.PlaceGroup(point, group.GroupType);
trans.Commit();

return Autodesk.Revit.UI.Result.Succeeded;

}
}
}

 

manifest file:

 

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<RevitAddIns>
<AddIn Type="Command">
<Assembly>
L:\k.hogg\VB\Lab1PlaceGroup\Lab1PlaceGroup\bin\Debug\Lab1PlaceGroup.dll
</Assembly>
<ClientId>502fe383-2648-4e98-adf8-5e6047f9dc34</ClientId>
<FullClassName>Lab1PlaceGroup</FullClassName>
<Text>Lab1PlaceGroup</Text>
<VendorId>ADSK</VendorId>
<VisibilityMode>AlwaysVisible</VisibilityMode>
</AddIn>
</RevitAddIns>

0 Likes
819 Views
4 Replies
Replies (4)
Message 2 of 5

BobbyC.Jones
Advocate
Advocate
I've never done the plugin lessons, so this is a guess, but the FullClassName node in the manifest requires a fully qualified class name, i.e. it needs the namespace and class name. Try <FullClassName>Lab1PlaceGroup.Lab1PlaceGroup</FullClassName>
--
Bobby C. Jones
0 Likes
Message 3 of 5

kohogg1782
Contributor
Contributor

thanks, this doesn't seem to make any difference. I still get the same error message??

0 Likes
Message 4 of 5

stever66
Advisor
Advisor

Are you sure your path to the .dll file name is correct? 

 

L:\k.hogg\VB\Lab1PlaceGroup\Lab1PlaceGroup\bin\Deb​ug\Lab1PlaceGroup.dll

 

One thing that makes this a little easier is to place the dll file in the same directory with the addin file and use a relative path like this;

 

<Assembly>.\Lab1PlaceGroup.dll</Assembly>

 

 

Also, check the time stamp on the .dll file, and make sure you are using your most recent build.  If you change to a release build, it will put it in a different folder.  Also, sometimes it doesn't update until you do a "rebuild".

 

0 Likes
Message 5 of 5

JimJia
Alumni
Alumni
Hi,
I believe your manifest file is not correct, because it's saying "Lab1PlaceGroup is not found"; as Bobby pointed out,you should specify full class name like this: <FullClassName>Lab1PlaceGroup.Lab1PlaceGroup</FullClassName>.

If you still get same issue, you can try to use addin manager tool to load your assembly, or use the addin manager tool to retrieve the manifest.

Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes