CLI notification

hi,

we have recently acquired a PPI license and are working on Some Automation System using RC.

unfortunately, i can’t find any docs or tutorials on how to get reports of processing steps using CLI.

are there any ways we can achieve this?

regards

Hello,

you can find all Command Line commands in the help in RC under ‘‘All CLI Commands’’.

The command to export a report is -exportReport .

I’ll give you an example.

-exportReport C:\Users\overviewreport.html Reports\Overview.html

First parameter is a path where you want to save your report together with its name.
Secon parameter is a report template, which can be found in RC folder in your computer. Just make sure to choose the right template.

Regards.

thank you for your help

what i meant is notifying the CLI about the progress in a real-time manner.

e.g. getting notified as soon as the 3d reconstruction is complete.

It is possible to change Progress End Notification settings in RC. You can set up the RC to create a sound after finishing a process or to call an external program or piece of code (i.e. to write your process into an external text document). You can find more in In-App help in the section Application Settings / Progress End Notification and the setting can be found in Workflow tab / Application / Settings.

There is also a CLI command ‘‘writeProgress’’ which writes progress into an external document.

How to set Progress end notification

You don’t have to check the progress bar every time, to know that the computation is done. You can tell RC to notify you by playing a sound or writing the process result into a file. You can define it in the Application settings, section “Progress end notification”.

 

A very simple example is to write executed file ‘my_file.bat’ like this:

echo Process %1 has finished with result code %2 in %3 seconds. > %4

And then in the “Command-line process” call the ‘my_file.bat’ file with parameters:

C:\Users\zuduri\Desktop\my_file.bat $(processId) $(processResult) $(processDuration:d) C:\Users\zuduri\Desktop\my_results.txt

Note : Use your own paths for the files.

 

Results will be written into the file ‘my_results.txt’. If the process finishes correctly, processResult will be 0. You can also adjust executed file to write result only for the processes finished with an error.

You can find more info in the Help, section “Application settings”.

E-mail notification

Simple example: How to send an email from Gmail after process is finished either with „success“ or „error“.

 

Create file ‚my_file.bat‘ like this (in the first line enter the path to your files):

cd C:\Users\user\Desktop\

if /i “%1”  NEQ “0” (

PowerShell.exe -ExecutionPolicy Bypass -file “.\email.ps1” -argument “ERROR”

) else (

PowerShell.exe -ExecutionPolicy Bypass -file “.\email.ps1” -argument “SUCCESS”

)

 

Create file ‚email.ps1‘ like this (change your credentials):

param($argument=“none”)

$EmailFrom = “emailFrom@gmail.com

$EmailTo = “emailTo@gmail.com

$Subject = “RealityCapture process”

$Body = (“Computation finished with result:”,$argument)

$SMTPServer = “smtp.gmail.com

$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)

$SMTPClient.EnableSsl = $true

$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“username”, “password”);

$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

 

In the Application settings, section Progress end notification - Command line process call the ‘my_file.bat’ like this (change to your path):

 

C:\Users\user\Desktop\my_file.bat $(processResult)

 

NOTE: You might need to change your Gmail settings allowing less secure apps to access your account.

 

Alternatively, you can add more parameters to the message such as process ID or process duration. 

 

1 Like

This has been a part of the Friday tips on Capturing Reality Arena. It may not be too easy but could be a solution for you.

Hello 363763927319 and 365050875019 374823146340

I wanted to add to the original question that was asked here, I am also trying to build an automation system using RC, but a constant issues I am running into is that during processes that take a long time like “calculateHighModel” or “calculateTexture”, I have no way of knowing whats happening within the software. I see that command like “-writeProgress” outputs the realtime outputs to a file, but I was wondering if its possible to print them to stdout. I see that there “-stdConsole” but it doesnt print real time outputs from steps like “calculateHighModel” or “calculateTexture”.

I raised the issue which is linked below. I would really appreciate this feature as it would help me out immensely. I dont know if there another way of accomplishing this, would love to know if there is.

https://support.capturingreality.com/hc/en-us/community/posts/4533399720348-Mirror-writeProgress-output-in-the-standard-Windows-console

Thank you

Kiran

Hi Kiran, as I wrote you before, the feature request for it is created. Now it is on our developers, if they implement it. Thank you for understanding.