Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to filter the toilet from the model and get its location?

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
529 Views, 3 Replies

How to filter the toilet from the model and get its location?

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

3 REPLIES 3
Message 2 of 4
naveen.kumar.t
in reply to: Anonymous

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 Kumar T
Developer Technical Services
Autodesk Developer Network

Message 3 of 4
Kevin.Lawson.PE
in reply to: Anonymous

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
-Kevin Lawson, PE
www.rippleengineeringsoftware.com
Revit heating and cooling load calculations in one click!
Message 4 of 4

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.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community