hey there,
I have a tool which deletes fill patterns in a family. Up till Revit 2014 it worked, but now in 2015 it doesn't anymore.
It looks like the standard Fill Patterns like Solid fill, Vertical, Diagonal up, Crosshatch ect. can't be deleted anymore??
With RevitLookup I concluded that all 'standard' fill patterns have an ElementId which consists of less digits then 'user fill patterns'.
So I've made the workaround like below, but this will only bypass them. Does anybody know how I can delete these standard fill patterns in a family ?
public static void RemoveFillPatterns(Document doc)
{
List<FillPatternElement> fillp = new FilteredElementCollector(doc).WherePasses(new ElementClassFilter(typeof(FillPatternElement))).OfType<FillPatternElement>().ToList();
foreach (FillPatternElement HatchPattern in fillp)
{
try
{
if (HatchPattern.Id.ToString().Length > 5) doc.Delete(HatchPattern.Id);
}
catch (Exception ex)
{
// apperently a standard fill pattern which can't be deleted in 2015
MessageBox.Show(ex.Message);
}
}
}
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Remy,
How important is this to you?
I can always pass this on to the development team as a wish list item.
On the other hand, they have more than enough to do anyway.
Can you explain why this is important to you?
Thank you!
Cheers,
Jeremy
Well, this function is part of our Revit application where a user can clean up it's families and project. In order to localize the content, dutch fill patterns will be imported and we don't have the need for the english fill patterns. Up till version 2014 it worked perfectly, but in 2015 this changed for some reason. How important is it.. Well, it's not a huge showstopper, so I guess it's not that important. But then again, since it did work up till 2014 the development team already has the technology, so I guess if a development team member looks at it during a coffee break, it should be a quick fix 🙂 🙂 🙂
Dear Remy,
Thank you for the explanation. That makes sense.
I logged the issue REVIT-48299 [API: deleting basic fill patterns works in 2014 but fails in 2015 -- 10019483] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software.
Please make a note of this number for future reference.
Thank you!
Cheers,
Jeremy
Dear Remy,
I have an update on this issue for you.
The development team explored the issue REVIT-48299 [API: deleting basic fill patterns works in 2014 but fails in 2015 -- 10019483] and reply:
We did indeed implement a change REVIT-44131 in Revit 2015 UR4 and Revit 2015 R2 that prevents the deletion of the Solid fill pattern only. Apparently, deleting this one is really bad, because Revit expects to be able to use it in certain situations and it cannot be reloaded once deleted.
It is unfortunate that this change ended up in an UR, because we did know that some add-ins actively attempted this deletion. It would of course have been much better to make this change only in a next major release when we could document the behavior and allow 3rd party developers to adjust to it.
That being said, I cannot reproduce the claim that *all* built-in fill patterns cannot be deleted. I upload a family and project both with embedded macros based on the users' code which try to delete the fill patterns one at a time. The only one prevented from being deleted (out of 6 in the family, and 48 in the project) is the solid fill pattern - all the rest are still deleted as expected.
I'm going to close this as "Works as Expected" since the only time the deletion seems to be prevented is indeed as we intended. Unfortunately the developers may need to issue an update to deal with this behavioral change.
I hope this clarifies.
Thank you for your understanding!
Cheers,
Jeremy
Dear Remy,
I am glad you see the same behaviour.
Thank you for the confirmation.
Cheers,
Jeremy
My add-In disallows deleting the Solid pattern since on my reading of the API docs I could not find any way to recreate it (short of copying it in from another project) once deleted. I had no idea that deleting the Solid pattern could lead to difficulties elsewhere.
Hugh Adamson
I noe have two fill patterns in my template and I only want the Solid Fill. Somewhere along the line we have ended up with the French version of solid fill. Can't rename, can't delete no way of getting rid of a redundant fill pattern unless I open a previous version.....Very frustrating.
*bump*
I've got the same problem. Actually I have 4 different solid fills in 4 languages.
They probably got imported with custom families online. But I can't delete them.
Is there maybe a way through Dynamo to delete them?
Dynamo useds the Revit API for all itss interactions with Revit.
If the Revit API does not enable this, Dynamo cannot do so either.
Cheers,
Jeremy
Hi guys,
I added a note on the new issues you reported to REVIT-48299 [API: deleting basic fill patterns works in 2014 but fails in 2015 -- 10019483] and asked the development team to take another look at it.
Let's hope for the best.
Thank you for your patience.
Cheers,
Jeremy
Good morning,
Please, tell me, I have a problem with deleting FillPatterns in Revit 2015. The deleting is not work.
Will It works in Revit 2016?
Thank you in advance.
Please read the explanations above.
There are issues with the deletion of solid fill patterns.
All others should work fine.
Cheers,
Jeremy
Thank you, I readed and I understand )
I delete all elements, but I can't delete SOLID FillPatternElement. Maybe that is normal?!
Can't find what you're looking for? Ask the community or share your knowledge.