Hello everyone,
I've been asked to create an addin that checks all elements within a model for a correct value in their 'level' property.
for example:
An lighting element is set to Level = 1st Floor, with an offset to 8000. It's location is actually on the 2nd floor.
In this case, the addin will change the level to 2nd floor, and compensate the offset to make sure the element stays in the same place.
It sounds easy enough, but my lack of Revit Knowledge is getting in the way.
I've encountered a few minor problems here, on which I'd like some advice.
1: Collect all the elements that actually have this 'Level' property.
Option 1: I can collect the elements based on several built-in Categories, but this seems like error-sensitive to me. (What if I overlook a category, or they are changed in the newer Revit versions etc.) It also returns more than I need and will require additional filtering. (Which is fine when needed, but prefer preventing it).
Option 2:
Well, I'm not sure how to configure my FilteredElementCollector other than option one, even though I'm pretty sure there must be a better way. I'm thinking collecting all FamilyInstances will not be enough.
2: Determining the location of the element.
So far i've checked for:
element.Location as Point, & element.Location as Curve. As well as checking for -GetPath(), and -GetEndpoint();
I use the Z value as the vertical location for the element.
I am very unsure of whether this the correct way of retrieving element locations.
Googling about this left me more confused then I was before.
When to use Location property? When to use bounding box? When to use yet another different approach?
I am in need of some guidance. Like I mentioned before, I am noticing a lack of understanding Revit's internal structures.
I believe that once these two bumps are cleared, I'm good to go.
Any help would be much appreciated.
Also, I found this Dynamo script, which actually helped me to get where I am now:
https://www.youtube.com/watch?v=GoPgGq4EXZQ&feature=youtu.be
https://bimstallatie.sites.google.com/site/bimstallatie/dynamo/referentie-levels-aanpassen/Levels%20...
Solved! Go to Solution.