sketchucation logo sketchucation
    • Login
    1. Home
    2. Jim
    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!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 406
    • Posts 4,216
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [Plugin] Add Layer [1.1.0]

      Are you hitting the Apply button?

      posted in Plugins
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      @driven said:

      isn't it faster to test for true

      
      > def self.decimal_separator
      >     [1.1].length ==  2  ?  ',' | '.'
      > end#def
      

      john

      Maybe I do not know off-hand. This is code you would run at most one time in a plugin to determine which separator to use so it isn't terribly important to optimize.

      The code that actually performs the conversion may need optimized especially if there are many conversions to do.

      posted in Developers' Forum
      J
      Jim
    • RE: [Plugin] 3D Parametric Shapes - makes placeable components

      @johnwmcc said:

      I'll see if I can work out how to convert the Group into a Component without losing the parametric properties of the Shape. I think I tried it a while ago, but if I remember correctly, the parametric properties don't survive the conversion from Group to Component, and I couldn't (at the time, anyway) see how to fix that.

      It won't be soon, though - I haven't much time spare from other non-SU projects at the moment.

      You wouldn't convert the Group to a Component. You would add a ComponentDefinition then add the geometry to the definition. Then call Model.place_component with the new definition.

      parametric.rb will work with the instances. All instances will be updated when edited. I made a quick example using someone's stringer-drawing code.

      parametric-stringer.gif


      parametric-stringer.rb

      posted in Plugins
      J
      Jim
    • RE: SketchUp 2015 is 64bit

      You can install and use differing versions of SketchUp on a computer. You can not install both the 32-bit and 64-bit version of SketchUp 2015. So if you are using a version earlier than 2015, you can install 2015 64-bit without affecting your current version.

      posted in SketchUp Discussions
      J
      Jim
    • RE: [Plugin] 3D Parametric Shapes - makes placeable components

      What if you used Components instead of Groups, then simply attached the Component to the mouse cursor for placement using Model#place_component()?

      posted in Plugins
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      A begin..rescue clause can be used to test this. For a one-off:

      
      len = begin
        "1,2".to_l
      rescue
        "1.2".to_l
      end
      
      p len
      
      

      But obviously it would be better to write a method to handle this for more cases.

      posted in Developers' Forum
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      @jolran said:

      edit: puts "1.0".to_l don't work(for me) on 2014 either. But it never has so I'm suprised you made it work.

      Really? Does "1,0".to_l work?

      posted in Developers' Forum
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      @jolran said:

      How bout .to_f.to_l ?

      Careful..

      "1".to_l ==> 1.000000cm

      "1".to_f.to_l ==> 2.540000cm

      posted in Developers' Forum
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      It is curious, and there is a lot going on behind the scenes. This document explains some of what is going on.

      You are relying on the WebDialog (and HTML specifications) to put together your form data. The form data is sent to the Ruby script as one string. There is a limit to the length the string may be. The browser replaces spaces with + signs and and possibly other substitutions. Form data is appended to the string in order they appear in the form with a & and a name/value pair separated by =.

      2014-11_150.png

      The problems start if you need to pass any of the symbols +, space, &, or = from the web dialog form to your Ruby script. You will find the form data difficult if not impossible to parse on the Ruby side. Here is a contrived example:
      2014-11_151.png

      Because of these limitations, most folks have adopted some alternative method of data serialization to encode the form data such as JSON or Base 64 encoding, all of which require some use of JavaScript to process the form data prior to sending it to the Ruby script.

      posted in Developers' Forum
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      How? Are you passing it as a single string?

      What I have done in the past is split values on the JavaScript side, trim leading and trailing whitespace, then join the values together using '|' character. Commas do not make good value separators because some languages use commas where we would use a decimal point in a number. Then pass the string to Ruby and split the values on the '|'.

      posted in Developers' Forum
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      What I mean is, are you encoding the string before passing it to Ruby? How, specifically? Have you inspected the string before passing it to Ruby? It looks like the spaces are being encoded to plus signs, which is not an uncommon way to encode web data.

      posted in Developers' Forum
      J
      Jim
    • RE: WebDialog parameters passed to callback cause .to_l error

      How are you passing the values to the Ruby code?

      posted in Developers' Forum
      J
      Jim
    • RE: C SDK - how to export a model to a dwg file

      With the C SDK you are not required to actually run SketchUp as is the case with the Ruby API. Maybe he needs a command-line or stand-alone executable that does not require SketchUp to be running, or even to be installed.

      posted in Developers' Forum
      J
      Jim
    • RE: Shapes, torus, dome, etc. Not for 2015?

      @ntxdave said:

      Again, my biggest complaint (if you want to call it that) is that you cannot specify where you want the shape drawn but as I said before, since it is placed in your model as a group it is easy to move.

      It would not be difficult to change the plugin so that the generated shape automatically attaches to the cursor for placement. The shapes would just need to be created as Components instead of Groups.

      Maybe make a feature request in the plugin thread or on github.

      posted in SketchUp Discussions
      J
      Jim
    • RE: Shapes, torus, dome, etc. Not for 2015?

      How are people supposed to know which is the right version?

      posted in SketchUp Discussions
      J
      Jim
    • RE: Shapes, torus, dome, etc. Not for 2015?

      Install the Shapes plugin from the Extension Warehouse.

      The version in the Plugins Store is obsolete.

      posted in SketchUp Discussions
      J
      Jim
    • RE: I don't understand dynamic component scaling

      @pcmoor said:

      You have a misunderstanding of the scale tool, the scale is changed by the factor you enter, if you move with scale tool then enter 2, the result would be 2 times the previous size, or 0.5 would be half.

      if you made a unit size, say 1 inch, then entering 25.75 then it would be 25.75 inches,

      or say 1000mm then entering 3.45 makes the side 3450mm

      The Scale tool has always allowed scaling to dimensional values in the Measurements box. In your example, you could also enter 2" which would result in the object being "scaled" to exactly 2"

      It's a bug in DC's that they are not redrawn when using the Measurements box.

      Attention Required! | Cloudflare

      favicon

      (help.sketchup.com)

      posted in Dynamic Components
      J
      Jim
    • RE: Draw parallel line, distance=11

      Do you have the Ruby Console open while testing your code? It will show you errors that occur.

      An Edge is not something that an be pushpulled. Faces can be. Unfortunately, using find_faces does not give you a list of found faces. So you need to find the created face yourself. The code might look something like this:

      face = ents.grep(Sketchup;;Face).first
      
      if face
        face.pushpull(tread_thickness)
      end
      
      posted in Developers' Forum
      J
      Jim
    • RE: Plugin Location in Windows 7

      Hidden or not you can enter %APPDATA% in the file explorer address bar.

      posted in SketchUp Discussions
      J
      Jim
    • RE: [Plugin] SketchUcation Tools 2.6.1

      How are you determining if a folder has "FULL Read/Write security permissions?"

      posted in Plugins
      J
      Jim
    • 1
    • 2
    • 12
    • 13
    • 14
    • 15
    • 16
    • 210
    • 211
    • 14 / 211