Are you hitting the Apply button?
Posts
-
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#defjohn
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.
-
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.

-
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.
-
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()?
-
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 lenBut obviously it would be better to write a method to handle this for more cases.
-
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_lwork? -
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=.
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:

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.
-
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 '|'.
-
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.
-
RE: WebDialog parameters passed to callback cause .to_l error
How are you passing the values to the Ruby code?
-
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.
-
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.
-
RE: Shapes, torus, dome, etc. Not for 2015?
How are people supposed to know which is the right version?
-
RE: Shapes, torus, dome, etc. Not for 2015?
Install the Shapes plugin from the Extension Warehouse.
The version in the Plugins Store is obsolete.
-
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.
-
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 -
RE: Plugin Location in Windows 7
Hidden or not you can enter
%APPDATA%in the file explorer address bar. -
RE: [Plugin] SketchUcation Tools 2.6.1
How are you determining if a folder has "FULL Read/Write security permissions?"