Access point cloud points through API

Access point cloud points through API

george1985
Collaborator Collaborator
992 Views
3 Replies
Message 1 of 4

Access point cloud points through API

george1985
Collaborator
Collaborator

I imported a .rcs point cloud to Revit 2022 ("Insert" tab -> Point Cloud).
I would like to access its points and colors through Revit API.

I found such method:
Autodesk.Revit.DB.PointCloudInstance.GetPoints


Its third input is 'numPoints', representing the number of points which should be extracted from the point cloud.
However, this input can not be larger than 1 million.
And if I try to make it larger than 1 million, an error message is raised:

'It can be from 1 to 1000000.'

This means that for any point cloud we import to Revit, through Revit API - we can only access its first 1 million points, and those beyond are inaccessible.


Does anyone know any other Revit API method, to access all point cloud points?

Any help is appreciated.

0 Likes
Accepted solutions (1)
993 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

Good question. I asked the devteam for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

I think the statement regarding how many points you can access is incorrect.

 

Yes there is a limit but you can process the cloud in blocks by adjusting the filter limits and so access all the points not just the limit of one block.

 

A confusing aspect is the avergaeDistance:

 

"Desired average distance between "adjacent" cloud points (Revit units of length). The smaller the averageDistance the larger number of points will be returned up to the numPoints limit. Specifying this parameter makes actual number of points returned for a given filter independent of the density of coverage produced by the scanner."

 

What is the lowest number I can set this to, the limit of the scanner or smallest possible +ve double value? I think it should be an optional parameter whereby it just returns all the points for an area up to the max number of points limit. It says: "Specifying this parameter...", making it sound like it is optional but it doesn't tell me it can be null for example.

 

I would probably split the cloud up into blocks, test the number of points has not reached the limit for each. If it has reached the limit for a given block then subdivide that block up into more blocks.

 

Note:

"If there are more points in the cloud passing the filter than the number requested in this function, the results may not be consistent if the same call is made again."

 

So if the amount of points is less then the max number then I assume you have all the points for that block.

 

Additionally the PointCollection has the member GetpointBufferPointer, this could then provides a faster way to count the points in each block to establish if the block needs further subdividing.

Message 4 of 4

jeremy_tammik
Alumni
Alumni

I continue being amazed and astounded by your wealth of knowledge and all the work and energy you put into sharing it. Thank you very much indeed. Preserved here for easier searching, finding, and safekeeping:

  

https://thebuildingcoder.typepad.com/blog/2022/09/point-clouds-coloured-triangles-and-faces.html#4

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes