sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    New plugin to extrude multiple selected surfaces at once using your custom value

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 59 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.
    • B Offline
      bibarchidz
      last edited by

      extrude_faces_tool.rbz

      New plugin to extrude multiple selected surfaces at once using your custom value

      ba929d99-bc08-47da-a3be-da38c2022700-image.png

      1 Reply Last reply Reply Quote 2
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by Dan Rathbun

        Please reorganize your extension as a TRUE SketchUp extension.
        See: https://ruby.sketchup.com/file.extension_requirements.html

        Also, take note of the various numeric conversion methods that the SketchUp API has added to the Numeric class. (You do not need to write your own conversion formulae.) Here is an example that will default to model units, if the unit argument is blank:

            def convert_to_inches(value, unit = nil)
              units = Sketchup.active_model.options["UnitsOptions"]
              if unit.nil? # use model units
                case units["LengthFormat"]
                when Length::Architectural, Length::Fractional
                  return value.inch 
                when Length::Engineering
                  return value.feet 
                else # Length::Decimal
                  unit = units["LengthUnit"]
                end
              end
              case unit
              when :in, Length::Inches then value.inch
              when :m,  Length::Meter then value.m 
              when :cm, Length::Centimeter then value.cm
              when :mm, Length::Millimeter then value.mm
              when :ft, Length::Feet then value.feet
              when :yd, 5
                # NOTE: constant Length::Yard (5) was added for SU2020,
                #  use 5 to avoid NameError exception in older versions.
                value.yard # yards to inches
              else
                value.inch # if inches or unknown
              end
            end
        

        Also, this is a good read for dealing with units in SketchUp:

        Link Preview Image
        Dealing with Units in SketchUp

        There are extensions to the base classes in SketchUp’s Ruby API which often new SketchUp plugin developers overlook. If you aren’t aware of them you might find yourself reinventing many…

        favicon

        Procrastinators Revolt! (www.thomthom.net)

        I'm not here much anymore.

        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