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

    Posts

    Recent Best Controversial
    • RE: To_1 conversion method

      Thanks Jim and Chris,

      Essentially the code come from the beginning ruby tutorial 2.

      Here is the code that is flagged on entering sketchup.

      prompts = ['Push/Pull Distance']
      defaults = [0.to_1]
      results = UI.inputbox prompts, defaults, 'Distance to Push/Pull'
      distance = results[0]

      the error seems to object to the defaults = [0.to_1] line.

      I decided to rewrite default = [0]

      What happens now is that as you enter sketchup, the inputbox is activated, prompts for the "Push/Pull distance." Of course you enter it and then it loads the script.

      I then open my file that I am working on and goto plugins and select the Multiple_push_pull script and the inputbox is activated again and then once you enter the required distance it works.

      Is there a way to stop the inputbox from being called the first time you load sketchup.

      I attempted to address the last question by removing the script from plugins directory and yet it still runs every time you startup sketchup even though the script is no longer in the directory.

      My apologies for loading this thread with another question but if its not a bother...thanks again.

      posted in Developers' Forum
      H
      hlogoma
    • To_1 conversion method

      Hi,

      I am getting an error code "undefined method `to_1' for 0:Fixnum" when I use this method.

      What is the proper format for this conversion method?

      Thanks.

      posted in Developers' Forum
      H
      hlogoma
    • Error in code

      Hi,
      I was trying out the beginning ruby 1 exercise and I got this eval for line 11 which reads:

      11:in 'is_a?': wrong number of arguments(0 for 1)

      following is the code I copied to ruby console:

      ` model = Sketchup.active_model
      entities = model.active_entities
      selection = model.selection

      edges = []
      faces = []
      comps = []
      groups = []

      entities.each do |e|
      edges.push e if e.is_a? == "Edge"
      faces.push e if e.is_a? == "Face"
      comps.push e if e.is_a? == "ComponentInstance"
      groups.push e if e.is_a? == "Group"
      end

      puts "Total Edges : " + edges.length.to_s
      puts "Total Faces : " + faces.length.to_s
      puts "Total Components : " + comps.length.to_s
      puts "Total Groups : " + groups.length.to_s
      puts "Total Entities : " + entities.length.to_s`

      The model is a sphere called beginning ruby.

      My question is "where is the error in the code?"

      Thanks.

      posted in Developers' Forum
      H
      hlogoma
    • 1 / 1