[Plugin] Polar line - 20110525

Re: [Plugin] Polar line

Postby Matt666 » Thu Jan 15, 2009 6:16 pm

I don't understand the problem... Again !! Grmbl.
Can you try line below in the ruby console, please ?
Code: Select all
Math.cos(45.degrees)

And these lines
Code: Select all
a = Geom::Point3d.new(12.5,12.5,25.2)
a[0]
a[1]
a[2]

On each line, can you give me the results, please ?
Thank you again for your patience, Edson!
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby Edson » Thu Jan 15, 2009 7:35 pm

is this what you wanted?
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Polar line

Postby thomthom » Fri Jan 16, 2009 12:17 pm

Edson: you wrote 0 = Geom:: and 1 = Geom:: . That's not what he wanted. Just type exactly what he listed.

First:
Code: Select all
a = Geom::Point3d.new(12.5,12.5,25.2)


Then
Code: Select all
a[0]
and so on.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Edson » Fri Jan 16, 2009 12:46 pm

is this it?
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Polar line

Postby thomthom » Fri Jan 16, 2009 12:52 pm

Yes, like that. :)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Fri Jan 16, 2009 12:59 pm

Thank you Edson and Thomthom !
I really really don't understand...

Can someone help me for this bug, please ?
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby thomthom » Fri Jan 16, 2009 2:23 pm

I can have a look on my own Mac when I get home.
Looks very weird. Does PC SU and MacSU use the same Ruby version?

Have you tried placing () around lg * Math.cos(ang) . (just a wild guess)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby thomthom » Fri Jan 16, 2009 3:15 pm

Hey, I notice you use $lg and then lg. Is it suppose to be two different things?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Fri Jan 16, 2009 3:57 pm

Does PC SU and MacSU use the same Ruby version?
I don't know, but I often have problems...

I can have a look on my own Mac when I get home.
Thank you !

Hey, I notice you use $lg and then lg. Is it suppose to be two different things?
I will look in the code... Thank you!
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby thomthom » Fri Jan 16, 2009 5:30 pm

Got it nailed!

It's all down to line 69:
Code: Select all
case Sketchup.active_model.options[0][2]

On my mac it returned nil

Your case switch doesn't account for that value so lg is passed on as a string.
Code: Select all
case Sketchup.active_model.options[0][2]
    when 0;lg = result[0].to_f
    when 1;lg = result[0].to_f.feet
    when 2;lg = result[0].to_f.mm
    when 3;lg = result[0].to_f.cm
    when 4;lg = result[0].to_f.m
end


My fix was to add a default handler for the switch.
Code: Select all
case Sketchup.active_model.options[0][2]
    when 0;lg = result[0].to_f
    when 1;lg = result[0].to_f.feet
    when 2;lg = result[0].to_f.mm
    when 3;lg = result[0].to_f.cm
    when 4;lg = result[0].to_f.m
    else  ;lg = result[0].to_f
end


Not sure why line 69 return nil though, didn't look into that.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Mon Jan 19, 2009 8:37 am

Ok cool !! Thank you for your bug research Thomthom !
I am pretty sure it works if you try this code below
Code: Select all
Sketchup.active_model.options["UnitsOptions"]["LengthUnit"]

can you try it please ?

For "pl" variable, no problem. "$pl" is used to reuse last number entered in the polarline window...
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby thomthom » Mon Jan 19, 2009 2:02 pm

I'll try it and report back.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby thomthom » Mon Jan 19, 2009 6:49 pm

Yes, that worked. :thumb:
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Tue Jan 20, 2009 8:35 am

Thank you Thomthom!
I've updated the first post... Can you try it on Mac please? Thank you!
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby Edson » Tue Jan 20, 2009 11:49 am

matt,

now nothing happens at all. not even the request for the first point appears.
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Polar line

Postby Matt666 » Tue Jan 20, 2009 1:09 pm

:cry: :cry: :cry:
Can you show me the error in the ruby console please?
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby Edson » Tue Jan 20, 2009 1:29 pm

the console window was filled with a lot of stuff. this is the last piece. if you need the rest, let me know.
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Polar line

Postby Matt666 » Tue Jan 20, 2009 3:06 pm

:oops: :oops:
Excuse me Edson... A silly error... Shame on me !

I updated the code...
Sorry !
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby Edson » Tue Jan 20, 2009 5:35 pm

YESSSSSS! it does work!

and thanks, matt, for the great scripts you have been creating. count on me anytime to help you with testing scripts on mac.
0
edson mahfuz, architect | porto alegre • brasil
http://www.mahfuz.arq.br
User avatar
Edson 
Global Moderator
 

Re: [Plugin] Polar line

Postby Matt666 » Wed Jan 21, 2009 8:14 am

:ecstatic: :ecstatic: :ecstatic:
It does work, AT LAST !! Ouf... Thank you for your patience Edson!
and thanks, matt, for the great scripts you have been creating.
Thank you, Edson :oops:
count on me anytime to help you with testing scripts on mac.
Ok, cool! There is also one only script that doesn't work on Mac... I'll try to do smt on it...
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby thomthom » Wed Jan 21, 2009 8:51 am

I got a Mac Mini at disposal on a OSX 10.4 system. Slow as heck, but works to see if it runs.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Wed Jan 21, 2009 10:10 am

Ok, Thank you Thomthom!
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby Matt666 » Wed Jan 21, 2009 1:58 pm

sorry Thomthom, but can you have a Mac look on this script, please?
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby thomthom » Sun Jan 25, 2009 11:31 pm

Matt666 wrote:sorry Thomthom, but can you have a Mac look on this script, please?


Sorry, dude! I completely forgot. I'll see if I can have a look at it tomorrow.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Click Draw » Mon Jan 26, 2009 12:02 am

Hey Matt,
Just installed your script. Good stuff. The icon matches nicely too. Keep'em comin'.
Cheers,
Jeff
0
Have I mentioned how much of a laugh I get out of some of the Signatures on here!

Click Draw 
 

Re: [Plugin] Polar line

Postby pmain68 » Tue May 24, 2011 11:43 pm

Hey ThomThom & Edson,

Any ideas why i get this error when opening SU 8 after installing the polarline script?

Error Loading File polarline.rb
undefined method `file_loaded?' for main:Object

cheers
0

pmain68 
 

Re: [Plugin] Polar line

Postby thomthom » Wed May 25, 2011 7:38 am

That sounds like the file doesn't have require 'sketchup.rb'. A bug that won't be noticed if you have other plugins installed that require 'sketchup.rb'.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Wed May 25, 2011 8:55 am

Hi all!
New version updated. See first post. Thank you Thomthom & pmain68.
0
Frenglish at its best !
My scripts

Matt666 
 

Re: [Plugin] Polar line

Postby thomthom » Wed May 25, 2011 9:13 am

:thumb:

Could you add the date of update in the topic title? (Makes browsing plugins easier if you're looking for updates.)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Polar line

Postby Matt666 » Wed May 25, 2011 9:16 am

Ok.
0
Frenglish at its best !
My scripts

Matt666 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

cron

Who is online

Users browsing this forum: Cristian_Vaca, Driss2020, SandraAfonso and 10 guests

Visit our sponsors: