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: 

Create .rvt file from C#

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
1627 Views, 9 Replies

Create .rvt file from C#

Hello. 

I am a software developer and I am very new to Revit or Autocad. For a project, I need to create .rvt file from C# using the Revit API. I do not want to develop a plugin, I want to simply be able to draw objects and save them in a file .rvt extension so that the end user can just double click on this file and open it directly in Revit. 

I am unable to figure out a way to do this since the API documentation suggests its usage for building plugins. 

Please help me finding a solution how to create .rvt files. 

 

Thank you 

Tags (3)
Labels (1)
9 REPLIES 9
Message 2 of 10
joshua.lumley
in reply to: Anonymous

I think you need a 'macro'.  Start by copying a blank project. 

Message 3 of 10
Anonymous
in reply to: joshua.lumley

Hi. Thank you for your reply. Can you please share any blank projects for me to get started?

Message 4 of 10
joshua.lumley
in reply to: Anonymous

All you need to do is to create new, choose <none>, choose metric or imperial, save it where you need it. And there you go.

Message 5 of 10
Anonymous
in reply to: joshua.lumley

Hi, I do not want to create a plug in. I don't want to have to open Revit. I just want to write a rvt file from a C# program (without opening Revit, like writing a text file from a C# program) so that the .rvt file can be shared and may be opened elsewhere on the Revit software for later use. 

Message 6 of 10
joshua.lumley
in reply to: Anonymous

Attached are the files you wanted. 

Message 7 of 10
heba.eiz
in reply to: Anonymous

Have you found a way to create a new .rvt file from c#? I have been looking for the same thing but all in vein 

Tags (3)
Message 8 of 10
MiguelGT17
in reply to: heba.eiz

I'm new to forge but I've heard you can manipulate models without the need to open Revit. Perhaps you can create files too. Look into forge docs if helps with something.

 

pd: I was requested the same thing but never came to a conclusion.

 

Cheers

Message 9 of 10
jeremy_tammik
in reply to: Anonymous

Yes. There is no (official) way to programmatically create an RVT project file without making use of the Revit API, and the Revit API requires a running session of Revit.exe to obtain a valid Revit API context. Without such a valid Revit API context, the API cannot be used. It is completely event driven, and only Revit can launch the necessary events. So, for the desktop, this means you need to have a full Revit product installation and a running Revit session.

  

Miguel is perfectly correct (thank you! muchas gracias!) in suggesting the use of the APS Autodesk Platform Services (formerly Forge):

  

  

The APS Design Automation API for Revit enables you to create an RVT project file without installing Revit on your local machine. Instead, a Revit engine is launched in the cloud and executes your add-in code on a server, returning the resulting RVT file for you to download locally:

  

   

Jeremy Tammik, Developer Advocacy and Support, The Building Coder, Autodesk Developer Network, ADN Open
Message 10 of 10
heba.eiz
in reply to: Anonymous

Thank you very much @MiguelGT17 and @jeremy_tammik  for your replies! I will take a look at APS and see how it goes 👍

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community