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

    Posts

    Recent Best Controversial
    • RE: How detect that a file is locked by another app?

      In that case I would write it like this. You might rescue StandardError also, but rescuing Exception is too broad. You generally want to rescue exceptions starting with the most-specific and work up to the least-specific.

      [1] https://www.google.com/search?q=ruby+rescue+exception%26amp;ie=utf-8%26amp;oe=utf-8

      
      def locked?(filename)
         locked = false
         begin
            file = File.open(filename, "w")
         rescue Errno;;EACCES => error
            locked = true
         ensure
            file.close if file
         end
         return locked
      end
      
      if $0 == __FILE__
         p locked?("test.txt")
      end
      
      
      
      posted in Developers' Forum
      J
      Jim
    • RE: How detect that a file is locked by another app?

      Did you try something like File.writable?("file")?

      http://ruby-doc.org/core-2.0.0/File.html#method-c-writable-3F

      posted in Developers' Forum
      J
      Jim
    • RE: Error message : 'reference to deleted Entities'

      Wild guess - he started a New model and so the @entities variable now refers to an invalid collection.

      posted in Developers' Forum
      J
      Jim
    • RE: SketchUp Debugging for Notepad++

      @ying2014 said:

      hello ,jim
      I use Press F5 to starting Sketchup

      Which version of SketchUp is being launched? Is the file "SURubyDebugger.dll" located in the correct folder (as in the image for SketchUp 16?)

      2016-04_383.jpg

      Does SketchUp start completely, or does it freeze? When started with the debug server, SketchUp will appear to freeze while it is waiting for a "start" or "continue" command from Notepad++.

      Is you firewall set to allow connections to SketchUp?

      posted in Developers' Forum
      J
      Jim
    • RE: SketchUp Debugging for Notepad++

      Here is a link to Windows socket errors.

      @unknownuser said:

      10061 Connection refused.

      No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running.
      

      How are you starting SketchUp?

      posted in Developers' Forum
      J
      Jim
    • RE: SketchUp Debugging for Notepad++

      It looks like SketchUp is not running the debug server. Start SketchUp from Notepad++ by pressing the F5 key. This launches SketchUp using this command line:

      Sketchup.exe -rdebug "ide port=1234"

      If you need to change which version of SketchUp, or the location of SketchUp then edit the "shortcuts.xml" file in the NPP folder.

      SketchUp must be started with the debug server enabled before pressing the SketchUp icon from the editor.

      Again, this debugger is never going to work well because of limitations in PythonScript for Notepad++ and in the SketchUp debug server.

      I have tried to fix your error. Extract the file "sudb.py" and replace it in the "plugins\Config\PythonScript\scripts" folder.


      sudb.zip

      posted in Developers' Forum
      J
      Jim
    • RE: SketchUp Debugging for Notepad++

      You can try it by downloading this file.

      Extract the .zip and start Notepad++ by clicking the notepad++.exe file inside.

      Open a Ruby extension to debug. Press F5 to start SketchUp in Debug mode.

      Press the SketchUp Icon in the toolbar - this will start SketchUp and add a new margin in the editor - click on the margin to set breakpoints.

      posted in Developers' Forum
      J
      Jim
    • RE: 3D PDF Importer

      I'm not sure. The actual format of the 3D data is U3D. The Wikipedia page lists some software that can handle U3d. I'm not sure how to extact the U3D from the .pdf.

      If you open the .pdf in a text editor, maybe you can search for the 3D data, select it and save it to a separate file. Then try to open it in Meshlab.

      posted in SketchUp Feature Requests
      J
      Jim
    • RE: SketchUp Debugging for Notepad++

      @ying2014 said:

      I have a question,the notepad++ v6.6.2.is old ,how can I use the script for my notepad

      Hi Ying,

      I haven't tried it in years. This was more a proof-of-concept than a finished plugin. I was disappointed with the poor integration of the plugin with the Notepad++ user interface. The plugin is written in Python and uses the PythonScript plugin for Notepad++.

      I have just now been trying to get this to work on version 6.9.1 but so far have not had success getting Python Script to work.

      posted in Developers' Forum
      J
      Jim
    • RE: Request - select parallel edges

      Right-click a edge and click "Select Lines Parallel"


      jf_select_parallel_lines.rb

      posted in Plugins
      J
      Jim
    • RE: [solved][question] Hungarian speaking member?

      Maybe try this forum: http://sketchucation.com/forums/viewforum.php?f=50

      posted in Plugins
      J
      Jim
    • RE: Custom tools or alternatives for holding down keys

      Do you know about Windows Sticky Keys?

      Google Search

      favicon

      (www.google.com)

      In Windows 10, go to Settings > Ease of Access> Keyboard for several more options.

      posted in SketchUp Discussions
      J
      Jim
    • RE: Size matters

      10K isn't much. It's probably the embedded thumbnail image changing on each save. You can disable it in the Model Info > File dialog.

      You can miminizse the thumbnail size by pointing the camera off into blank space then save the file. That is, if you don't need the thumbnail preview.

      posted in SketchUp Discussions
      J
      Jim
    • RE: Convert Layer Pointer to Layer Name, How?

      Your code is not correct - look at my example more carefully. Layer objects have names. A Layer's name is represented as a String.

      posted in Developers' Forum
      J
      Jim
    • RE: Convert Layer Pointer to Layer Name, How?

      You're so close.

      
      Sketchup.active_model.selection.each do |entity| 
        if entity.layer.name == "Some Layer name"
          entity.material = "Red"
        end
      end
      

      What you were seeing is the representation of a Layer object. Layer objects have these methods.

      Also note the comparison operator in Ruby is == and not =

      posted in Developers' Forum
      J
      Jim
    • RE: Arrange Trays in 2016

      posted in SketchUp Discussions
      J
      Jim
    • RE: Cannot get C extensions to run in Sketchup

      You will want to check out this Github repository[1]

      I hope someone who knows better will correct me, but it is my current understanding that you will need Visual Studio 2010 in order to build compatible .dll files for SketchUp plugins on Windows.

      [1] https://github.com/SketchUp/ruby-c-extension-examples

      posted in Developers' Forum
      J
      Jim
    • RE: Arrange Trays in 2016

      If you pin them, you can drag the tabs at the bottom to order them. Once unpinned, they will be arranged.

      posted in SketchUp Discussions
      J
      Jim
    • RE: Trays in Sketchup 2016

      I would like the tabs to be at the top of the Tray instead of the bottom. It's just where my mouse naturally wants to go.

      posted in SketchUp Discussions
      J
      Jim
    • RE: Dynamic Component Len values break if you inc. a subcompon.

      Hi Nate - Can you post a small example model?

      posted in Dynamic Components
      J
      Jim
    • 1 / 1