sketchucation logo sketchucation
    • Login
    1. Home
    2. keithswd
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    K
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 18
    • Groups 1

    keithswd

    @keithswd

    20
    Reputation
    1
    Profile views
    18
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    keithswd Unfollow Follow
    registered-users

    Latest posts made by keithswd

    • RE: [Plugin] Scale and Rotate Multiple (UPDATED Dec 22, 09)

      Hello

      I use this plugin all the time, but now with SU 2022 it seems to be causing SU to crash on startup. It was the only non-2022 compatible plugin I had, and removing it from the plugins folder has stopped the crashing.

      I see it is only marked compatible up to v2018, is it not being developed any more? Does anyone know of a good alternative if so?

      thanks

      posted in Plugins
      K
      keithswd
    • RE: [Plugin] Compo Spray 1.4.2 Updated

      Hi

      I am trying to use this tool to place 2D faceme components (plants) onto the ground. I keep getting a message stating

      "1000 trials to drop components done. Continue?"

      Whatever I press now, I get into an unbreakable loop where the either (if I press yes) the time to complete keeps going up exponentially and another message pops up or (if I press no) I get the spinning colour wheel. Either way I have to force exit sketchup.

      I haven't used the tool for a while, but don't remember this problem before.

      I have SU2016 on OS X.

      thanks

      posted in Plugins
      K
      keithswd
    • RE: [Plugin] Compo Spray 1.4.2 Updated

      Many thanks Oxer (and MTriple) this version is working for me too!

      Glad to have this very useful tool back in operation.

      posted in Plugins
      K
      keithswd
    • RE: [Plugin] Compo Spray 1.4.2 Updated

      Thanks Oxer. I have just tried putting the file & folder as you suggest but still get the error. I have double checked that there is no longer a copy in either user Application Support../Sketchup subfolders, or in the system support folder, but up pops the error when I start up.
      The error has changed to the updated path for the script, so maybe something else is wrong:

      Error: #<SyntaxError: /applications/sketchup 2014/sketchup.app/contents/resources/content/tools/compospray/compoutils.rbs:511: Invalid break
      /applications/sketchup 2014/sketchup.app/contents/resources/content/tools/compospray/compoutils.rbs:520: Invalid break>
      /applications/sketchup 2014/sketchup.app/contents/resources/content/tools/compospray/compoutils.rbs
      Error Loading File compoSprayToolbar.rb
      Error: #<NoMethodError: undefined method compSpray_env' for main:Object> /Applications/SketchUp 2014/SketchUp.app/Contents/Resources/Content/Tools/compoSprayToolbar.rb:7:in <top (required)>'

      posted in Plugins
      K
      keithswd
    • RE: [Plugin] Compo Spray 1.4.2 Updated

      Does anyone know how to get this plugin working on a Mac install of SU2014? I get this error after installation:

      @unknownuser said:

      Error: #<SyntaxError: /users/keithpocock/library/application support/sketchup 2014/sketchup/plugins/compospray/compoutils.rbs:511: Invalid break
      /users/keithpocock/library/application support/sketchup 2014/sketchup/plugins/compospray/compoutils.rbs:520: Invalid break>
      /users/keithpocock/library/application support/sketchup 2014/sketchup/plugins/compospray/compoutils.rbs
      Error Loading File compoSprayToolbar.rb
      Error: #<NoMethodError: undefined method compSpray_env' for main:Object> /Users/keithpocock/Library/Application Support/SketchUp 2014/SketchUp/Plugins/compoSprayToolbar.rb:7:in <top (required)>'

      posted in Plugins
      K
      keithswd
    • RE: New to Ruby - I want to write a script to...

      Hi John,
      The ear sounds painful! I hope you are recuperating well.
      Thanks for the workflow. I have got it to work, with SU loading a script automatically (which defines a function to set the current model behavior as I want it) and I call that function in console. It runs slowly compared to the all-Ruby solution - but at least it processes without crash. So I can send lots of files and leave it to run over lunch, or night!
      Many thanks again,
      Keith

      posted in Developers' Forum
      K
      keithswd
    • RE: New to Ruby - I want to write a script to...

      Thanks again for your help and suggested code. As it stands it does not modify any components. I discovered this is because it seems that even when the component file is loaded successfully, compDefinition.internal? returns false. I can only imagine that this is actually testing whether the component was created within the model or loaded from a file - in which case we are getting the expected result. I commented it out and it runs but... sadly it still bombs out at around 33 components.

      I really don't want to take up any more of anyone's time - this was just a little project for me to play with but it seems rather trickier than I could have forseen. But I thought you might like an update!

      def setcompfm
      
      model = Sketchup.active_model
      # set folder and get array of filenames
      folder = UI.openpanel("Choose a skp file to set folder","*.skp")
      
      return unless folder && folder = File.dirname(folder)
      
      skpFiles = Dir[File.join(folder, "*.skp")]
      
      length = skpFiles.length
      
      result = UI.messagebox "Process " + length.to_s + " files?", MB_YESNO
      
      return unless result == 6 # Yes
      
      # Returns a DefinitionList
      definitions = model.definitions
      
      # iterate through files
      i = 0
        puts()
        #
        skpFiles.each { |compFile|
          ###
          model.start_operation( "Update '#{File.basename(compFile)}'", true )
          ###
          compDefinition = definitions.load compFile
          begin
            #if compDefinition.internal?
              behavior = compDefinition.behavior
              behavior.always_face_camera = true
              behavior.shadows_face_sun = true
              compDefinition.save_as compFile
            #else
            #  putc(46) # period char
            #  redo
            #end
          rescue => e
            ###
            model.abort_operation()
            ###
            puts()
            puts "ERROR saving component file;"
            puts "  #{compFile}\n"
            puts e.message
            puts e.backtrace if $VERBOSE
            puts()
          else
            i += 1
            if i >= 10
              definitions.purge_unused
              i = 0
            end
            ###
            model.commit_operation()
            ###
          end
          # each skp file
        }
        definitions.purge_unused if definitions.length > 0
      
      
      end #end def
      
      posted in Developers' Forum
      K
      keithswd
    • RE: New to Ruby - I want to write a script to...

      Thanks for the correction - I see my mistake now. However, the corrected syntax doesn't fix the crash. The folder selection works as it did before and populates the array with all the .skp files in the folder (about 200 for testing purposes), and my message box pops up and correctly reports the number to be processed.

      However it stops on the 33rd or 34th file no matter what that file is. Each time I run the script, I move the 33/34 successfully modified files out of the folder, so I am never processing the same files twice. I don't know what might be special about the 33/34 mark, but it bails at that point.

      Some kind of limit appears to be reached? Memory? I've no clue!

      posted in Developers' Forum
      K
      keithswd
    • RE: New to Ruby - I want to write a script to...

      Thanks Dan for the pointer to UI.openpanel, that all works fine.

      Not sure if it is because I need to learn about chunking my array, but my routine stops every time after processing 33 or 34 files (it is always after 33 or 34 files) and then SU8 crashes. Given that such a small number of files are processed before the hang/crash, I am not sure the array size is the problem? When the script stops running, I am left with the last loaded component in the component list. If I try and and check its 'Face-Me' status, SU crashes.

      def setcompfm
      
      model = Sketchup.active_model
      # set folder and get array of filenames
      folder = UI.openpanel("Choose a skp file to set folder","*.skp")
      
      if folder && folder = File.dirname(folder)
      	skpFiles = Dir[File.join(folder, "*.skp")]
      end
      
      length = skpFiles.length
      
      result = UI.messagebox "Process " + length.to_s + " files?", MB_YESNO
      
      if result == 6 # Yes
      
      # Returns a DefinitionList
      definitions = model.definitions
      
      # iterate through files
      begin
      
      	skpFiles.each do |compFile|
      
      		compDefinition = definitions.load compFile
      		behavior = compDefinition.behavior
      		behavior.always_face_camera = true
      		behavior.shadows_face_sun = true
      		compDefinition.save_as compFile
      		definitions.purge_unused
      
      	end #end do
      
      rescue
      	puts compFile
      
      end #end begin
      
      end #end if
      
      end #end def
      
      posted in Developers' Forum
      K
      keithswd
    • RE: New to Ruby - I want to write a script to...

      Ah - I was wondering what might happen if I loaded a really huge folder - actually I have a couple of thousand file to process. Not all at once though... I will check out that link when I have more time, at first glance looks a bit scary for a novice!

      Yes, I really am in London UK (live in W14, work SE11)!

      posted in Developers' Forum
      K
      keithswd