Get Parameter values for which Sheet can not deleted

Get Parameter values for which Sheet can not deleted

MehtaRajesh
Advocate Advocate
680 Views
2 Replies
Message 1 of 3

Get Parameter values for which Sheet can not deleted

MehtaRajesh
Advocate
Advocate
Hello,

I know only way to extract Parameter information as below. The code is working fine where Sheet is having no revisions, but if it is having revisions it is not working. If we try to delete sheet manually, it shows message "The Revision of this Revision Cloud has been issued.  Deletion of this Revision Cloud is prohibited." My code stuck at ids = doc.Delete(vw.Id);,

Is there any alternative way to extract parameters for the sheets which can not be deleted because of Revision present in the sheet?

OR Any process to delete Revisions temporary from the sheet?

I know how to retrieve Revision by using
IList<ElementId> myIlist = new List<ElementId>();
myIlist = ViewSheet.GetAllProjectRevisionIds();

But do not know how can I delete Revisions from the sheet temporary.

Thanks in advance for your kind help in this regards,
Regards,
Rajesh

 

 

 

 

 

Document doc = commandData.Application.ActiveUIDocument.Document;
ICollection<ElementId> ids = null;
using (Transaction trans = new Transaction(doc, "TempTransaction"))
 {
	 trans.Start();
         // Ensure that ViewSheet is not the active view 
         // before performing the delete task
         ids = doc.Delete(vw.Id);         trans.RollBack();
}

foreach (ElementId id in ids)
{
	Element elementType = doc.GetElement(id);
        if (elementType.GetType().ToString() == "Autodesk.Revit.DB.ViewSheet")
        {
        	// Check for Defination name in the Sheet
                var mydefinationList = new List<string>();
                foreach (Parameter p in elementType.Parameters)
                {
                	if (null != p)
                        {
                        	mydefinationList.Add(p.Definition.Name.ToUpper());
			}
		}
	}
}

 

0 Likes
681 Views
2 Replies
Replies (2)
Message 2 of 3

MehtaRajesh
Advocate
Advocate
Hello,
Please suggest alternate way to retrieve parameters which does not require sheet to be deleted and rollbacked.
OR suggest how can I delete revisions.
Thanks in Advance
Regards
Rajesh
0 Likes
Message 3 of 3

MehtaRajesh
Advocate
Advocate
Hello, Autodesk Revit API Experts,

(1) Please let me know whether it is possible by using Revit API to retrieve parameters without temporary deleting and rollbacking Sheet.
(2) Is it possible to delete revisions by using Revit API?

Thanks in advance

0 Likes