lib/su_info/Template_Code.rb
# An example using the ROP constants
#
An example using the ROP constants
An example using the ROP constants
def ro_2
    @obs_ro2 = Sketchup::RenderingOptionsObserver.new
    @obs_ro2.instance_eval {
      def onRenderingOptionsChanged(ro, type)
        cns = ro.class
        suffix = case type
          when cns::ROPDrawHidden
                      'DrawHidden'
          when cns::ROPSetDisplayColorByLayer
                         'DisplayColorByLayer'
          when cns::ROPSetDisplaySketchAxes
                         'DisplaySketchAxes'
          when cns::ROPSetHideConstructionGeometry
                         'HideConstructionGeometry'
          when cns::ROPSetModelTransparency
                         'ModelTransparency'
          when cns::ROPSetRenderMode
                         'RenderMode'
          when cns::ROPSetSectionDisplayMode
                         'SectionDisplayMode'
          when cns::ROPSetTexture
                         'Texture'
          else "Not caught by case statement"
          end
        puts suffix
      end
    }
    Sketchup.active_model.rendering_options.add_observer(@obs_ro2)
  end
def ro_2 @obs_ro2 = Sketchup :: RenderingOptionsObserver . new @obs_ro2 . instance_eval { def onRenderingOptionsChanged ( ro , type ) cns = ro . class suffix = case type when cns :: ROPDrawHidden 'DrawHidden' when cns :: ROPSetDisplayColorByLayer 'DisplayColorByLayer' when cns :: ROPSetDisplaySketchAxes 'DisplaySketchAxes' when cns :: ROPSetHideConstructionGeometry 'HideConstructionGeometry' when cns :: ROPSetModelTransparency 'ModelTransparency' when cns :: ROPSetRenderMode 'RenderMode' when cns :: ROPSetSectionDisplayMode 'SectionDisplayMode' when cns :: ROPSetTexture 'Texture' else "Not caught by case statement" end puts suffix end } Sketchup . active_model . rendering_options . add_observer ( @obs_ro2 ) end
An example using the ROP constants
An example using the ROP constants
# create an observer & add callback method # attach it to the Rendering_options of the model