Deleting Shared Parameters

Deleting Shared Parameters

slyons1234
Observer Observer
3,956 Views
3 Replies
Message 1 of 4

Deleting Shared Parameters

slyons1234
Observer
Observer

I am trying to clean up our office project template. There are some previously made door parameters that I no longer need. I was able to delete some of the parameters through the "project parameters" tab. However, there are some shared parameters that I cannot delete. These are not parameters in the door family. I cannot find their original shared parameter txt file because they were created by other team members over the past years. How can I delete these shared instance parameters?

0 Likes
3,957 Views
3 Replies
Replies (3)
Message 2 of 4

JimJia
Alumni
Alumni

Dear Sarah,

 

Please accept our sincerer apology for the delay! We had a backlog in the queue these days.

I think this blog can give you some help if you can use API to your request.

http://thebuildingcoder.typepad.com/blog/2009/08/deleting-a-shared-parameter.html

 

If you want to delete the parameter in UI. Maybe you can post your question here: https://forums.autodesk.com/t5/revit-architecture-forum/bd-p/133

 

Thank for your understanding and cooperation.


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

Dale.Bartlett
Collaborator
Collaborator

I might be misreading the question, but it is worth noting that to the best of my knowledge, it is still impossible to truly purge Shared Parameters from a project (from a family, yes) database. The GUID remains, along with its link to its original name.

And whether this helps, you can export "orphaned" Shared Parameters into a new Shared Parameter file.

Dale




______________
Yes, I'm Satoshi.
Message 4 of 4

FAIR59
Advisor
Advisor

Since we have access to the SharedParameterElement's in a document, you can remove a shared parameter from the document, by deleting the SharedParameterElement that belongs to the shared parameter.

(for finding the SharedParameterElement see my reply https://forums.autodesk.com/t5/revit-api-forum/filter-with-shared-parameter-guid-id/m-p/7127726#M231...)

 

 

NOTE OF CAUTION:

 

You can do this at your own peril, since Revit will delete the parameter even if it's used in families and/or ParameterBindings with NO warning. If the parameter was used in a formula in the family, the formula is deleted, even further degrading the family.   

So verify yourself that the parameter is not being used in any way.

 

            Guid myGuid = new Guid("1941bdda-f6f3-4908-a1f2-25d0f968cb02");  // GUID of shared parameter
            SharedParameterElement sParamElement = SharedParameterElement.Lookup(document, myGuid);
            using (Transaction t = new Transaction(document, "remove sharedParameter"))
            {
                t.Start();
                document.Delete(sParamElement.Id);
                t.Commit();
            }