In the office we have a fileWatcher that converts pointclouds to .laz files.
We just started working with Revit but came to the conclusion that it is not possible to import .laz in Revit.
So I googled and found a solution execept it is written in python and our watcher is in c#.
Below the python script.
<location>/decap.exe –importWithLicence E:\decap text\Building 1\ Building 1
Is there a way to convert this python script to c# or is there maybe another way.
Please let me know.

- 38
- 5
3 Answers
I implemented a Revit add-in in C# to import a LandXML surface to a TopographySurface
. The LAS
file format is just as simple and readable as LandXML, so that ought to give you what you need. I am interested in implementing such a thing for myself as well, in fact, so maybe if you can share a simple LAZ
sample file or two I can take a look at it as well. Thank you.
I see that decap.exe
is an Autodesk product, and has nothing to do with Python. What exactly are you trying to achieve? Just generate the topography surface, or something else besides that?

- 7,333
- 2
- 12
- 17
-
Hi Jeremy, what i am trying to achieve is a point cloud in Revit. Our office works with a lot of pointclouds and I have written a script which makes a Revit document for every point cloud in a specific folder. The only problem now is that we can't import `LAZ` into Revit. With the python script mentioned a `LAZ` file can be converted to `RCS`. And then it could be imported into Revit. To summarize I am trying to convert a `LAZ` file to `RCS` so I can import it into Revit. – Jens Slofstra Jan 06 '22 at 11:23
-
My question is: what is the *exact* result in Revit? What elements are generated, what properties do they have, what data is added? If it is one single `TopoSurface` element with no additional data, it is simple and I can understand. Everything beyond that I do not know. – Jeremy Tammik Jan 07 '22 at 08:41
My first answer asked what you are trying to achieve and addressed a possible alternative approach. To answer your question more directly, you can easily launch the decap.exe
command line and specify arguments to it directly in .NET and C#. Simply make use of the command line as explained elsewhere, e.g., to Run Command Prompt Commands.

- 7,333
- 2
- 12
- 17
Thanks for the reply Jeremy. After some more searching I came to the same conclusion. Below you will find the code that worked for me.
//Process Info
var cmdInfo = new ProcessStartInfo
{
RedirectStandardInput = true,
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
FileName = "cmd.exe",
};
//Process
var cmd = new Process();
cmd.StartInfo = cmdInfo;
cmd.Start();
var outStream = cmd.StandardOutput;
var inStream = cmd.StandardInput;
//Command Line for DeCap
inStream.WriteLine("cd C:\\Program Files\\Autodesk\\Autodesk Recap");
var run = true;
var cmdTask = Task.Run(() =>
{
while (run)
{
try
{
Console.WriteLine(outstream.ReadLine());
}
catch { }
Thread.Sleep(20);
if (outStream.ReadLine().Contains("[R]"))
{
_logger.LogInformation(@"File Converted: {0}\{1}", _LAZProcessed, LAZFile.Name);
run = false;
}
}
});
inStream.WriteLine("{0}decap.exe{0} --importWithLicense {0}{1} 0} {0}{2}{0} {0}{3}{0}", '"', _LAZProcessed, LAZFile.Name, LAZFile.FullName);
while (!cmdTask.IsCompleted)
Thread.Sleep(1000);

- 38
- 5