Revit Server Download and Hiding Point Cloud Scan

Today, I have two important results to share based on hard work by Tim Burnham and Pierre Navarra:

Download from Revit Server Requires RSN.INI Entry

I discussed copying a model from a Revit Server six years ago.

After all this time, an important caveat is required, prompted by Tim Burnham and all the blood, sweat and tears he spent on resolving an issue with an Application.CopyModel error for Revit Server:

Question: I wrote an application that interacts with Revit Server and downloads files for some RVT analytic processing. This always works well for me on my machine, but not for others. We are using a specific server A. When users of A run my application, they can ping and iterate through all the server contents using my REST code, no problem. However, when the app goes to download the file via Application.CopyModel, we are getting The central model is missing errors. My Win7 laptop is not receiving these errors and is able to download fine every time. Nobody else works.

I had several different people try this and reproduce the error at CopyModel time. Two are Win7, two are Win8. All get the error. As you can see here, there is nothing out of the ordinary with my sample:

  string serverFilePath = @"RSN://XX.XX.X.XXX/Project1.rvt";

  ifModelPathUtils.IsValidUserVisibleFullServerPath( 
    serverFilePath ) )
  {
    ModelPath tempMp = ModelPathUtils
      .ConvertUserVisiblePathToModelPath( serverFilePath );
    app.CopyModel( tempMp, @"C:\Temp\Project1.rvt"true );
  }

Why am I so lucky? If I log on to another machine using my credentials, it doesn’t work at download time for me either.

I’m using Revit 2017.

Answer: After much head banging and debugging, I discovered that if you use the Application.CopyModel .NET API for Revit Server downloads, the associated central server you wish to download from must be listed in the local workstation RSN.INI file:

This file may not even exist if the client hasn’t done any RS integration work.

Removing the central server IP from the .INI file will yield either network communication or can’t detach from central type errors.

I don’t believe this is documented for API use.

If your local Revit install is set up with the server already, I assume the API will always work and this hidden behaviour will go undetected.

I would expect the API should interact with RS assuming port 808 is open and you’re within the LAN/WAN confines.

It might be useful to amend the initial article on copying a model from a Revit Server to include this info.

Someone will thank you!

Above all, a big thank you to Tim for sharing this important information and all his hard work in detecting and resolving the issue!

Hiding a Point Cloud Scan RCS in an RCP Instance

Another thank you is due to Pierre Navarra of SONA Architecture for his solution for managing the point cloud visibility in a Revit 3D view discussed in the Revit API discussion forum thread on hiding scans in PointCloudInstance:

Question: PointCloudInstance can return the list of scans by using GetScans.

I'd like to make invisible a specific scan of a point cloud instance in my 3D view.

The Revit API documentation says, "PointCloudOverrideSettings - Used to get or set the visibility, color mode, and PointCloudColorSettings for a PointCloudInstance or one of its scans."

I can't find how to do it, though... Could you help me, please?

Manually, in the user interface, I can make invisible an rcs from an rcp instance:

RCS visibility in RCP instance

I can use GetScans to obtain the list of all rcs from my rcp instance.

With RevitLookup, however, I see no way to get the element ids of an individual rcs...

And the help says about scans, "An .rcp file can contain multiple scans. The method PointCloudInstance.GetScans() returns a list of scan names which can be used to set visibility and fixed color overrides independently for each scan in the PointCloudInstance. PointCloudInstance.ContainsScan() indicates whether the given scan name is contained in the point cloud instance while PointCloudInstance.GetScanOrigin() will return the origin of the given scan in model coordinates."

"PointCloudColorSettings - Used to assign specific colors for certain color modes to a PointCloudInstance element, or one of its scans. Does not apply if the PointCloudColorMode is NoOverride or Normals."

But how to access the rcs id ?

Answer: I'm done, and it works!

I wrote about it in managing the point cloud visibility in a Revit 3D view.

I use these API calls:

  PointCloudOverrideSettings
    ptc_overridesettings_invisible
      = new PointCloudOverrideSettings();

  ptc_overrides.SetPointCloudScanOverrideSettings(
    pti.Id, ptc_overridesettings_invisible,
    scanname, doc );

Thank you for sharing this, Pierre!