sketchucation logo sketchucation
    • Login
    1. Home
    2. Pixero
    3. Posts
    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!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 1
    • Topics 291
    • Posts 2,394
    • Groups 4

    Posts

    Recent Best Controversial
    • RE: Reading numbers from external text file

      Interesting.
      Running your latest code in the console works but running it in SketchUp Ruby Code Editor by Alexander Schreyer gives the Nil result also.

      I also tried your first version in the console and it worked without errors.
      So is it safe to continue if it's just something in his Code editor app that causes the Nil result?

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file

      Here is the txt file I'm loading. (It's a json file from the beginning.)

      test1.txt

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file
      3.4919929866069115
      3.4919929866069115,
      "Nil result (no result returned or run failed)"
      
      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file
      3.4919929866069115
      "x";
      3.4919929866069115,
      "Nil result (no result returned or run failed)"
      
      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file
      
      ["{\n", "  \"principalPoint\"; {\n", "    \"x\"; 3.4919929866069115,\n", "    \"y\"; -0.017301744356540385\n", "  },\n", "  \"viewTransform\"; {\n", "    \"rows\"; [\n", "      [\n", "        -0.9075910551963806,\n", "        0.4198243379864999,\n", "        -0.005099192261283809,\n", "        -31.940051338855746\n", "      ],\n", "      [\n", "        0.00419330408856825,\n", "        -0.003080616899800699,\n", "        -0.9999864629085424,\n", "        -0.10391287329462531\n", "      ],\n", "      [\n", "        -0.4198343634438959,\n", "        -0.9076001515170179,\n", "        0.0010354892297866703,\n", "        -17.250974969132418\n", "      ],\n", "      [\n", "        0,\n", "        0,\n", "        0,\n", "        1\n", "      ]\n", "    ]\n", "  },\n", "  \"cameraTransform\"; {\n", "    \"rows\"; [\n", "      [\n", "        -0.9075910551963807,\n", "        0.00419330408856825,\n", "        -0.41983436344389585,\n", "        -36.23062125433451\n", "      ],\n", "      [\n", "        0.41982433798650004,\n", "        -0.0030806168998006997,\n", "        -0.9076001515170179,\n", "        -2.2480967029645083\n", "      ],\n", "      [\n", "        -0.005099192261283809,\n", "        -0.9999864629085424,\n", "        0.0010354892297866703,\n", "        -0.24891673044480064\n", "      ],\n", "      [\n", "        0,\n", "        0,\n", "        0,\n", "        1\n", "      ]\n", "    ]\n", "  },\n", "  \"horizontalFieldOfView\"; 0.9813963064459168,\n", "  \"verticalFieldOfView\"; 0.6616350540688956,\n", "  \"vanishingPoints\"; [\n", "    {\n", "      \"x\"; -0.5541295463355106,\n", "      \"y\"; 0.0013923823242965234\n", "    },\n", "    {\n", "      \"x\"; 4.357757655415969,\n", "      \"y\"; -0.02365461394665286\n", "    },\n", "    {\n", "      \"x\"; 12.708844850226638,\n", "      \"y\"; 1807.4703594352652\n", "    }\n", "  ],\n", "  \"vanishingPointAxes\"; [\n", "    \"xPositive\",\n", "    \"yPositive\",\n", "    \"zPositive\"\n", "  ],\n", "  \"relativeFocalLength\"; 1.8716593429474995,\n", "  \"imageWidth\"; 5000,\n", "  \"imageHeight\"; 3214\n", "}"]
      "[\"{\\n\", \"  \\\"principalPoint\\\"; {\\n\", \"    \\\"x\\\"; 3.4919929866069115,\\n\", \"    \\\"y\\\"; -0.017301744356540385\\n\", \"  },\\n\", \"  \\\"viewTransform\\\"; {\\n\", \"    \\\"rows\\\"; [\\n\", \"      [\\n\", \"        -0.9075910551963806,\\n\", \"        0.4198243379864999,\\n\", \"        -0.005099192261283809,\\n\", \"        -31.940051338855746\\n\", \"      ],\\n\", \"      [\\n\", \"        0.00419330408856825,\\n\", \"        -0.003080616899800699,\\n\", \"        -0.9999864629085424,\\n\", \"        -0.10391287329462531\\n\", \"      ],\\n\", \"      [\\n\", \"        -0.4198343634438959,\\n\", \"        -0.9076001515170179,\\n\", \"        0.0010354892297866703,\\n\", \"        -17.250974969132418\\n\", \"      ],\\n\", \"      [\\n\", \"        0,\\n\", \"        0,\\n\", \"        0,\\n\", \"        1\\n\", \"      ]\\n\", \"    ]\\n\", \"  },\\n\", \"  \\\"cameraTransform\\\"; {\\n\", \"    \\\"rows\\\"; [\\n\", \"      [\\n\", \"        -0.9075910551963807,\\n\", \"        0.00419330408856825,\\n\", \"        -0.41983436344389585,\\n\", \"        -36.23062125433451\\n\", \"      ],\\n\", \"      [\\n\", \"        0.41982433798650004,\\n\", \"        -0.0030806168998006997,\\n\", \"        -0.9076001515170179,\\n\", \"        -2.2480967029645083\\n\", \"      ],\\n\", \"      [\\n\", \"        -0.005099192261283809,\\n\", \"        -0.9999864629085424,\\n\", \"        0.0010354892297866703,\\n\", \"        -0.24891673044480064\\n\", \"      ],\\n\", \"      [\\n\", \"        0,\\n\", \"        0,\\n\", \"        0,\\n\", \"        1\\n\", \"      ]\\n\", \"    ]\\n\", \"  },\\n\", \"  \\\"horizontalFieldOfView\\\"; 0.9813963064459168,\\n\", \"  \\\"verticalFieldOfView\\\"; 0.6616350540688956,\\n\", \"  \\\"vanishingPoints\\\"; [\\n\", \"    {\\n\", \"      \\\"x\\\"; -0.5541295463355106,\\n\", \"      \\\"y\\\"; 0.0013923823242965234\\n\", \"    },\\n\", \"    {\\n\", \"      \\\"x\\\"; 4.357757655415969,\\n\", \"      \\\"y\\\"; -0.02365461394665286\\n\", \"    },\\n\", \"    {\\n\", \"      \\\"x\\\"; 12.708844850226638,\\n\", \"      \\\"y\\\"; 1807.4703594352652\\n\", \"    }\\n\", \"  ],\\n\", \"  \\\"vanishingPointAxes\\\"; [\\n\", \"    \\\"xPositive\\\",\\n\", \"    \\\"yPositive\\\",\\n\", \"    \\\"zPositive\\\"\\n\", \"  ],\\n\", \"  \\\"relativeFocalLength\\\"; 1.8716593429474995,\\n\", \"  \\\"imageWidth\\\"; 5000,\\n\", \"  \\\"imageHeight\\\"; 3214\\n\", \"}\"]"
      
      
      
      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file

      Thanks, but I still get the Nil result even after removing the "Return 0".
      I even get it when running your code.

      For now I'm just experimenting with this part so there is no other code.

      The line I'm testing with looks like this:

      
          "x"; 3.4919929866069115,
      
      
      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file

      Next question.
      This is the code I'm experimenting with:

      
      @settings = []
      
      def load_file(file_path, status)
        @filepath = UI.openpanel("Open File", "c;/", "TXT|*.txt||")
        @settings = File.readlines(@filepath)
        return 0   # Success
      end
      
      load_file(@filepath, true)
      
      puts @settings[2].split(' ')[1].to_f
      
      

      After loading the file I managed to get the number as a float but after running this I also get a:

      
      3.4919929866069115 #This is a number I want to read. So this is fine.
      "Nil result (no result returned or run failed)" #Why do I get this?
      
      
      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Reading numbers from external text file

      Thanks. Ill try with this.

      posted in Developers' Forum
      PixeroP
      Pixero
    • Reading numbers from external text file

      Can someone shed some light on how to read from an external text file and finding the relevant data?
      I have a txt file that originally is a json file and has some stuff that is not needed to read so how do I find the parts I want to read?

      Can you tell the script to read from certain lines?
      How do you cope with lines like these?

            "x"; -0.6789975732998361,
            "y"; 0.0008515437495198585
      

      If I know that for example line 66 will always be this: "x": (and some float) -0.6789975732998361, how do I skip the:

      "x";
      

      and the final comma?

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Skimp - Ultimate Polygon Reducer and Importer

      @whaat said:

      I am glad you like the speed of the plugin! You are right that the import speed is extremely quick compared to other solutions.

      Would it be possible to make a copy and paste plugin with this speed as well?

      @whaat said:

      You can install in on up to two PCs that you own yourself, as long as they are not used simultaneously.

      Great!

      @whaat said:

      Regarding non-subscription...I can't promise anything right now, but we are definitely listening to feedback about this issue.
      Can you suggest a price for the hypothetical non-subscription version that you think reflects the value that Skimp can provide to professional SketchUp users?

      I don't know what you would charge for a non subscription version but I don't like the idea of renting software and pay indefinitely for them in order to have them work. I prefer to pay once and if there is a new version with enough features added I would pay for the next version number.
      I believe that is a better deal for the customer.
      I also believe that is a better incentive for developers to make enhancements to software than with a subscription.

      posted in Extensions & Applications Discussions
      PixeroP
      Pixero
    • RE: Skimp - Ultimate Polygon Reducer and Importer

      Downloaded the demo and wow it's fast on import. Don't know how you do that?
      Any chance for a "copy and paste" plugin with that speed?

      A question.
      If I purchase, how many PCs can I install it on?
      I can't find any info on that.
      I'm hoping I can have it on my work PC and my home laptop.
      Any chance for a non subscription version?

      posted in Extensions & Applications Discussions
      PixeroP
      Pixero
    • Input field for code/formula

      I'm looking for info on how to have a user input field where I can write a formula like this:
      Math::cos(i/(nw-1).to_f*1*Math::PI/1.5)*s/5+Math::sin(j/(nw-1).to_f*1*Math::PI)*s/5

      Is it possible?

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Rendered Walkthrough

      Several years ago I rendered a animation with Vray 1.5 on one PC.
      I believe rendering took 4-5 weeks 24/7.
      I would NOT do it like that again. 😆
      With Enscape I rendered a 4 minutes animation in less than an hour.

      posted in V-Ray
      PixeroP
      Pixero
    • RE: Iterate through nested groups/components to get edges

      Thank you. That works as I wanted.

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Iterate through nested groups/components to get edges

      This is a screenshot after running your code.
      As you can see the inner components and groups are also selected.

      Skärmklipp.JPG

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Iterate through nested groups/components to get edges

      This is just a start of a script and one thing I want to do is to hide all the edges in nested groups and components all the way down.
      Selecting is just to see if it works.

      I ran your code but it also selecting the sub groups and components.

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: Iterate through nested groups/components to get edges

      A little further but still not working...
      I have attached a simple test scene but only the "free" edges in the first level gets selected.

      mod = Sketchup.active_model
      sel = mod.selection
      ent = mod.active_entities
      edges = [] 
              
      Sketchup.active_model.selection.each{|e|
          if e.is_a?(Sketchup;;Edge) #This works
            edges << e 
            
          elsif e.is_a?(Sketchup;;Group)
            e.entities.each{|edge|
              next unless edge.is_a?(Sketchup;;Edge)      
              edges << edge 
              }
            
           elsif e.is_a?(Sketchup;;ComponentInstance)
              e.definition.entities.each{|edge|
              next unless edge.is_a?(Sketchup;;Edge)      
              edges << edge       
              }        
           end
      }
      sel.clear
      sel.add(edges)
      

      Testscene

      posted in Developers' Forum
      PixeroP
      Pixero
    • Iterate through nested groups/components to get edges

      I want to get all edges from a selection of one or several nested groups or components.
      How?

      posted in Developers' Forum
      PixeroP
      Pixero
    • RE: [Plugin] ReGlue

      Maybe Fredotools Move along could be helpful?

      posted in Plugins
      PixeroP
      Pixero
    • RE: 'un' divide a line

      There is also a Weld plugin.

      posted in Newbie Forum
      PixeroP
      Pixero
    • 1 / 1