Did you ever get an answer to this or figure it out yourself?
I can't remember if
@Gary Lantaff ever created a sample TML with point clouds. If so, perhaps he can post some updated code.
I heartily agree that sample code (that's updated and working) is a great resource for both new and experienced developers.
And yes, it would be nice if the dev team could communicate API changes - even after a release - rather than us figuring it out randomly when a TML breaks when you try to use it. This puts a lot of burden on TML developers to manually test all their TMLs whenever a release comes out.
------------------------------
Quan Mueller
Revenant Solutions - TML Development
------------------------------
Original Message:
Sent: 01-14-2021 20:04
From: Ronny Schneider
Subject: V5.40 changed the way to access points from pointclouds - any idea how that works now?
Unfortunately part of an old macro stopped working with the upgrade to V5.40.
Before, the selected part of a point cloud was a "PointCloudRegion"-object and it had a function "CollectSelectedPoints"
Now, in V5.40, it's an "ExposedPointCloudRegion"-object, and that has pretty much no functions at all. How can I get the selected points into a Point3DArray now?
It's a bit annoying if they change those things. It took me hours to find the previous code and now I have to spend time again, sifting through the object browser.
Especially for newbies it would be highly appreciated if Trimble would compile/provide code snippets for some main task. Working with layers, adding, deleting objects, computing with polysegs, computing/adding/removing from surfaces, accessing point cloud data etc. etc.. I have no idea what i.e. those Interface Snapins are. After all, the macro language is advertised as being part of TBC, but it's rather crappy documented and lacking example code.
working code, prior to V5.40:
self.pointcloudType = clr.GetClrType(PointCloudRegion)
pointlist=Point3DArray()
pointcloudlist = List[PointCloudRegion]([])
selectedcloudpoints=List[Point3D]([])
for o in self.objs.SelectedMembers(self.currentProject):
if isinstance(o, self.pointcloudType):
pointcloudlist.Add(o)
if pointcloudlist.Count>0:
PointCloudRegion.CollectSelectedPoints(pointcloudlist, selectedcloudpoints, None)
if selectedcloudpoints.Count>0:
for i in range(0,selectedcloudpoints.Count):
pointlist.Add(selectedcloudpoints[i])
------------------------------
Ronny Schneider
------------------------------