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

    Posts

    Recent Best Controversial
    • RE: ASP web interface

      coujld you explain in a bit more detail what your goal is. if what you are looking for is getting your models online we have done that exact thing.

      posted in Developers' Forum
      S
      simonstaton
    • RE: Hide Toolbars On Load

      I am actually quite suprised at how hard this is turning out to be I thought it would be a simple one line code hideing a toolbar

      posted in Developers' Forum
      S
      simonstaton
    • RE: Google Example Plugin Box.rb

      I also just found this page that might help. http://code.google.com/apis/sketchup/docs/ourdoc/material.html

      posted in Developers' Forum
      S
      simonstaton
    • Google Example Plugin Box.rb

      I am using googles box.rb example to generate a floor I have managed to set up the Width and Depth functions properly. however now I want it so they can select a material from a drop down list. either grass or concrete or bark. this is the current code I am using

         prompts = [$exStrings.GetString("Garden Width"), $exStrings.GetString("Garden Height")]
          values = [6.feet, 4.feet]
          results = inputbox prompts, values, $exStrings.GetString("Your Garden Size and Material")
          return if not results # This means that the user canceld the operation   
          width, depth = results    
          model = Sketchup.active_model
          model.start_operation $exStrings.GetString("Create Box")    
          entities = model.active_entities
          group = entities.add_group
          entities = group.entities    
          pts = []
          pts[0] = [0, 0, 0]
          pts[1] = [width, 0, 0]
          pts[2] = [width, depth, 0]
          pts[3] = [0, depth, 0]
          base = entities.add_face pts      
          model.commit_operation
      

      any ideas on how I can add a materials prompt that will fill this box with a material.

      posted in Developers' Forum
      S
      simonstaton
    • RE: Hide components panel on close

      @chris fullmer said:

      Yup, look at the AppObserver.

      http://code.google.com/apis/sketchup/docs/ourdoc/appobserver.html

      Chris

      I just had a look at that and it seems to be what I am looking for but when I put

       def onQuit()
         UI.messagebox("onQuit; ")
       end
      

      into my .rb file nothing seems to happen no messagebox appears

      posted in Developers' Forum
      S
      simonstaton
    • RE: Hide Toolbars On Load

      @adamb said:

      I'm with Jim on this. Sounds a like a disaster to allow plugins to impose their view on how the GUI should work.
      why do you not simply create your own toolbar for this?

      well tbh I am changing the look of the GUI. I am handing out a copy of sketchup to our clients and it is going to have all of our 3d models in the components panel however we dont want them to be able to edit the components which we know some of them will end up doing with things like the draw tool. so we have built our own toolbar that exports the model as a jpg and can also add it to a shopping cart.

      posted in Developers' Forum
      S
      simonstaton
    • RE: Hide Toolbars On Load

      I am in touch with abe from hypercosm and he seems to of done this with his viewer so maybe he can give me some insight

      posted in Developers' Forum
      S
      simonstaton
    • RE: Hide Toolbars On Load

      @martinrinehart said:

      Has anybody sorted out what works and what doesn't here?

      it seems like quite a few people are having this problemg

      posted in Developers' Forum
      S
      simonstaton
    • Hide components panel on close

      I am making a few posts atm but thats because im hurrying to meet a deadline 😄

      this problem is that I want my components panel to close when sketchup closes. is there an on event close function that I could use?

      posted in Developers' Forum
      S
      simonstaton
    • RE: Hide Toolbars On Load

      @jim said:

      The closest I've gotten to that is this:

      UI.toolbar_names.each{|n| UI.toolbar(n).hide}

      but it doesn't work.

      hmm I have posted on some ruby forums to however I dont want to hide all of the toolbars. only one if we could get the syntax for the getting started toolbar it would be much easier

      posted in Developers' Forum
      S
      simonstaton
    • Hide Toolbars On Load

      Ok I have built a plugin that automaticly loads the components panel when sketchup loads this is the code I am using.

      status = UI.show_inspector "Components"
      

      now is there one of these that I can make that will hide the getting started toolbar on load. maybe somthing like,

      status = UI.hide_toolbar "gettingstarted"
      
      posted in Developers' Forum
      S
      simonstaton
    • RE: Exploding Using Ruby Script

      @tig said:

      Sorry 😳 - I made a typo, try this... there was loose ) after entities !

      Sketchup.active_model.active_entities.each{|e|e.explode if e.class==Sketchup::ComponentInstance}

      wewt! thanks man that worked a dream. ive spent so long on this thanks 😃

      posted in Developers' Forum
      S
      simonstaton
    • RE: Locking The Components Panel To The Side

      well what I am doing it editting sketchup to hand out to our clients. and we dont ned to show them the layers panels etc only the components panel.

      posted in Developers' Forum
      S
      simonstaton
    • RE: Exploding Using Ruby Script

      I have just been playing around with the bomb.rb plugin however this does explode it but it explodes it completly and I only want it to explode once. This is the code that explodes all the components complely.

      
      Sketchup.send_action(21101)
      def bomb_groups
      	model = Sketchup.active_model
      	defs = model.definitions
      	return nil if UI.messagebox("Are You Finished Building Your Climbing Frame This Will Colapse The Model", MB_YESNO) == 7
      	if Sketchup.version[0,1].to_i >= 7
      		model.start_operation("bomb groups",true)
      		puts "Using enhanced speed mode"
      	else
      		model.start_operation "bomb groups"
      	end
      	defs.each do |d|
      
       		puts "exploding #{(itotal = d.instances.length)} instances of #{d.name}"
      		d.instances.each do |e|
      			e.explode
      
      		end
      		Sketchup.set_status_text "Collapseing Your Action 3D Model"
      	end
      	model.commit_operation
      	Sketchup.set_status_text("Your Model Has Been Collapsed And You Can Now View The Models Price") 
      	UI.messagebox("Your Model Has Been Collapsed And You Can Now View The Models Price",MB_OK) 
      end
      
      unless file_loaded?("bomb.rb")
      # BEGIN CHANGES BY organizerEdit.rb
      	file_loaded("bomb.rb")
      	if $submenu!=nil
      		$submenu.add_item("Bomb All") { bomb_groups }
      	end
      # END CHANGES BY organizerEdit.rb
      end
      bomb_groups
      
      
      
      posted in Developers' Forum
      S
      simonstaton
    • RE: Locking The Components Panel To The Side

      @dave r said:

      What about the other ones though?

      What do you mjean by the other ones, I have set it so that only the components panel can show then I am going to disable to windows panel at the top so that they cannot set anything else to apepar. I have also built my own toolbars customized to what I am doing.

      posted in Developers' Forum
      S
      simonstaton
    • Locking The Components Panel To The Side

      OK I was wondering if it would be possible to make a plugin that will lock the components panel so that it is always open maybe somthing like this.

      status = UI.show_inspector "Components"
      

      but then lock the components panel to the side of sketchup and then make it expand the full distance so that it looks like the below image but they cannot move the components panel around and it is always on the side like that.

      http://i253.photobucket.com/albums/hh58/simonstaton/sketchup.jpg

      posted in Developers' Forum
      S
      simonstaton
    • RE: Exploding Using Ruby Script

      @tig said:

      {Sketchup.send_action(21101)} ### scrap it... no need to 'select' anything

      Use this line put inside your {}

      Sketchup.active_model.active_entities).each{|e|e.explode if e.class==Sketchup;;ComponentInstance}
      

      that just gave me this error

      C;/Documents and Settings/Administrator/Desktop/action3d/Plugins/Utilities/Toolbar.rb;5; syntax error
           Sketchup.active_model.active_entities).each{|e|e.explode if e.class==Sketchup;;ComponentInstance}
                                                 ^Error Loading File LoadToolbar.rb
      C;/Documents and Settings/Administrator/Desktop/action3d/Plugins/Utilities/Toolbar.rb;5; syntax error
           Sketchup.active_model.active_entities).each{|e|e.explode if e.class==Sketchup;;ComponentInstance}
                                                 ^
      
      posted in Developers' Forum
      S
      simonstaton
    • RE: Exploding Using Ruby Script

      that still isnt exploding it selects it all. also what do you mean by error testing

      posted in Developers' Forum
      S
      simonstaton
    • RE: Exploding Using Ruby Script

      no ideas?

      posted in Developers' Forum
      S
      simonstaton
    • Exploding Using Ruby Script

      Basicly I want to explode all the components on the page using a ruby script. I have a
      component inside of a component and the component that is inside the
      main one has attributes so I do not want to explode it completly but
      only explode it once as if I was right clicking then selecting
      explode.

      So far I have made a toolbar that when you press selects everything on
      the page then next I want it to explode this is my code so far.

       toolbar = UI::Toolbar.new "Action 3D Toolbar"
       cmd = UI::Command.new("Explode All") {
       Sketchup.send_action(21101)
       }
       cmd.small_icon = "3dtoolbar.png"
       cmd.large_icon = "3dtoolbar.png"
       cmd.tooltip = "Action 3D Toolbar"
       cmd.status_bar_text = "Testing the toolbars class"
       cmd.menu_text = "Test"
       toolbar = toolbar.add_item cmd
       toolbar.show
      

      now the only important part here is the Sketchup.send_action(21101)
      and 21101 is the syntax for select all. so all I need to do now is explode as if I am right clicking then selecting explode

      Now is there a syntax for explodeing as I have checked everywhere and
      cant find one maybe somtyhing like this
      Sketchup.send_action “explode:”

      posted in Developers' Forum
      S
      simonstaton
    • 1 / 1