Revit "My First Plugin" lesson 1 error message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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>