Hi Nayef,
retrieving the 3D information from the selected points works as follows. You might have to adjust the indentations, this is just copied and pasted from different locations but should work.
The selected points seem to form a sub-cloud of each selected point cloud region. That's why we need to loop through the selected regions and then get the selected points from each. There might be a better solution, but Trimble still hasn't bothered to provide anything that resembles a documentation. It was a lot of trial and error to get to the below.
from Trimble.Vce.Data.Scanning import PointCloudRegion
# GlobalSelection moved to Trimble.Vce.Core in TBC 5.90
try:
from Trimble.Vce.Core import GlobalSelection
except:
from Trimble.Vce.UI.Controls import GlobalSelection
self.pointcloudType = clr.GetClrType(PointCloudRegion) # you'll need to import this assembly at the start of the macro as shown above
selectionSet = GlobalSelection.Items(self.currentProject)
# retrieving the selected points from the cloud
for o in selectionSet:
if isinstance(o, self.pointcloudType):
# a long version to make the process more obvious
integration = o.Integration # = SdePointCloudRegionIntegration
selectedid = integration.GetSelectedCloudId() # it seems the selected points form a sub-cloud
regiondb = integration.PointCloudDatabase # PointCloudDatabase
sdedb = regiondb.Integration # SdePointCloudDatabaseIntegration
cps = sdedb.GetPoints(selectedid)
# you can shorten the above to
cps = o.Integration.PointCloudDatabase.Integration.GetPoints(o.Integration.GetSelectedCloudId())
# now you can loop through those points and do what you want with them, i.e. draft them to worldview
for p in cps:
cadPoint = wv.Add(clr.GetClrType(CadPoint))
cadPoint.Point0 = p