🏒 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Pause/ Hold script for extra user input

    5
    0 Votes
    5 Posts
    738 Views
    M
    Ok, solved it in another way. Thanks anyway. Matt
  • WebDialog Buttons

    19
    0 Votes
    19 Posts
    779 Views
    thomthomT
    I model the virtual keyboard I type on to code my plugins! The model off course generated with ruby code. Oh what a fine conundrum.
  • Beginner Ruby Problmes

    13
    0 Votes
    13 Posts
    1k Views
    thomthomT
    There are some sticky thread in the Developer section where links to various best-practices is posted.
  • Please help with FILLET Plugin

    11
    0 Votes
    11 Posts
    907 Views
    TIGT
    Here's v5.2 of my 2dToolset, containing the updated 2dFillet - arc segments >=2 <=999 - It could go higher [9999] BUT that is crazy bad!] http://forums.sketchucation.com/viewtopic.php?p=185760#p185760
  • Custom units, can it be done?

    8
    0 Votes
    8 Posts
    951 Views
    L
    Wow, that is really exciting! Looking forward to trying it! And I am sure that it will have several uses beyond shaku, I heard they use a plethora of units in India, otherworldly yet widespread units like the angula purportedly equivalent to eight barleycorns side by side.
  • New translate request?

    4
    0 Votes
    4 Posts
    106 Views
    fredo6F
    Then use p3 = p2.offset p2.vector_to(p1), d This gives the point p3, which at distance d of P2 in the direction of p1 Fredo
  • Finding new rotated 3d coordinate points?

    4
    0 Votes
    4 Posts
    136 Views
    TIGT
    Using group.move!(t) will miss the 'undo stack' [typically used in animations], whereas using group.transform!(t) won't. You can apply a transformation to a 3d point [and vector] too, to make a new reference use pt1new=pt1.transform(t) or pt1.transform!(t) to 'reuse' pt1 which is '!' changed to its matching vertex's current value https://developers.google.com/sketchup/docs/ourdoc/point3d#transform
  • Is there a ceiling function like in excel?

    20
    0 Votes
    20 Posts
    4k Views
    Dan RathbunD
    Just a note to remind all.. ... that now with Ruby in the 1.8.6 branch, we have both a ceil() and a floor() method defined for the Float class.
  • Naming components

    11
    0 Votes
    11 Posts
    553 Views
    F
    Thanks for the link Dan... that's the kind of info that seems trivial till you run into a problem. Yeah Komodo does all that good stuff plus the pro version does a bunch of other stuff and even debugging for ruby, I think. But I tried it and it had too many bells and whistles for a newbie like me and was confusing!
  • Display image using Ruby API

    9
    0 Votes
    9 Posts
    341 Views
    B
    Ya, WebDialog is also fine.
  • The $sketchup_version global var

    5
    0 Votes
    5 Posts
    601 Views
    Dan RathbunD
    @driven said: is there a similar way for PC's? Well, John, we would use within Ruby the cross-platform method call: puts Sketchup.version() Add: From the shell, there IS a command line utility, that can ask EXE and DLL files what their version is (provided they followed certain rules before compiling.) Some Ruby specific DLL files do not do this, and most SO files don't. I just cannot remember offhand what the name of the utility is ... EDIT: I now rememeber the utility on PC, it's: %(#BF4000)["C:/Program Files/Support Tools/filever.exe"] If you have the "Support Files" installed it's likely it's folder is in your path... so if your in the Sketchup program directory... %(#BF4000)[filever sketchup.exe] %(#000000)[>>] %(#BF4000)[--a-- W32i APP ENU 8.0.11752.0 shp 12,152,832 11-26-2011 sketchup.exe]
  • Intersect_with question/problem

    5
    0 Votes
    5 Posts
    439 Views
    Dan RathbunD
    Success I let the explode do the intersect ... model = Sketchup.active_model ents = model.active_entities pt1 = Geom;;Point3d.new 0,0,0 pt2 = Geom;;Point3d.new 10,0,0 pt3 = Geom;;Point3d.new 10,10,0 pt4 = Geom;;Point3d.new 0,10,0 pt5 = Geom;;Point3d.new 1,1,0 pt6 = Geom;;Point3d.new 9,1,0 pt7 = Geom;;Point3d.new 9,9,0 pt8 = Geom;;Point3d.new 1,9,0 mesh1 = Geom;;PolygonMesh.new mesh1.add_polygon pt1,pt2,pt3,pt4 mesh2 = Geom;;PolygonMesh.new mesh2.add_polygon pt5,pt6,pt7,pt8 grp = ents.add_group gents = grp.entities gents.add_faces_from_mesh( mesh1 ) grp2 = gents.add_group # nested group grp2.entities.add_faces_from_mesh( mesh2 ) # holeface = grp2.entities.to_a.find_all{|e| e.is_a?(Sketchup;;Face)} grp2.entities.erase_entities( holeface ) holeface = nil # so it's not pointing at a deleted entity holeloop = grp2.entities.to_a grp2.explode # merge with parent group togo = [] grp.entities.to_a.each{|e| if e.is_a?(Sketchup;;Face) && e.edges == holeloop togo << e end } grp.entities.erase_entities( togo ) grp2 = togo = nil # GC
  • Update entity by webdialog/excel

    6
    0 Votes
    6 Posts
    304 Views
    P
    a little bit more information: Standard DC definition attributes (dynamic_attributes): Retrieve with (for the selected instance): xx=Sketchup.active_model.selection[0].definition.attribute_dictionaries['dynamic_attributes'] xx.each{|key,value| puts key.to_s+'-'+value.to_s} Returns (app. depending on user set attributes of the selected instance-in this case LenX and LenY are 'user cannot see' and material is 'user can see'): _formatversion-1.0 _has_movetool_behaviors-0.0 _hasbehaviors-1.0 _lastmodified-2012-02-21 10:13 _lengthunits-CENTIMETERS _lenx_access-NONE _lenx_formlabel-LenX _lenx_label-LenX _lenx_units-DEFAULT _leny_access-NONE _leny_formlabel-LenY _leny_label-LenY _leny_units-DEFAULT _material_access-VIEW _material_formlabel-Material _material_label-Material _material_units-STRING _name-Huis1 lenx-393.700787401575 leny-393.700787401575 material- When changing LenX and LenY to 'user can see': _formatversion-1.0 _has_movetool_behaviors-0.0 _hasbehaviors-1.0 _lastmodified-2012-02-21 10:15 _lengthunits-CENTIMETERS _lenx_access-VIEW _lenx_formlabel-LenX _lenx_label-LenX _lenx_units-DEFAULT _leny_access-VIEW _leny_formlabel-LenY _leny_label-LenY _leny_units-DEFAULT _material_access-VIEW _material_formlabel-Material _material_label-Material _material_units-STRING _name-Huis1 lenx-393.700787401575 leny-393.700787401575 material- Standard instance attributes (dynamic_attributes): xx=Sketchup.active_model.selection[0].attribute_dictionaries['dynamic_attributes'] xx.each{|key,value| puts key.to_s+'-'+value.to_s} _has_movetool_behaviors-0.0 _hasbehaviors-1.0 lenx-393.700787401575 leny-393.700787401575 Now if you add an attribute on definition level eg. LenX this is accessible as lenx for both the comp. definition as the instance. Important: to be able to access that value on instance level with _lenx_formula (eg. to change the value) the attribute must be set to at least 'users can see this attribute' . Otherwise it cannot be changed through ruby. If I get out more information, I'll post it here.
  • Showing images, on the view, in a tool ?

    2
    0 Votes
    2 Posts
    51 Views
    thomthomT
    I also wish to draw GL bitmap. Haven't found a way. @dan rathbun said: but when the tool deactivates they vanish. That I don't think you can do anything with...
  • Window.open webdialog on MAC close parent

    19
    0 Votes
    19 Posts
    586 Views
    thomthomT
    @dan rathbun said: @driven said: What you can't do via 'SU as Server' is Download or Upload local content. [that's what broke set_html if html = local_file.img] Is this local content still broken on Safari ?? Yes.
  • 'require' problem with RBS

    13
    0 Votes
    13 Posts
    780 Views
    JuantxoJ
    @dan rathbun said: So... what happens if you wrap the very long string inside =begin =end The same, .rbs fails. Thank you Dan for your advice. Really I don't look for a solution. I only want to advert others about this. It's difficult to debug this error. Yesterday I scrambled the code but it didn't work. It was difficult to find out why. After a long time I discovered that by mistake I put a comment too long in same line and that was the reason.
  • Sketchup version numbers (M1 and M2)

    9
    0 Votes
    9 Posts
    499 Views
    Dan RathbunD
    @unknownuser said: @Dan: thanks for the info. 11752 builds is not bad for a single version 8.0 (~33 years at 1 build per day!) WHAT !! ... where do you get 33 years from ?? The 8.0 development cycle from start to 8.0.M2 release is no more than 701 DAYS ! ... and there are at least 24 more language builds above 11752, so make it 11776 total ... That's at least 16 (almost 17 builds per day.) Subtract 100 Sundays. And it's more like 11776 / 601 = at least 19 builds per day, if they worked 6 days a week.
  • Draw infinite lines?

    18
    0 Votes
    18 Posts
    731 Views
    thomthomT
    @tig said: Isn't it pointless to worry about this infinity-ness, provided that they 'appear' infinitely long ? Yes, that is what I try to do. Draw a line that appear to be infinite - that i ends in the SU horizon. Like the protractor tool does when you rotate. Or like an Guide Line does. I was thinking that if you could calculate where the projection meet, you could then use that as a measurement of how long the line should be, provided you could work out what the screen point represented in world coordinates.
  • Stop processing rest of file?

    14
    0 Votes
    14 Posts
    465 Views
    Dan RathbunD
    @thomthom said: @dan rathbun said: Hmm ... I see rescue modifiers do not work with require(), for some reason ? What you mean? What modifiers? The conditional keywords if and unless can be used in block position: [ if| unless] ( expression) statements end or modifier position: statement [ if| unless] ( expression) **rescue** can also be used in modifier poistion, but ... my attempt at this: require('booboo.rb') rescue nil ... does NOT trap the LoadError (because LoadError < ScriptError < Exception, and rescue only traps RuntimeError and subclasses by default.) For a one-liner, we must use semi-colons: begin require('booboo.rb'); rescue Exception; nil; end
  • Sketchup::Text Font

    2
    0 Votes
    2 Posts
    946 Views
    thomthomT
    @anton_s said: Is there a way to change sketchup::text font and size through some code? Not per entity - it is a model setting. From the UI you change it from Model Info > Text Not sure if it is exposed via the API...

Advertisement