My First Plug In - Revit 2015

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
Im new to the API area of Revit.
I have simply copied what was written in the lesson 1 steps however there are multiple errors coming up and simply isnt a successful build.
This is what is written in the Class 1
using System;
using System.Collections.Generic;
using System.Linq;
Element elem = pickedRef.Element;
Element elem = doc.GetElement(pickedRef);
using Autodesk.Revit.DB.Architecture;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
[TransactionAttribute(TransactionMode.Manual)]
[RegenerationAttribute(RegenerationOption.Manual)]
public class Lab1PlaceGroup : IExternalCommand
{
public 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 = pickedRef.Element;
Group group = elem as Group;
//Pick a point
XYZ point = sel.PickPoint("Please pick a point to place group");
//Place the group
Transaction trans = new Transaction(doc);
trans.Start("Lab");
doc.Create.PlaceGroup(point, group.GroupType);
trans.Commit();
return Result.Succeeded;
}
}
Then when I request to build this attached image pops up. What does it mean? How do I fix it?
Any help is really appreciated!
Thank you