Deleting sharted parameters in manufacturer family cant delete error

Deleting sharted parameters in manufacturer family cant delete error

frankholidayjunior
Advocate Advocate
1,039 Views
3 Replies
Message 1 of 4

Deleting sharted parameters in manufacturer family cant delete error

frankholidayjunior
Advocate
Advocate

In the age of too much of everything I dearly like to score more hits then misses with my manufacturer family de-cluttering.  I am getting every second family from the same US imperial WALDO 2012 kitchen families and updating to 2019 returning an elementid cannott be deleted. So I am getting the shared parameters within the family like thus...

ElementsToDelete.Add(_doc.FamilyManager.get_Parameter(strDefName).Id);

 

then deleting using the standard...

 

foreach (ElementId id in ElementsToDelete)
{
try
{
using (Transaction trans = new Transaction(_doc, "Delete Manufacturer's Bloat"))
{
trans.Start();
_doc.Delete(id);

 

is there a way of checking if the id can be deleted?

Also it seems that none of the shared aprameters can be deleted in one of the waldo families and then all can be in the next and they are all 2012 families resurrected from their american crypts. (using heaps of dimensions not to reference planes). 

0 Likes
Accepted solutions (2)
1,040 Views
3 Replies
Replies (3)
Message 2 of 4

lukaskohout
Advocate
Advocate
Accepted solution

Why not use FamilyManager.RemoveParameter(FamilyParameter familyParameter)?


Hitting Accepted Answer is a Community Contribution from me as well as from you.
======================================================================
Message 3 of 4

frankholidayjunior
Advocate
Advocate
Accepted solution

hi,

I wasn't aware of the methods existence. Also these are shared parameters inside of the family document, though I a guessing this doesn't matter. I will let you know how i go.

0 Likes
Message 4 of 4

frankholidayjunior
Advocate
Advocate

hi, this worked perfect, a warning swallower for the poorly made manufacturer families with non reference plane associated dimensions is also a great idea. 

0 Likes