Thanks - I will see if someone will help test this on a Mac once I get closer to releasing the StairMaker plugin.
Posts made by Garry K
-
RE: Web dialog on a Mac
-
RE: Web dialog fractions conversion
Thanks Jolran - this is helpful. I can perhaps add math expression parsing at a later date!
-
RE: Web dialog fractions conversion
I'm on a different wave length here.
If you have a Sketchup inputbox that has a length.
The model is in millimeters and use precision of 0.001 just because.Now the user enters 2 1/2" into the input box ( they will never understand that you need to escape the double quote.
It comes out as 2.500mm
This is NOT as expected - regardless.
I know myself that I work mostly in millimeters but feel quite at home going back and forth. All the other built in conversions work just fine. Just not this one.
Furthermore - my experience in CAD goes back to DOS. I allow my users ( when I code in C++ ) to enter inches when in millimeters and visa versa. Additionally I allow users to enter mathematical expressions that I evaluate such as:
in milimetes
(905 - 20) / 5
which evaluates as 177mmIf 95% of logical data entry works - and 5% doesn't - users will naturally tend to see that as a bug.
But not to worry as I have a work around - but not for Sketchup inputbox as we don't get to see what the user entered.
-
RE: Web dialog on a Mac
I added this line immediately after <head> and also tried it immediately after <html>
I tried it set to "yes" and set to "no with Windows and did not see any difference.There is a <style> section prior to <head>
When I put the line immediately after <style type="text/css"> then the background color for the body failed to apply regardless if I set content to "yes" or to "no"So I'm not sure exactly what this metatag is suppose to do. I'm not sure where the tag should go ( although I did read a microsoft page where they placed it immediately after <head>
Also - what will it do with Safari? Did you suggest it because the margins are different with safari?
-
RE: Curved Staircases
I have considered that as a possible solution; however, it would be beneficial to have all the configurations on one form - thus the web dialog.
I have now built the parsing and conversion routines and have found a bug in Sketchup's conversion routines. This also affects Sketchup's input box when inputing fractional inches such as '2 1/2"' and using a model setup in millimeters.
http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=55722
I have a fix that works with the web dialog box.
-
RE: Web dialog fractions conversion
After further testing it appears that this is the only conversion that fails ( I'm currently only interested in mm and inches )
I have tested Version 7,8 and 2013 and all give the same results.
I have also tested Sketchup's input box and it also gives the same results.def get_value( text )
tmp = text.to_lif ( @@metric == true && text.index( '/' ) != nil )
val = ( ( tmp * 25.4 ).to_s + '"' ).to_l
else
val = tmp
endputs val
return val
end -
Web dialog fractions conversion
My model is set to millimeters 0.001 precision.
Using a web dialog I enter the following values and use text.to_l to convert
These are as expected
- 400 ends up as 400.000mm
- 300mm ends up as 300.000mm
- 16" ends up as 406.400mm
- 3 7/8 ends up as 3.875mm This one is suspicious
But then this happens
- 2 1/2" ends up as 2.500mm
Is this a bug or am I doing something wrong?
I suppose that I could check for '/' and then treat and if found multiply the result by
25.4 if metric. It appears that I will have to do some testing to see if there are any other conversion issues. -
RE: Web dialog on a Mac
One difference that I see is with margin.
margin: 2px works on Windows = but it appears that the margin is larger in Safari.Perhaps the margin is simply ignored with Safari.
The other difference that I see is the check box. I set width to 120px, the same for everything. It centers in Windows and left justifies with Safari.
Is this the same for all MAC's ???
-
RE: Web dialog on a Mac
I hear you. If you change the first line of the function to this does it work correctly?
dlg = UI::WebDialog.new( "Stair Measurements", false, "StairMaker_Web_Dialog", 570, 452, 0, 0, true );
-
RE: Web dialog on a Mac
Yes - that is what I meant.
Pre-setting the size would help on Windows for the first time it is run. But after that the window uses the last known size and position that the user set it to.
Does it work differently on the MAC?
-
RE: Web dialog on a Mac
Thanks
I can easily add that.
When you clicked "Ok" button did you get a list of Control Id's and values?
-
RE: Web dialog on a Mac
I have also been experimenting with web dialogs. This works with Windows 7 and sketchup 7,8 and 2013.
Hopefully someone with a MAC can try this and see if it works in Safari.
I have Chrome, IE11 and Firefox installed. The code works with these Browsers but only if I rem out the line that references sk
This file adds a menu Item under Plugins called "Web Dialog Test"
-
RE: Curved Staircases
I've added a couple more stair configurations to StairMaker. An Open Riser choice and a Rail Style.
The input box is getting pretty tall and there are more options to come. Once the input box gets to big I will have to either split it up into 2 or more input boxes or I can go with a web dialog box where I have way more control.
Here is a the tall StairMaker input box and also a web dialog box. The web dialog box is my preferred way of doing things but there are advantages to each.
web dialog box:
- It is easy to organize the inputs into various sections
- You can have check boxes and radio boxes
- Unfortunately there isn't an easy way to allow a mix of inputs - some metric and some imperial.
- At this stage I would only support decimal inputs for only metric or only imperial. No fractions
Sketchup input box
- A lot less coding using the built in input box.
- You can mix inputs by using mm or "
- you can use fractions for imperial
- At some point the input box will become too large and will have to be broken into several inputs.
What do you guys think? Do you like the web dialog or the built in Sketchup Input Box?
I'd love to have a vote on this - but I don't know how to set that up.
-
RE: Get MAC Address
This link makes references to it
http://stackoverflow.com/questions/690151/getting-output-of-system-calls-in-ruby
-
RE: Get MAC Address
I'm reading that back ticks ` won't work in OSX and that using back ticks in windows is not as secure as the following
puts %x[ipconfig /all]
-
RE: Get MAC Address
always something new to learn !!!
this works in windows. It would be nice if it would run quitetly.
puts
ipconfig /all
-
RE: Get MAC Address
Here is what I can do so far.
and if windows I can parse the output
but with osx I don't know what I should expect
` platform = RUBY_PLATFORM.downcase
if ( platform.include?( "win" ))
windows = true
cmd = 'ipconfig /all'
else
windows = false
cmd = 'ifconfig'
endthen for windows I can redirect the output of ipconfig
null = test(?e, '/dev/null') ? '/dev/null' : 'NUL'
lines = IO.popen("#{ cmd } 2> #{ null }"){|fd| fd.readlines}
puts lines`some of the output for windows
So the Ethernet adapter is usually soldered on the mother board these days and should be reasonably safe.
parse out Physical Address is the MAC Address for the Ethernet` Ethernet adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Atheros L1 Gigabit Ethernet 10/100/1000Base-T Controller
Physical Address. . . . . . . . . : 00-1D-60-0D-80-87
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes` -
Get MAC Address
Is there an OS independent way to get the MAC Address of the client within a sketchup script and without having to install additional software on the client's machine.
I'd like to tie in some hardware id of some sort to a web site registration for that computer and user.
-
RE: Communication best practice
Unfortunately that means I will have to purchase a Mac.
I do have C++Builder XE4 that will compile for Windows or OSX with a single code base. But licensing requires that you connect to a real Mac before you can compile for OSX.
The good part is there is unlimited deployment without license.
Is there no other sensible way for sketchup to connect to an external website?
-
Communication best practice
What is the best practice for communicating from a plugin to a web server?
I am interested in having a plugin temporarily connect to a web site and check some information in a database then disconnect.
Currently my plugin works on SU7, SU8 and SU2013 but has only been tested under Windows 7 and Windows 8. I am hoping that the plugin can also run under OSX
I could use Sockets or I could build a rest or soap Web Service.
I've heard that OSX includes a full Ruby install whereas Windows does not.