CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 20, 2018, 03:35:58 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: What is wrong with this script?  (Read 785 times)
timofthedeep
CNC Ewok
*
Offline Offline

Posts: 9


View Profile
« on: February 10, 2018, 17:00:52 pm »

I have not figured out this error.  Please help.  Thanks.

' New CamBam VBScript
' automatically delete all arcs

sub main
   dim rep as string
   dim a as arc
   CamBamConfig.Defaults.ReloadTreeAfterScript = false
   dim newselection as ArrayList = new ArrayList()
   if view.SelectedEntities.Length > 0 then
         for each ent as Entity in view.SelectedEntities
            if typeof ent is arc
                                entity.delete()
            end if
         next ent
         view.Select(newselection)
         view.RefreshView()
   end if
end sub
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5112



View Profile WWW
« Reply #1 on: February 10, 2018, 18:13:14 pm »

Hello,

Entity.Delete() do not exists Wink

Code:
sub main
   CamBamConfig.Defaults.ReloadTreeAfterScript = false
   dim newselection as ArrayList = new ArrayList()
   
   if view.SelectedEntities.Length > 0 then
         for each ent as Entity in view.SelectedEntities
            if typeof ent is arc
               newselection.add(ent)'add the arcs to a new selection
            end if
         next ent
         
         view.Select(newselection)'select all arcs that are in the new selection
         CamBamUI.MainUI.DeleteEntities(false)'delete all selected entities ; false = no warning popup
         view.RefreshView()
   end if
end sub
Logged
timofthedeep
CNC Ewok
*
Offline Offline

Posts: 9


View Profile
« Reply #2 on: February 10, 2018, 18:41:32 pm »

Works perfect thank you!!!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.091 seconds with 20 queries.

Copyright © 2018 HexRay Ltd. | Sitemap