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

    Posts

    Recent Best Controversial
    • RE: Problems with SketchUp 8 plugins in Sketchup 2015

      @unknownuser said:

      Perhaps: varstr.to_s.gsub...

      Is a good idea, but does not really works.

      It works like this:

      
         varstr = varstr.to_s
         attstr = varstr.gsub(/(\A@@)/,'')
      
      

      The names of the module variables will be reduced by the first two "@" sign.
      This names will be used later as descriptions to make the color settings. For example for cabinet sides, cabinet doors, tabletops ...

      We are manufacturer of office furniture.
      http://www.momo-moebel.de/

      The application is used to create plans for office furniture.
      You can get the plugins as a free download for usage with SketchUp 8 from our homepage.
      http://www.momo-moebel.de/fileadmin/service/mo_mo_SketchUp_V_3_2_06.zip
      We want to offer that for current sketchup Versions. Therefore, we are reworking the SketchUp plugins.

      posted in Developers' Forum
      A
      Andreas
    • RE: Problems with SketchUp 8 plugins in Sketchup 2015

      It is a large application. Therefore it is comprehensible to declare the variable in a separate file.

      But it seems, that the real problem is included elsewhere. So I've changed my method. Till now I've tried to find out what does not work. Now I am trying to find out what works.

      In that process I found an error in the following code:

      
      require('sketchup.rb')
      
      module ABSBMP;;MoMo
      ...
      
      ...
      
      class << self
      
        # Proxy class inside module ABSBMP;;MoMo
      
        # Create Reader methods for currently defined module variables.
        #{
        ABSBMP;;MoMo;;class_variables.each do |varstr|
      
          kind = eval %[#{varstr}.class]
      		
          attstr = varstr.gsub(/(\A@@)/,'')  <-- Error; #<NoMethodError; undefined method `gsub' for ;@@relExtPfad;Symbol>
      				
          # Reader Method 
          unless ['@@sag','@@skript'].include?(varstr)
            eval %[def #{attstr}(); return #{varstr}; end;]
            if kind.is_a?(TrueClass) || kind.is_a?(FalseClass)
              eval %[alias_method('#{attstr}?','#{attstr}');]
            end
          end
      
        end #} do class_variables.each
      
      
      end  # Proxy class 
      
      end  # module ABSBMP;;MoMo
      
      file_loaded('ABSBMP;mo_mo_var_get')  # global method from 'Tools/sketchup.rb'
      
      
      
      

      %(#4040FF)[The error-message is shown at the start of SketchUp 2015.
      In SketchUp 8 it works well!!!]

      posted in Developers' Forum
      A
      Andreas
    • RE: Problems with SketchUp 8 plugins in Sketchup 2015

      Sorry, my mistake. It is not complete, I forgot something.
      This should be correct:

      # File in SketchUp-Plugins
      
      require('sketchup.rb')
      require('extensions.rb')
      
      module ABSBMP  ### ( Toplevel namespace)
      
        module MoMo  ### ( This plugin's nested namespace. )
          @@relExtPfad = 'ABSBMP/mo_mo_moebel' # relative path 
          @@ladeprogramm = 'mo_mo_load'        # load script 
         
          ...
          @@plugin = SketchupExtension.new( @@sagExt;titel],File.join@@relExtPfad,@@ladeprogramm) )
          ...
            
          Sketchup.register_extension( @@plugin, true )
            
        end # module MoMo
      end # module ABSBMP      
      
      file_loaded('Plugins;ABSBMP_mo_mo_moebel_ext')  # global method from 'Tools/sketchup.rb'
      
      
      
      
      
      # File (@@ladeprogramm 'mo_mo_load') in subdirectory (@@relExtPfad)
      
      require('sketchup.rb')
      
      module ABSBMP;;MoMo
         Sketchup.require(File.join(@@relExtPfad,'mo_mo_main'))
      end  # < module ABSBMP;;MoMo 
      
      file_loaded('ABSBMP;mo_mo_load')  # global method from 'Tools/sketchup.rb'
      
      
      
      
      
      # File ('mo_mo_var_get') in subdirectory (@@relExtPfad)
      
      require('sketchup.rb')
      
      module ABSBMP;;MoMo   
        
        ### MODUL-VARIABLEN  ( MODULE VARIABLES )
      
         ...
         #{# Menüs  ( Menus )
         #
           @@menu = {}
         #
         #}#	
         ...
      	
      end  # module ABSBMP;;MoMo
      
      file_loaded('ABSBMP;mo_mo_var_get')  # global method from 'Tools/sketchup.rb'	
      
      
      
      
      
      # File ('mo_mo_main') in subdirectory (@@relExtPfad)
      
      require('sketchup.rb')
      
      module ABSBMP;;MoMo
          ...
          @@skript = ["mo_mo_var_get"]		
      		
          Sketchup;;require(File.join(@@relExtPfad,@@skript))		
          ...
      
      
          ...
          @@menu[;top]= UI.menu("Plugins")
          ...
         
      
         
      end  # module ABSBMP;;MoMo 
      
      file_loaded('ABSBMP;mo_mo_main')  # global method from 'Tools/sketchup.rb'      
      
      
      
      
      posted in Developers' Forum
      A
      Andreas
    • RE: Problems with SketchUp 8 plugins in Sketchup 2015

      It is a little bit complex.
      I don´t want to show hundreds of lines code here.
      So I try it like this:

      # File in SketchUp-Plugins
      
      require('sketchup.rb')
      require('extensions.rb')
      
      module ABSBMP  ### ( Toplevel namespace)
      
        module MoMo  ### ( This plugin's nested namespace. )
          @@relExtPfad = 'ABSBMP/mo_mo_moebel' # relative path 
          @@ladeprogramm = 'mo_mo_load'        # load script 
      	
          ...
          @@plugin = SketchupExtension.new( @@sagExt;titel],File.join@@relExtPfad,@@ladeprogramm) )
          ...
      		
          Sketchup.register_extension( @@plugin, true )
      		
        end # module MoMo
      end # module ABSBMP		
      
      file_loaded('Plugins;ABSBMP_mo_mo_moebel_ext')  # global method from 'Tools/sketchup.rb'
      
      
      
      
      # File (@@ladeprogramm 'mo_mo_load') in subdirectory (@@relExtPfad)
      
      require('sketchup.rb')
      
      module ABSBMP;;MoMo
        Sketchup.require(File.join(@@relExtPfad,'mo_mo_main'))
      end  # < module ABSBMP;;MoMo 
      
      file_loaded('ABSBMP;mo_mo_load')  # global method from 'Tools/sketchup.rb'
      
      
      
      
      
      # File ('mo_mo_main') in subdirectory (@@relExtPfad)
      
      require('sketchup.rb')
      
      module ABSBMP;;MoMo
          ...
          @@menu[;top]= UI.menu("Plugins")
          ...
      		
      end  # module ABSBMP;;MoMo 
      
      file_loaded('ABSBMP;mo_mo_main')  # global method from 'Tools/sketchup.rb'		
      		
      
      posted in Developers' Forum
      A
      Andreas
    • Problems with SketchUp 8 plugins in Sketchup 2015

      We try to change our SketchUp 8 plugins to SketchUp 2015. But it seems not so easy. There are several problems.

      For example:

        %(#4000FF)[**@@menu[:top]= UI.menu("Plugins")**]
      

      works with SketchUp 8 fine. SketchUp 2015 don´t accept that.

      I can´t find the reason.
      What´s the problem?

      posted in Developers' Forum
      A
      Andreas
    • Save pages as jpg-files

      Hello,

      I have SketchUp-files with pages (scenes).
      And I want to save a jpg-file from the last view of each page in the SketchUP-file automaticly by a button-click in the menu.
      Can someone tell me how does that works???

      Thank you!

      posted in Developers' Forum
      A
      Andreas
    • Inputbox prompts by variable

      I have a problem once again .

      This code works well:

      
      prompts = ['What is your Name?', 'What is your Age?', 'Gender']  
      defaults = ['Enter name', '', 'Male']  
      list = ['', '', 'Male|Female']  
      input = UI.inputbox prompts, defaults, list, 'Tell me about yourself.'
      
      

      Now I want to give the information by variable.
      For example for 'prompts':

      
      p = "'"What is your Name?"'" + "," + "'"What is your Age?"'" + "," + "'"Gender"'"
      prompts = [p]
      ...
      
      

      But that don´t works!
      What is my mistake?
      Is there another way to solve the problem?
      Or is that not possible?

      posted in Developers' Forum
      A
      Andreas
    • RE: Identify groups by its attributevalue and delete them

      Thank you!!!

      But there is an error:

      <span class="syntaxdefault"><br />  elsif e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_attribute</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'section'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'key'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 1<br /></span>
      

      [/quote]

      It must be:

      <span class="syntaxdefault"><br />  elsif group</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_attribute</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'section'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'key'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> 1<br /> </span>
      

      I see, you want to test me 😉

      Thank you!!!!!!

      posted in Developers' Forum
      A
      Andreas
    • RE: Identify groups by its attributevalue and delete them

      @thomthom said:

      <span class="syntaxdefault"><br />Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">e</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">  next unless e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">is_a</span><span class="syntaxkeyword">?(</span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">Group </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">  if e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_attribute</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'section'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'key'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">'value'<br /></span><span class="syntaxdefault">    e</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">erase</span><span class="syntaxkeyword">!<br /></span><span class="syntaxdefault">  end<br /></span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault"> </span>
      

      Thank you!
      That works fine!

      I want to use it also to another job.
      Textures should be assigned to the groups:

      
      Sketchup.active_model.selection.each { |e|
        next unless e.is_a?( Sketchup;;Group )
          if e.get_attribute('section', 'key') == 0
            e.material = "oak_trans"
          elsif e.get_attribute('section', 'key') == 1
            e.material = "oak_long"
          end
      }
      
      
      

      That works with the selected groups.
      But the groups one or more level lower will not be edit.
      What have to be changed to use it for the groups into the groups?

      posted in Developers' Forum
      A
      Andreas
    • RE: Identify groups by its attributevalue and delete them

      @tig said:

      If the instance has the attribute rather than its definition... then it'll be

      <span class="syntaxdefault"><br />    Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definitions</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">d</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">      next unless d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault">      d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">instances</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">i</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">          if i</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_attribute</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'section'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'key'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">'value'<br /></span><span class="syntaxdefault">            i</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">erase</span><span class="syntaxkeyword">!<br /></span><span class="syntaxdefault">          end<br />        </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">      </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">      </span>
      

      😉

      That works fine for all groups!
      How must the code be changed, if only will be referencing to the selected groups?

      posted in Developers' Forum
      A
      Andreas
    • RE: Identify groups by its attributevalue and delete them

      @thomthom said:

      <span class="syntaxdefault"><br />Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definitions</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">d</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">  next unless d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault">  if d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_attribute</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'section'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'key'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">'value'<br /></span><span class="syntaxdefault">    d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">instances</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">i</span><span class="syntaxkeyword">|</span><span class="syntaxdefault"> i</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">erase</span><span class="syntaxkeyword">!</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">  end<br /></span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault"> </span>
      

      Thank you, but that does not work.

      posted in Developers' Forum
      A
      Andreas
    • RE: Identify groups by its attributevalue and delete them

      @tig said:

      If the instance has the attribute rather than its definition... then it'll be

      <span class="syntaxdefault"><br />    Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">definitions</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">d</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">      next unless d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault">      d</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">instances</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">each </span><span class="syntaxkeyword">{</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">|</span><span class="syntaxdefault">i</span><span class="syntaxkeyword">|<br /></span><span class="syntaxdefault">          if i</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">get_attribute</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'section'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'key'</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxstring">'value'<br /></span><span class="syntaxdefault">            i</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">erase</span><span class="syntaxkeyword">!<br /></span><span class="syntaxdefault">          end<br />        </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">      </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">      </span>
      

      😉

      Thank you, that works fine!!!

      posted in Developers' Forum
      A
      Andreas
    • RE: Identify groups by its attributevalue and delete them

      It can be one or more groups of all groups in Modell.

      I want to check against attribute value.

      My SU Ruby API experience is a little bit more than rookie 😉 .

      posted in Developers' Forum
      A
      Andreas
    • Identify groups by its attributevalue and delete them

      I'm looking for a way to delete groups which have certain values in the attributes of an AttributeDictionary.
      So I want to identify the group by its attributevalue and than I want to delete those groups.
      Is that possible???

      posted in Developers' Forum
      A
      Andreas
    • RE: How to draw a cylinder by ruby?

      @thomthom said:

      face=edges[0].faces[0]

      There is also an error:

      center_point = Geom;;Point3d.new(10, 10, 10)
      => Point3d(10, 10, 10)
      vector = Geom;;Vector3d.new(0,0,1)
      => Vector3d(0, 0, 1)
      
      => nil
      radius = 5
      => 5
      segments = 10
      => 10
      height = 2
      => 2
      
      => nil
      group=Sketchup.active_model.active_entities.add_group()
      => #<Sketchup;;Group;0x82075d0>
      ents=group.entities
      => #<Sketchup;;Entities;0x8206d60>
      
      => nil
      edges=ents.add_circle(center_point, Z_AXIS, radius, segments)
      => [#<Sketchup;;Edge;0x8205adc>, #<Sketchup;;Edge;0x8205ac8>, #<Sketchup;;Edge;0x8205a64>, #<Sketchup;;Edge;0x8205a50>, #<Sketchup;;Edge;0x82059ec>, #<Sketchup;;Edge;0x82059d8>, #<Sketchup;;Edge;0x82059b0>, #<Sketchup;;Edge;0x820599c>, #<Sketchup;;Edge;0x8205988>, #<Sketchup;;Edge;0x8205974>]
      face=edges[0].faces[0]
      => nil
      face.pushpull(height)
      NoMethodError; undefined method `pushpull' for nil;NilClass
      
      
      posted in Developers' Forum
      A
      Andreas
    • RE: How to draw a cylinder by ruby?

      @tig said:

      group=Sketchup.active_model.active_entities.add_group()
      > ents=group.entities
      > edges=ents.add_circle(center_point, normal_vector, radius, segments)
      > face=edges[0].face
      > face.pushpull(height)
      

      center_point is the point at which the center of the cylinder's bottom face sits...
      normal_vector is the direction of the circular face [which will become the cylinder's bottom face] - typically Z_AXIS...
      radius the circular face's and therefore the cylinder's radius...
      segments the number of segments in the circle and thereby the cylinder's 'side' faces...
      height is the cylinder's height.

      When you have made the cylinder you can use group.explode to return the cylinder's geometry to the active context if desired...

      Sorry, but that doesn´t works:

      center_point = Geom;;Point3d.new(10, 10, 10)
      => Point3d(10, 10, 10)
      vector = Geom;;Vector3d.new(0,0,1)
      => Vector3d(0, 0, 1)
      
      => nil
      radius = 5
      => 5
      segments = 10
      => 10
      height = 2
      => 2
      
      => nil
      group=Sketchup.active_model.active_entities.add_group()
      => #<Sketchup;;Group;0x821f824>
      ents=group.entities
      => #<Sketchup;;Entities;0x821f298>
      
      => nil
      edges=ents.add_circle(center_point, Z_AXIS, radius, segments)
      => [#<Sketchup;;Edge;0x821e190>, #<Sketchup;;Edge;0x821e168>, #<Sketchup;;Edge;0x821e154>, #<Sketchup;;Edge;0x821e140>, #<Sketchup;;Edge;0x821e12c>, #<Sketchup;;Edge;0x821e118>, #<Sketchup;;Edge;0x821e104>, #<Sketchup;;Edge;0x821e0f0>, #<Sketchup;;Edge;0x821e0dc>, #<Sketchup;;Edge;0x821e0c8>]
      
      => nil
      face=edges[0].face
      NoMethodError; undefined method `face' for #<Sketchup;;Edge;0x821e190>
      
      
      posted in Developers' Forum
      A
      Andreas
    • How to draw a cylinder by ruby?

      how can I draw a cylinder by ruby-code?

      posted in Developers' Forum
      A
      Andreas
    • Add to existing groups to a new group

      How can I add two existing groups (for example group_1 and group_2) to a new group (group_total) by ruby-code?

      posted in Developers' Forum
      A
      Andreas
    • RE: Layer color by ruby-code?

      @thomthom said:

      I see an issue with this method:

      It has multiple .start_operation and commit_operation inside the code flow - which will interfere with any start_operation you started yourself - since SU doesn't handle nested start_operations:

      ` model.start_operation

      ...

      layer.color = 'red' # this breaks the undo stack

      ...

      model.commit_operation`

      Though, it is not related to the error you got.

      Sorry, I don´t understand that.

      I tried now that:

      def layer_color
        model = Sketchup.active_model
        layer = model.layers.add "Test_Layer"
        layer.color = [255,255,255]
      
      end
      
      if( not file_loaded?("test.rb") )
        plugins_menu = UI.menu("Plugins")
      	plugins_menu.add_item("LayerColor") {layer_color}
      end
      
      #-----------------------------------------------------------------------------
      file_loaded("test.rb")
      

      That works without error - but the new layer has the color 102,68,0
      and not 255,255,255!!!???

      I test that:

      def layer_color
        model = Sketchup.active_model
        layer = model.layers.add "Test_Layer"
        layer.color = "Blue"
      
      end
      
      if( not file_loaded?("test.rb") )
        plugins_menu = UI.menu("Plugins")
      	plugins_menu.add_item("LayerColor") {layer_color}
      end
      
      #-----------------------------------------------------------------------------
      file_loaded("test.rb")
      

      The same result like before - Color 102,68,0 instead of blue

      Than I test that:

      def layer_color
        model = Sketchup.active_model
      
        my_mat = materials.add "Ahorn"
        my_mat.texture = "O;\\Sketchup\\Mat\\Ahorn.jpg"
      
        layer = model.layers.add "Test_Layer"
      
        layer.color = my_mat
      
      end
      
      if( not file_loaded?("test.rb") )
        plugins_menu = UI.menu("Plugins")
      	plugins_menu.add_item("LayerColor") {layer_color}
      end
      
      #-----------------------------------------------------------------------------
      file_loaded("test.rb")
      

      There was no error but also no layer!!

      posted in Developers' Forum
      A
      Andreas
    • RE: Layer color by ruby-code?

      @thomthom said:

      But there should be a traceback.

      If you have a file like this:

      
      > def test_me
      >   x == y
      > end
      > 
      

      and then call that method you should get this error:
      Error: #<NameError: undefined local variable or methodx' for main:Object>
      C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/testme.rb:2
      (eval):2537`

      Notice it includes the filename and line number after reporting the error. Do you not get that kind of error?

      The first way I test was run automatically at the Sketchup start.
      There was only the error message I posted.

      posted in Developers' Forum
      A
      Andreas
    • 1 / 1