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

    Posts

    Recent Best Controversial
    • RE: Attempting to make a button for a toolbar

      Alright it's actually pretty simple. If anybody else needs the same thing here you go...

      ` toolbar = UI::Toolbar.new "TOOLBAR.NAME"

       cmd = UI::Command.new("TOOLBAR.ITEM.NAME") {
        
          ###copy everything from the def you want to use here...
         
          ###call it...
          DEF.NAME.call()
       }
       cmd.small_icon = "PATH.TO.ICON"
       cmd.large_icon = "PATH.TO.ICON"
       cmd.tooltip = "POPUP.TEXT"
       cmd.status_bar_text = "TEXT"
       cmd.menu_text = "TEXT"
       toolbar = toolbar.add_item cmd
       toolbar.show`
      
      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Automaticaly try to import files that aren't .sku

      Yeah... I'm going to stay out of this conversation and just try to follow along as best I can. How do you guys think in script? I think my brain was completely maxed out after I added about 50% of AS3 to it, so HTML CSS PHP and AS3. I just don't seem to be retaining ruby like I did the others. Maybe I'm just getting old.

      posted in Developers' Forum
      E
      Eric_Erb
    • Attempting to make a button for a toolbar

      πŸ˜• ❓ πŸ˜• ❓ πŸ˜• ❓ πŸ˜•
      I'm trying to make a toolbar button. I used the webexporter files as my guides. I was able to create the toolbar with the button but the button didn't execute the def it did nothing. I was messing around with it and now I'm getting "Error Loading File addfg2walls.rb
      undefined local variable or method `fg2walls' for main:Object"

      my addfg2walls.rb file (the one that creates the button)looks like this...

      require "Rapidset/fg2walls.rb" def createPlugin() fg2walls.init() end createPlugin()

      and my fg2walls.rb file (the one that defines the button and the def I want the button to run) looks like this...

      ` require 'sketchup'
      def fg2walls::init()
      cmd = UI::Command.new(fg2walls.handleToolbarPress) {handleToolbarButtonPress()}
      cmd.small_icon = "FG.png"
      cmd.large_icon = "FG.png"
      cmd.status_bar_text = cmd.tooltip = "Fox Gray"
      cmd.menu_text = "Wall Colors"
      wallsToolbar = UI::Toolbar.new("Wall Colors")
      wallsToolbar.add_item(cmd)
      wallsToolbar.show

      UI.menu("Plugins").add_item("FG Walls") { fg2walls.init }
      end

      def fg2walls::handleToolbarButtonPress()
      mod = Sketchup.active_model
      su_materials = mod.materials
      my_materials = Hash.new
      my_materials["Wall_surfaces"] = su_materials["FG"]

      begin
      mod.start_operation("Change Walls", true)
      rescue ArgumentError
      mod.start_operation("Change Walls")
      end

      mod.entities.each do |entity|
      if entity.is_a? Sketchup::Drawingelement
      entity.material = my_materials[entity.layer.name] if my_materials[entity.layer.name]
      end
      end

      mod.commit_operation
      end`

      As I said I was just using the WebExporter files as a guide so I don't even know if these need to be two separate files. You know it's funny as soon as I start to feel confident enough to start putting my own things together, Ruby has a way of reminding me that I know nothing. Below you can download either of the files to edit them.
      addfg2Wallsfg2walls

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Script returns no errors but has no effect in sketchup

      Perfect!!! Thank you Chris

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Script returns no errors but has no effect in sketchup

      I think the problem with my code is that I'm still looking at all the layer names and applying materials to the components within those layers according to the layers name. Therefore when It finds a layer that doesn't have a material associated with it it applies white. So what I need to do is either write a script that specifically looks for a layer named Roof_surface and apply materials to its components or add a few lines to my script that says "if there is no material associated with this layer name do nothing" Anybody know how to do that?

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Script returns no errors but has no effect in sketchup

      Well it shows up just as it should in my pluggins menu. I have my material called BS loaded in the template so it's in the active model materials. I'm sure there is a big hint in your reply to my post but I just don't know enough to discern what you're telling me. For crying out loud I wrote a script with a method that I never called on and wondered why it didn't do anything.

      I'm getting closer. The new code changes the roof to the BS material, but is still turning the other stuff white.

      ` require 'sketchup'
      def bs2roof
      mod = Sketchup.active_model
      su_materials = mod.materials
      my_materials = Hash.new
      my_materials["Roof_surface"] = su_materials["BS"]

      begin
      mod.start_operation("Change Roof", true)
      rescue ArgumentError
      mod.start_operation("Change Roof")
      end

      mod.entities.each do |entity|
          if entity.is_a? Sketchup::Drawingelement
      	entity.material = my_materials[entity.layer.name]
          end
      end
      

      mod.commit_operation
      end

      UI.menu("Plugins").add_item("BS Roof") { bs2roof }`
      
      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Script returns no errors but has no effect in sketchup

      You know when someone points something like that out you can't help but think "I'm....Dumb" I actually cut it out to get rid of the add to plugin menu thing. The new problem is it turns the outside of my model white even thought the material is Burnished Slate (BS) in color. (The inside of my model retains it's materials"

      ` require 'sketchup'
      def bs2roof
      mod = Sketchup.active_model
      su_materials = mod.materials
      my_materials = Hash.new
      my_materials["Roof_Surface"] = su_materials["BS"]

      begin
      mod.start_operation("Change Roof", true)
      rescue ArgumentError
      mod.start_operation("Change Roof")
      end

      mod.entities.each do |entity|
      entity.material = my_materials[entity.layer.name]
      end

      mod.commit_operation
      end

      if( !$bs2roofLoaded )
      UI.menu("Plugins").add_item("BS Roof") { bs2roof }
      bs2roofLoaded = true
      end`

      posted in Developers' Forum
      E
      Eric_Erb
    • Script returns no errors but has no effect in sketchup

      My boss pointed out that there is an exception to the "materials are always the same" rule that you guys helped write a code for. I thought I'd just make a button to make the material change if it is needed. So I wrote the code below but when I run it in sketch up it says complete and returns no errors but has no effect on my model. Where did I screw it up?

      ` require 'sketchup'
      def BS2Roof
      mod = Sketchup.active_model
      su_materials = mod.materials
      my_materials = Hash.new
      my_materials["Roof_Surface"] = su_materials["BS"]

      begin
      mod.start_operation("Change Roof", true)
      rescue ArgumentError
      mod.start_operation("Change Roof")
      end

      mod.entities.each do |entity|
      entity.material = my_materials[entity.layer.name]
      end

      mod.commit_operation
      end`

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Legal Questions / Maybe Liscensing Question

      SOAP does look interesting but what I'm going for is having an interactive color choice system for all of our models and it seams like with SOAP it would have to be set up specific to each model and we just don't have the time to invest in setting up SOAP every time. furthermore, I need to supply the user with a list of eight color choices, not allow them an infinite number of choices. Thanks for the suggestion though

      posted in SketchUp Discussions
      E
      Eric_Erb
    • RE: Automaticaly try to import files that aren't .sku

      Thanks again Gruff... it worked without a hitch. It's a bit of a work around but it works and that's the important thing. I might try to figure out how to launch it during startup and just have it appear down in the notification area of the windows toolbar so I can drag and drop files to it there instead of just keeping a your small window on screen all the time.

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Automaticaly try to import files that aren't .sku

      I sent you a couple PMs. The first problem I'm having it that I can't set my dwg files to open with your .exe. I can set them to open with anything else but when I select yours it ignores it and stays with whatever program was selected before. The second problem is when I drop a .dwg file on your .exe I get this error...

      http://rapidsetbuildings.com/Images/oops.jpg

      I'm sure I'm doing something wrong

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Freelance Oportunity okayed by Mike Lucey

      Update... section D instead of having the choice of skinned or frame view... just export and display both.

      posted in Corner Bar
      E
      Eric_Erb
    • RE: Automaticaly try to import files that aren't .sku

      Anybody get this to work?

      posted in Developers' Forum
      E
      Eric_Erb
    • Freelance Oportunity okayed by Mike Lucey

      I'll try to explain what I'm doing... I work for a small company (3 employees so far) that designs steel buildings (warehouses,factories,etc.) we have a CAD program which is AutoCAD at its core. So, here's my mission...

      1. I want to take the dxf/dwg from AutoCAD and automatically have it open in Sketchup.
        Gruff says he's done this but I can't get it to work http://forums.sketchucation.com/viewtopic.php?f=180&t=22601
      2. This is where it gets more complicated. I need a webdialog that...

      a. clients can access and enter their quote number to bring up the model of their building

      b. show their building in 3D with default materials
      My idea was to automate web exporter, to ftp it to a database, and put it in a frame.I've removed all the prompts from web exporter so that it jumps straight to the process of rotating it and
      saving out the jpg files

      c. allow the client to choose colors for Walls, Roof, and Trim
      I've written a .rb to apply materials based on layer names (layer names are always the same) I also have swatches for the 8 color choices

      d. they need to be able to toggle between a frame and skinned view
      I've written 2 .rb scripts for this one that turns all the layers on and then the frame layers off. One that turns all the layers on and then turns the skin layers off.

      e. when they hit "preview" update the Web Exporter frame

      f. when they hit "save colors" update the Web Exporter frame and write a file (.txt for all I care) to a specific location with their choices and quote number.

      Anybody up to it?
      I should also add that we need to have access to the source code so that we can make changes if needed in the future.

      posted in Corner Bar
      E
      Eric_Erb
    • RE: Automaticaly try to import files that aren't .sku

      Thanks Gruff. I've been out sick for a couple days, but I'm going to try this right now. Thanks again

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Legal Questions / Maybe Liscensing Question

      Sorry I've been out sick. I haven't been ignoring you guys. I'm catching up with my posts and PMs and I'll be responding ASAP

      posted in SketchUp Discussions
      E
      Eric_Erb
    • RE: Automaticaly try to import files that aren't .sku

      if i could get it to work with .dxf or .dwg I'd be thrilled. So if one would be easier than the other for some reason, that's fine. Same goes for any other 3D cad format from autoCAD for that matter.

      posted in Developers' Forum
      E
      Eric_Erb
    • RE: Can we post freelance opportunities on here?

      @remus said:

      might want to wait for mike/gaieus to confirm this, but generally low key asking 'got a bit of work, anyone fancy taking it on?' stuff is ok.

      Thanks remus. I'll wait for their confirmation then.

      posted in Corner Bar
      E
      Eric_Erb
    • Legal Questions / Maybe Liscensing Question

      If I write a ruby plugin and a web dialog. Does it violate SU terms of use if we allow users on the internet to change the colors of the components on the models my company builds? Easy enough to do without sketchup if you just mask stills but we were wanting to show a rotating model. Thanks again everybody

      posted in SketchUp Discussions sketchup
      E
      Eric_Erb
    • Can we post freelance opportunities on here?

      I'm new to the Sketchucation forums and ruby scripting. I've been working on a project and many of you have helped me out but I've hit a wall. So I was wondering if we can post freelance opportunities to these boards. I know some forums freak out about things like that so I thought I'd play it safe and ask before I post.

      posted in Corner Bar
      E
      Eric_Erb
    • 1
    • 2
    • 1 / 2