I'm working on a project that tries to run ADA code check in the restroom in the Revit model. I try to create my own plumbing fixtures with the code required clearance and get the location from the model's fixtures and please my model at the same location to check if there is any clash. I'm not sure if this is the right method and i'm getting trouble to filter the fixtures. could you guys give me some suggestions?
Thanks
I'm working on a project that tries to run ADA code check in the restroom in the Revit model. I try to create my own plumbing fixtures with the code required clearance and get the location from the model's fixtures and please my model at the same location to check if there is any clash. I'm not sure if this is the right method and i'm getting trouble to filter the fixtures. could you guys give me some suggestions?
Thanks
Hi @Anonymous ,
First of all, did you place the plumbing fixtures via UI or through API?
If it is through UI then you can get the location of plumbing fixtures using the below code
FilteredElementCollector plumbingFixtures = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PlumbingFixtures).WhereElementIsNotElementType(); foreach(Element e in plumbingFixtures) { LocationPoint lp = e.Location as LocationPoint; string location = lp.ToString(); }
If you are trying to place the plumbing fixtures via API then
1)start the transaction
2)place the plumbing fixtures
3)commit the transaction
4)filter for plumbing fixtures
5)get the location of plumbing fixtures.
I hope this helps.
Hi @Anonymous ,
First of all, did you place the plumbing fixtures via UI or through API?
If it is through UI then you can get the location of plumbing fixtures using the below code
FilteredElementCollector plumbingFixtures = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PlumbingFixtures).WhereElementIsNotElementType(); foreach(Element e in plumbingFixtures) { LocationPoint lp = e.Location as LocationPoint; string location = lp.ToString(); }
If you are trying to place the plumbing fixtures via API then
1)start the transaction
2)place the plumbing fixtures
3)commit the transaction
4)filter for plumbing fixtures
5)get the location of plumbing fixtures.
I hope this helps.
Naveen's method will get you all plumbing fixtures, including sinks, urinals, shower heads, ect. You'll need an additional filtering method for getting only the toilets. I used this for getting plumbing fixture counts to do exhaust calculations (in python, sorry-still in dynamo, I haven't migrated to addins yet.
ToiletNamesList = ["Urinal", "Toilet", "WC", "Water Closet", "Wall Hung", "Wall Mounted", "Floor Mounted", "Floor Hung", "Tank", "Tankless"]
for ii, FamilyInstanceName in enumerate(FamilyInstanceNameInputList): for jj, ToiletName in enumerate(ToiletNamesList): if ToiletName.upper() in PlumbingFixtureFamilyStringToCheck.upper(): ContainsToiletIdentifyingString = True
Naveen's method will get you all plumbing fixtures, including sinks, urinals, shower heads, ect. You'll need an additional filtering method for getting only the toilets. I used this for getting plumbing fixture counts to do exhaust calculations (in python, sorry-still in dynamo, I haven't migrated to addins yet.
ToiletNamesList = ["Urinal", "Toilet", "WC", "Water Closet", "Wall Hung", "Wall Mounted", "Floor Mounted", "Floor Hung", "Tank", "Tankless"]
for ii, FamilyInstanceName in enumerate(FamilyInstanceNameInputList): for jj, ToiletName in enumerate(ToiletNamesList): if ToiletName.upper() in PlumbingFixtureFamilyStringToCheck.upper(): ContainsToiletIdentifyingString = True
ToiletNamesList = ["Urinal", "Toilet", "WC", "Water Closet", "Wall Hung", "Wall Mounted", "Floor Mounted", "Floor Hung", "Tank", "Tankless"]
How it will workout if user mention with different string and names will be different for each region.
ToiletNamesList = ["Urinal", "Toilet", "WC", "Water Closet", "Wall Hung", "Wall Mounted", "Floor Mounted", "Floor Hung", "Tank", "Tankless"]
How it will workout if user mention with different string and names will be different for each region.
Can't find what you're looking for? Ask the community or share your knowledge.