Hello,
Here is a script to invert the selected shapes.
++
David
'invert selection - dh42 2013
sub main
dim ent as Entity
dim ID as integer
dim rep as boolean = false
CamBamConfig.Defaults.ReloadTreeAfterScript = false
' store data for actual selection
dim oldselection as ArrayList = new ArrayList()
for each ent in view.SelectedEntities
oldselection.Add(ent)
next ent
'select all
view.SelectAllVisibleGeometry()
dim invertselect as ArrayList = new ArrayList()
'scan all the objects
for each ent in view.SelectedEntities
rep = scanID(ent.ID, oldselection) ' test if ID exist in old selection
if rep = false then 'not found
invertselect.Add(ent) ' add the object to the new list
end if
next ent
view.Select(invertselect)
end sub
'--------------------------------------------------------------------
function scanID( ID as integer, oldsel as ArrayList ) as boolean
'scan the old selection, if ID match, return true, else false
dim ent as Entity
for each ent in oldsel
if ID = ent.ID then 'match found
return true
exit function
end if
next ent
return false 'no match found
end function