šŸ¢ PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • UI.savepanel & SU6

    2
    0 Votes
    2 Posts
    202 Views
    thomthomT
    UI.savepanel "Test", "C:/Test/", "test.tmp" This also returns nil in SU6.
  • Layer color by ruby-code?

    16
    0 Votes
    16 Posts
    896 Views
    A
    @thomthom said: I see an issue with this method: It has multiple .start_operation and commit_operation inside the code flow - which will interfere with any start_operation you started yourself - since SU doesn't handle nested start_operations: ` model.start_operation ... layer.color = 'red' # this breaks the undo stack ... model.commit_operation` Though, it is not related to the error you got. Sorry, I donĀ“t understand that. I tried now that: def layer_color model = Sketchup.active_model layer = model.layers.add "Test_Layer" layer.color = [255,255,255] end if( not file_loaded?("test.rb") ) plugins_menu = UI.menu("Plugins") plugins_menu.add_item("LayerColor") {layer_color} end #----------------------------------------------------------------------------- file_loaded("test.rb") That works without error - but the new layer has the color 102,68,0 and not 255,255,255!!!??? I test that: def layer_color model = Sketchup.active_model layer = model.layers.add "Test_Layer" layer.color = "Blue" end if( not file_loaded?("test.rb") ) plugins_menu = UI.menu("Plugins") plugins_menu.add_item("LayerColor") {layer_color} end #----------------------------------------------------------------------------- file_loaded("test.rb") The same result like before - Color 102,68,0 instead of blue Than I test that: def layer_color model = Sketchup.active_model my_mat = materials.add "Ahorn" my_mat.texture = "O;\\Sketchup\\Mat\\Ahorn.jpg" layer = model.layers.add "Test_Layer" layer.color = my_mat end if( not file_loaded?("test.rb") ) plugins_menu = UI.menu("Plugins") plugins_menu.add_item("LayerColor") {layer_color} end #----------------------------------------------------------------------------- file_loaded("test.rb") There was no error but also no layer!!
  • Help with grouping groups

    17
    0 Votes
    17 Posts
    711 Views
    thomthomT
    It is safer in any case - as you don't risk your edges/faces merging with stuff it should not merge with.
  • Trapping error messages

    10
    0 Votes
    10 Posts
    288 Views
    TIGT
    Add Sketchup.send_action "showRubyPanel:" into the start of your script just after require 'sketchup.rb' BUT remember to ### it out when you are done!
  • My_progress_bar

    3
    0 Votes
    3 Posts
    207 Views
    honoluludesktopH
    Tom, thanks.
  • Ruby 1.8.6

    13
    0 Votes
    13 Posts
    1k Views
    Dan RathbunD
    Hmmmm.. so when Microsoft stops supporting XP SP3 soon will SU end support as well? What about about when Microsoft only supports 64bit Windows ? (Yes I'm being a bit sarcastic.)
  • Materials vs. Entities in model (screenshot)

    13
    0 Votes
    13 Posts
    561 Views
    TIGT
    There is a reported difference between materials.current on PC and MAC. On a PC it's the currently selected material On a MAC it's the last used material and this ignores what might now be selected IF it's never been used...
  • Writing a config or temp file in Plugins folder

    20
    0 Votes
    20 Posts
    937 Views
    N
    For windows %appdata% ?
  • Alpha in Sketcup::Color

    6
    0 Votes
    6 Posts
    589 Views
    TIGT
    The 'draw' colors are OpenGL standard colors only and seem unconnected to the model.materials - so transparency is not available to them anyway. I think that making the color 'red' say [0,0,0] in the model doesn't affect the color 'red' used in the 'draw' methods. A 'color' has always has an 'alpha' value [but it was never used!]. I think that the 'A' transparency in color [R,G,B,A] is a hangover from a much earlier SUp version where it was planned that you applied a 'color' to a face - so you would then need aplha 'A' for its transparency... BUT when 'materials' [allowing texture-images etc] were introduced they contained the transparency property and thereafter the 'color' only needed to be in RGB. So if you add a value for alpha 'A' to a color it is just ignored in its rendering but remembered in its values: but if you add no value it defaults to 255. The API notes say, "color.alpha=i - NOTE: Though documented historically in the Ruby API, this method has never been implemented." Here's the rub... v7. Sketchup::Color.new('white') Color(255, 255, 255, 255) printf("%#x\n", Sketchup::Color.new('white')) 0xffffff Sketchup::Color.new('white').to_a [255, 255, 255, 255] Sketchup::Color.new('white')**.to_i** 16777215 <<<<<<<<<<<<<<<<<<<<< NOTE Sketchup::Color.new(255, 255, 255) Color(255, 255, 255, 255) Sketchup::Color.new(255, 255, 255, 255) Color(255, 255, 255, 255) Sketchup::Color.new(255, 255, 255, 123) Color(255, 255, 255, 123) printf("%#x\n", **16777215**) <<<<<<<<<<<<<<<<<<<<< NOTE 0xffffff printf("%#x\n", Sketchup::Color.new(255, 255, 255)) <<<<<<<<<<< NOTE 0xffffff printf("%#x\n", Sketchup::Color.new(255, 255, 255, 255)) 0xffffff printf("%#x\n", Sketchup::Color.new(255, 255, 255, **123**)) 0xffffff Sketchup::Color.new(255, 255, 255, 123).to_i 16777215 <<<<<<<<<<<<<<<<<<<<< NOTE [the unused alpha is ignored in the i/hex value] v8. Sketchup::Color.new('white') Color(255, 255, 255, 255) printf("%#x\n", Sketchup::Color.new('white')) 0xffffffff Sketchup::Color.new('white').to_a [255, 255, 255, 255] Sketchup::Color.new('white')**.to_i** 4294967295 <<<<<<<<<<<<<<<<<<<<< NOTE Sketchup::Color.new(255, 255, 255) Color(255, 255, 255, 255) Sketchup::Color.new(255, 255, 255, 123) Color(255, 255, 255, 123) printf("%#x\n", **4294967295**) <<<<<<<<<<<<<<<<<<<<< NOTE 0xffffffff printf("%#x\n", Sketchup::Color.new(255, 255, 255)) <<<<<<<<<< NOTE 0xffffffff printf("%#x\n", Sketchup::Color.new(255, 255, 255, 255)) 0xffffffff printf("%#x\n", Sketchup::Color.new(255, 255, 255, **123**)) 0xffffffff Sketchup::Color.new(255, 255, 255, 123).to_i 4294967295 <<<<<<<<<<<<<<<<<<<<< NOTE [AGAIN the unused alpha is ignored in the i/hex value] The 'integer value' of the color is being returned as a different value between v7 and v8 BUT the alpha is actually ignored in BOTH versions - so the alpha issue is therefore a red-herring. In v8 it is now a Bignum so face.material=0xffffffff fails - whereas in v7 it's a [ruby:3hoxppyu]Fixnum[/ruby:3hoxppyu] so [ruby:3hoxppyu]face.material=0xffffff[/ruby:3hoxppyu] works ! Somebody broke 'Color'... I'll lodge a v8 bug-report...
  • Painting a material in a 3D view

    17
    0 Votes
    17 Posts
    1k Views
    Al HartA
    I'll have to look a little closer at the video. (I just looked at it, but I might have to watch harder.) I was quite impressed by the Street View stuff at the Base Camp, but as I remember it, he had to apply the street view texture separately to each face on the building he had created. And he had to stretch and dirstort the image to match the face - so it wasn't an automatic process (or am I missing something @unknownuser said: @unknownuser said: Does PhotoMatch, or 3D street view, or whatever, already wrap an image onto surfaces Is that I said second post See video from 0. 45 minutes and following Also, when you use PhotoMatch for a texture, does it then get shaded? If so I will need to save an unshaded image from SketchUp. (I believe I can do this by turning the sun on for shading, setting Light intensity to 0 and Dark intensity to 100)
  • WebDialog (Mac) - style.visibility in SU6

    8
    0 Votes
    8 Posts
    666 Views
    T
    @thomthom said: with your original code, did you try a typeof test of the flag? just to see what it came across as? I am not JS expert, so I didn't even know that 'typeof' exists . Will check the old code. @thomthom said: did you try without semi-colon? Yep. I didn't help.
  • Drawing real time in sketchup

    3
    0 Votes
    3 Posts
    413 Views
    Y
    Thanks Chris..
  • Coplanar surface tolerance

    8
    0 Votes
    8 Posts
    1k Views
    Chris FullmerC
    @thomthom said: :idea: +1 !
  • Help with Acad generated Dxf file

    8
    0 Votes
    8 Posts
    406 Views
    honoluludesktopH
    Well, I spent the day looking at the way various applications read and write dxf files, as well as the differences between Acad versions. My own Cad program outputs a dxf that is no longer compliant with Acad v 11 (maybe not even since 2000). But fortunately, it hasn't affected my work. I have been writing a SU plugin to modify my Cad2Dxf output in order to improve its performance. As long as I was doing this, I thought I might be able to post a DxfIn for SU-free users, but have discovered that there are too many considerations, requiring rewriting my code to accomplish even a very basic version of this. Good thing for me that my Cad2Dxf is easy to understand. Thanks for the support everyone, hopefully I will finish soon:-)
  • Temporary message box

    7
    0 Votes
    7 Posts
    432 Views
    P
    In the webdialog use this code: <body onLoad="setTimeout('self.close()',5000)"> with 5000 being the amount of milliseconds that the message is shown Haven't tried but should work
  • Transformation scale

    2
    0 Votes
    2 Posts
    286 Views
    P
    ok i've found it here: http://forums.sketchucation.com/viewtopic.php?f=180&t=24947&p=213942 use .transform! instead of .transformation .transform adds the specified transformation to the already existing one .transformation replaces the current transformation (like in: will put the object back to 0,0,0)
  • Camera - FOV = H unchecked

    6
    0 Votes
    6 Posts
    518 Views
    thomthomT
    Also throw in a mention of the camera shifting that occur at times when using camera.aspect_ratio...
  • The case of the missing data

    5
    0 Votes
    5 Posts
    259 Views
    honoluludesktopH
    Thanks, they both work:-) Ended up fixing my app in a couple of places. Wounder how I mucked the data:-(
  • SKSocket connected with my socket server

    4
    0 Votes
    4 Posts
    777 Views
    M
    Hello, Thanks for your answer and your way to send datas through a Webdialog using ajax. For the SKSocket class, I have asked to Scott (a Googler) at the Basecamp and the response is this class as been developed for an internal test but it's not fully implemented and fully working so don't use it if you want to be sure your code will run correctly. Regarding my needs : Now I just want to handles events from another windows software directly inside Ruby so I'll open another topic in the forum.
  • SU8 - new api

    16
    0 Votes
    16 Posts
    1k Views
    thomthomT
    The release notes is all I've found... which even appear to be incorrect when it comes to the selection observers.

Advertisement