Hi
I want to get the list of all my phases but I don't know how to..
I've tried to do what they explain here : http://revitapisearch.com/
But it doesn't work..
That's my code :
And that's the error message in Revit when I run my app:
Any ideas plz?
Thank!!
Solved! Go to Solution.
Solved by peterjegan. Go to Solution.
Solved by peterjegan. Go to Solution.
Your app is running the "NotImplementedException" and ignoring your "void Getinfo_Phase"
Try:
public class Class1 : IExternalCommand { public Autodesk.Revit.UI.Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { Document doc = commandData.Application.ActiveUIDocument.Document; PhaseArray....... ...your code.... .Show("Revit", prompt);
And get rid of the "NotImplementedException" block.
It doesn't work..
using System; using Autodesk.Revit.UI; using Autodesk.Revit.DB; using Autodesk.Revit.Attributes; namespace CreerVuesPourLePhasage { [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] public class Class1 : IExternalCommand { public Autodesk.Revit.UI.Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { Document doc = commandData.Application.ActiveUIDocument.Document; PhaseArray phase = doc.Phases; { String list = null; if (0 != phase.Size) { list = "Phases are"; foreach (Phase ii in phase) { list += "\n\t" + ii.Name; } } else { list = "No phases available"; } TaskDialog.Show("Revit", list); } } } }
It doesn't work because of the Execute()
and the error returns by visual studio is something like that (sorry for the translation I have visual studio in french..) :
'CreerVuesPourLePhasage.Class1.Execute(Autodesk.Revit.UI.ExternalCommandData, ref string, Autodesk.Revit.DB.ElementSet)' : all code paths don't return a value necessarily