How to get the file location of a PointCloud file

How to get the file location of a PointCloud file

btmsoftware
Advocate Advocate
3,601 Views
20 Replies
Message 1 of 21

How to get the file location of a PointCloud file

btmsoftware
Advocate
Advocate

In a revit drawing, I need to be able to find the full path of the point cloud files (all of them, rcp AND rcs

 

The following bit of code (VB.NET) allows me to get the cloud instances and the file names but NOt the file path:

 

 Public Function Execute(
      ByVal commandData As ExternalCommandData,
      ByRef message As String,
      ByVal elements As ElementSet) _
    As Result Implements IExternalCommand.Execute

        Dim uiapp As UIApplication = commandData.Application
        Dim uidoc As UIDocument = uiapp.ActiveUIDocument
        Dim doc As Document = uidoc.Document


        Using file As New StreamWriter("c:\temp\result.txt", False)
            Dim clouds As FilteredElementCollector = New FilteredElementCollector(doc).OfClass(GetType(PointCloudInstance))

            For Each cloud As PointCloudInstance In clouds
                file.WriteLine("Found instance: " & cloud.Id.IntegerValue)
                file.WriteLine(vbTab & "Name= " & cloud.Name) ' Seems to contain the filename of the rcp/rcs attached

                Dim files As IList(Of String) = cloud.GetScans()  ' if the point cloud is a rcp, then it contains the list of rcs, otherwise, it contains the rcs
                file.WriteLine(vbTab & "Files:")
                For Each filename As String In files
                    file.WriteLine(vbTab & vbTab & filename)
                Next

                file.WriteLine(vbCrLf & vbCrLf)
            Next

        End Using
        Process.Start("c:\temp\result.txt")
        Return Result.Succeeded

    End Function

 

The result is:

 

Found instance: 2304
	Name= pumpNoInvalidPoints.rcp
	Files:
		pumpNoInvalidPoints_1
		pumpNoInvalidPoints_2
		pumpNoInvalidPoints_3
		pumpNoInvalidPoints_4
		pumpNoInvalidPoints_5

Found instance: 2312
	Name= tester.rcs
	Files:
		tester
		

 

 

Any idea ?

0 Likes
Accepted solutions (3)
3,602 Views
20 Replies
Replies (20)
Message 21 of 21

btmsoftware
Advocate
Advocate

Thanks for the info. I'm stuck on another project right now so it will be a while before I can test that.

I'll let you know....

0 Likes