sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Who could help to develop this rb?

    Scheduled Pinned Locked Moved Extensions & Applications Discussions
    extensions
    2 Posts 2 Posters 3.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I Offline
      iApple
      last edited by

      Hi All, I found a "Layer Face Camera" plugin, and it's useful. But it can only turn off "always face camera". Who could help to add Switch ON/OFF function? Thank you very much.

      version:

      Added Undo

      module JF
      def self.layer_face_camera
      layers = Sketchup.active_model.layers
      name = UI.inputbox(["Layer"], [layers[0].name], [layers.map{|l|l.name}.join("|")])
      return unless name
      Sketchup.active_model.start_operation("Layer Face Camera")
      Sketchup.active_model.entities.each { |ent|
      next unless ent.is_a? Sketchup::ComponentInstance
      next unless ent.layer.name == name[0]
      cdef = ent.definition
      cdef.behavior.always_face_camera = false
      }
      Sketchup.active_model.commit_operation
      end
      end

      1 Reply Last reply Reply Quote 0
      • sdmitchS Offline
        sdmitch
        last edited by

        
        # version;
        # Added Undo
        
        module JF
          def self.layer_face_camera
            layers = Sketchup.active_model.layers
            name = UI.inputbox(["Layer;","On/Off;"], [layers[0].name,"Off"], [layers.map{|l|l.name}.join("|"),"On|Off"])
            return unless name
            Sketchup.active_model.start_operation("Layer Face Camera")
            Sketchup.active_model.entities.each { |ent|
              next unless ent.is_a? Sketchup;;ComponentInstance
              next unless ent.layer.name == name[0]
              cdef = ent.definition
              cdef.behavior.always_face_camera = true if name[1]=="On"
              cdef.behavior.always_face_camera = false if name[1]=="Off"
            }
            Sketchup.active_model.commit_operation
          end
        end
        
        
        

        Nothing is worthless, it can always be used as a bad example.

        http://sdmitch.blogspot.com/

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement