Unit inputs limitation in older plugin
-
Hi,
I have downloaded older plugin from Ruby Depot,"Geodesic_Sketchup.rb",
but input for radius are in inch only.
Converting mm to inch, like decimal number is not accepted by plugin.
Any possibility to add option for mm, or to use sketchup units?
(if plugin can be modified ,depend of license)Thank you in advance for any help/advice.
-
Here you go. (NB the SCF forum has converted ":octahedron" into ctahedron)
Open the Geodesic_SketchUp.rb script in a text editor and replace the lines:
def self.create( frequency = nil, primitive = :open_mouth:ctahedron, radius = 36 ) if !frequency prompts = [ 'Primitive:', 'Radius (in "):', 'Subdivisions:' ] values = [ primitive.to_s, radius, 2 ] primitive_types = ['tetrahedron|octahedron|icosahedron'] results = inputbox prompts, values, primitive_types, 'Create Geodesic' return unless results primitive, radius, frequency = results primitive = primitive.to_sym end
with this :
def self.create( frequency = nil, primitive = :open_mouth:ctahedron, radius = "36" ) if !frequency prompts = [ 'Primitive:', 'Radius (in "):', 'Subdivisions:' ] values = [ primitive.to_s, radius, 2 ] primitive_types = ['tetrahedron|octahedron|icosahedron'] results = inputbox prompts, values, primitive_types, 'Create Geodesic' return unless results primitive, radius, frequency = results primitive = primitive.to_sym radius = Sketchup.parse_length(radius.to_s) end
Save it and restart Sketchup.
Adam
-
Thank you Adam,
I appreciate your help and very fast replay.
Work as it need.
Thanks again
Advertisement