[Plugin] Make Fur v.2.1.0(20140323)
-
This whole thing makes no sense...
def fur_dialog_ini unitoptions = Hash.new Sketchup.active_model.options["UnitsOptions"].each{|key ,val| unitoptions[key] = val } Sketchup.active_model.options["UnitsOptions"]["LengthFormat"] = 0 if unitoptions["LengthFormat"] != 0 Sketchup.active_model.options["UnitsOptions"]["LengthPrecision"] = 1 if unitoptions["LengthPrecision"] == 0 @fur_units_metric = false lunit = unitoptions["LengthUnit"] @fur_units_metric = true if lunit >= 2 lprec = Sketchup.active_model.options["UnitsOptions"]["LengthPrecision"] @decimal_sep = 1.2.to_l.to_s.match(/\d(\D)\d/)[1] @delim = "," @delim = ";" if @decimal_sep == ',' unitoptions.each{|key ,val| Sketchup.active_model.options["UnitsOptions"][key] = val } end
You create an hash to store model UnitOptions, then change them and then restore the original values...?
-
From what I could understand, that method could be condensed to:
def fur_dialog_ini units = Sketchup.active_model.options["UnitsOptions"]["LengthUnit"] @fur_units_metric = (units >= 2) # true if units are 2 or greater @decimal_sep = 1.2.to_l.to_s.match(/\d(\D)\d/)[1] @delim = (@decimal_sep == ',') ? ";" ; "," end
-
Hmmm,
When LengthFormat is Architectural or LengthPrecision = 0,
"1.2.to_l.to_s.match(/\d(\D)\d/)[1]" return error.Is that problem excluding this?
-
Ah, yes. I see the problem. ..hm... this needs some more thinking...
-
Ok - turns out that you can't trust the SU methods to extract the decimal separator as model settings affects the length to string formatting. (Should have thought of that. )
Looking at there seems to mostly be just comma or period as decimal separator. At least if you make that assumption it will cover most.
So here is an alternative:
def get_decimal_separator # If this raises an error the decimal separator is not '.' '1.2'.to_l return '.' rescue return ',' end def fur_dialog_ini @decimal_sep ||= get_decimal_separator @delim ||= (@decimal_sep == ',') ? ";" ; "," end
This snippet makes some assumptions:
Only comma or period as decimal separator.
If the separator is a period then comma is used as list separator.
If the separator is a comma then ; is used as list separator.The method is working out the decimal separator is by trial and error.
-
wow... keep it coming. Thanks.
-
I thought of a very cool thing to do with this plugin... those xmas stuff that you put on Xmas trees, you know?? Well, actually this plugin also makes it easy to do the Xmas tree itself.
I am talking about this thing that goes around the tree
-
Is v1.3e working for others?
Nothing happens when i select it?
-
I did have some issues as well, didn't check the console though. I had a model I'd saved using the previous "make fur" revision and was attempting to use the plugin, nothing happened - dialogue wouldn't open. I opened a "new" scene (File > New) and then the plugin worked.
-
I update to version 1.3g.
Vector parameter split to 3 parameter each.
and I change preset file.
I think this vesion has problem yet.For the time being, It going on my sketchup.
But very difficult for me to convert units.
and so tired.Thanks.
-
I appears to work. I'll see if I can get some time to have a better look at your script and see if I can help with the units.
-
it seems to work OK now BUT the dialog is getting too tall.
Can't you redo the web-dialog code so that some of the boxes are side-by-side - the XYZ ones could be in a line, so making it 3 input boxes wide, but with each a little narrower would be more manageable ? -
Hi ,all.
I update version 1.3h.
WebDialog becomes smaller.
fix problem about defn for Exporter.Thanks.
-
Thanks - very good...
-
Hi!
The first, incredible plugin!
I had downloaded the plugin version 1.3a and it works fine, i download the last version 1.3h and it don't works, the plugin appears in the Menu Plugins and the InputBox appears too but when I push OK nothing happens. I use Mac with SU 7.1. I have probed the plugin version 1.3h in SU (Windows) too and don't works. What's the problem?Certainly, i have done the plugin's translation to spanish language of the two versions, 1.3a (works) and 1.3h (don't works), if you want i send you them.
Bye!
-
I downloaded 1.3h and I don't see the new dialog, just the old one.
(thanks for the plugin by the way)
-
@oxer said:
Hi!
The first, incredible plugin!
I had downloaded the plugin version 1.3a and it works fine, i download the last version 1.3h and it don't works, the plugin appears in the Menu Plugins and the InputBox appears too but when I push OK nothing happens. I use Mac with SU 7.1. I have probed the plugin version 1.3h in SU (Windows) too and don't works. What's the problem?Certainly, i have done the plugin's translation to spanish language of the two versions, 1.3a (works) and 1.3h (don't works), if you want i send you them.
Bye!
Hi,Oxer.
see "Sketchup--menu--window--model info--Units info".
if you using units like "feet" or "m", and unit precision is too small(like 0).
The parameters in dialog are displayed "0".
It don't work when Length or Rootwidth are 0.
This is auto convert for sketchup settings.
so you should change the settings and should change it to the numerical value excluding 0.
If thisi not solution, please reply.@tallbridgeguy said:
I downloaded 1.3h and I don't see the new dialog, just the old one.
Hi, tallbridgguy.
I do not understand this cause.
I certainly uploaded on this forum.
I think you should clear older ruby files of fur_en from plugins directory.
If thisi not solution, please reply. -
@tallbridgeguy said:
I downloaded 1.3h and I don't see the new dialog, just the old one.
(thanks for the plugin by the way)Sorry ,Older(v1.3g)file remained most below of the first thread.
Now I deleted it.
please download "fur_en_v1.3h(web dialog shorter)". -
@oxer said:
Certainly, i have done the plugin's translation to spanish language of the two versions, 1.3a (works) and 1.3h (don't works), if you want i send you them.
Hi .Oxer.
That's nice idea.
Please send me them.
I will make setting file for translation to other language.
It will override menu names.
Thanks. -
tak2hata
Got it, it was just me being stupid.
Thanks again for the great plugin. I don't how you guys do it.
TBG
Advertisement