is there any way to load my doors and windows in revit project by revit api?

is there any way to load my doors and windows in revit project by revit api?

wahedfazeli
Enthusiast Enthusiast
455 Views
3 Replies
Message 1 of 4

is there any way to load my doors and windows in revit project by revit api?

wahedfazeli
Enthusiast
Enthusiast

is there any way to load my doors and windows and other element  in revit by revit api?

i have a lot of green door and windows and other elements and i dont know how to load all of them in my revit

0 Likes
456 Views
3 Replies
Replies (3)
Message 2 of 4

aignatovich
Advisor
Advisor

Hi!

 

Of course, you can 🙂

 

Use one of the overloads of Document.LoadFamily method:

 

loadfamily.PNG

 

Also take a look at http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

Message 3 of 4

wahedfazeli
Enthusiast
Enthusiast

can you give me a simple examle how to use that ? thank you

0 Likes
Message 4 of 4

aignatovich
Advisor
Advisor

Different methods are useful for different cases. The most simple may look something like this:

 

using(var transaction = new Transaction(doc, "load family"))
{
	transaction.Start();
	
	doc.LoadFamily("your family path");
	
	transaction.Commit();
}

Note: this code only loads family to the document and does not create family instances in project.

 

I also pretty sure, that you can find several examples in Revit developer center or developer guide.

 

Take a look at this link: http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

0 Likes