⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

Subcategories

  • No decscription available

    20 Topics
    462 Posts
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Versioning

    7
    0 Votes
    7 Posts
    648 Views
    tt_suT
    It's still unclear what release they are scheduled for. Sometimes these things end up in new releases only - some times they backport the fixes.
  • Examples of unit tests in ruby for sketchup plugins

    3
    0 Votes
    3 Posts
    676 Views
    tt_suT
    @nits4 said: Hello, Are there any examples of unit tests in ruby for sketchup plugins? Thanks. There is TestUp with a framework. But it doesn't work with Ruby 2.0 in SU2014. It used some old and custom frameworks that aren't supported any more. https://github.com/SketchUp/sketchup-developer-tools Internally we've begun on a new framework, but it's not something that's even remotely ready for distribution.
  • Sync sketchup with vtk tool

    3
    0 Votes
    3 Posts
    477 Views
    C
    Hi, thanks for the Tip. I looked their and synced the position with the position, the target with the focal point and view up with view up. That seems to work pretty good in the first attempt, but I am not allowed to zoom in or out, since then both view are not the same anymore (basically the vtk window does not "rescale". vtk has the zoom or setdistance function, but I expected them to be given indirectly be the distance between position and focal point. what information have i missed?
  • Followme with distance

    8
    0 Votes
    8 Posts
    662 Views
    N
    Thanks to all who tried to help me. I'm just new to ruby and Sketchup API, but digging some deeper into it I solved this problem by myself now.
  • Reverse operation of view.screen_coords

    30
    0 Votes
    30 Posts
    3k Views
    Dan RathbunD
    Do the same thing but do not change the target ?
  • How to read .skp files in ruby?

    6
    0 Votes
    6 Posts
    1k Views
    P
    When you import a model, the entities (edges, faces, groups,... ) don't go directly in model.entities. They are encapsulated in a new component....
  • Secure http request from SketchUp ruby

    4
    0 Votes
    4 Posts
    1k Views
    Dan RathbunD
    Now hold on. IF this certificate will be used across all versions of SketchUp, then yes you CAN have your own application folder in the user %AppData% path. "C:/Users/Joe/AppData/Roaming/YourCompany/ThisPlugin" (Windows) If it is for any user on a workstation, then it could go in the %ProgramData% path. That complicates thing though. If it does not matter if there are multiple copies of the file, then it is easiest to include it within the RBZ archive.
  • Rename texture image file inside *.skp

    7
    0 Votes
    7 Posts
    2k Views
    N
    So there is a ruby plugin I've done (based on TIG's post). It renames all texture files in model with a template. module VNV def VNV.rename_textures UI.messagebox("All texture file names will be changed with a template - mat000") model = Sketchup.active_model model.start_operation('Rename texture files', true) tw = Sketchup.create_texture_writer temp_path = File.expand_path( ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP'] ) temp_folder = File.join( temp_path, 'Sketchup_tmp_mtl' ) unless File.exist?( temp_folder ) Dir.mkdir( temp_folder ) end group = model.active_entities.add_group() Sketchup.active_model.materials.each_with_index{ |m,i| if m.texture then group.material = m tw.load(group) path_to_png = File.join(temp_folder, "mat#{'%03d' % i}"+".png") tw.write(group, path_to_png) w = m.texture.width h = m.texture.height m.texture = path_to_png m.texture.size = [w, h] File.delete(path_to_png) end } group.erase! model.commit_operation end # def end # module if (!file_loaded?(__FILE__)) menu = UI.menu("Plugins") menu.add_item("Rename texture files") { VNV;;rename_textures } # Let Ruby know we have loaded this file file_loaded(__FILE__) end RenameTextures.rb
  • [Code] Layers Panel API

    9
    0 Votes
    9 Posts
    3k Views
    Dan RathbunD
    @jiminy-billy-bob said: A module. Why? Just checking. Keepin' ya honest. (Only Ruby, and in rare instances the API or library gems, should define classes at the toplevel.)
  • Hide at a distance from the camera - works but slooooowwww

    4
    0 Votes
    4 Posts
    424 Views
    tt_suT
    Fog generally tends to slow down the framerate.
  • Reading and drawing textures

    22
    0 Votes
    22 Posts
    2k Views
    Dan RathbunD
    @dan rathbun said: The HTML5 Canvas element will not work well on PC yet because SketchUp uses the MSIE WebBrowser control for WebDialogs. Microsoft is lagging behind in their IE support of the specification. You can test by loading the HTML5 Bejeweled game into a WebDialog. It most likely will not run under XP. But runs fine under Win7 with MSIE v11 installed. Bejeweled.rb
  • GitHub as a Content Library Manager?

    6
    0 Votes
    6 Posts
    575 Views
    M
    @adamb said: It sounds what you need is an Asset Management System... I'll have to do some more investigation. I knew GitHub probably wouldn't have been quite right, and I appreciate the feedback. On to do more research. I might just use a private collection (or several) on 3DWH like was suggested earlier until I figure something out.
  • Group moves to origin when I doubleclick to select component

    20
    0 Votes
    20 Posts
    2k Views
    Dan RathbunD
    @tt_su said: But you cannot return a single world position for a vertex unless you have some extra info. RIGHT.. I gotcha' We would need to let Ruby know the parent instance's transform. (Not automatic unless in user edit mode.) I guess we can do this now. We just create a copy of the instance's transformation, call it **t**: world_pt = edge.start.position.transform(t) I guess I was pondering how to automatically call #transform(t) upon all newly created Geom::Point3d instances, within a code block scope. So, yes I suppose an optional "tranform" class argument for Vertex#position would be handy. (It could be a Geom::Transformation instance, a Geom::Vector3d in world context, OR either an Array or Geom::Point3d offset from ORIGIN.) So it could look like: world_pt = edge.start.position(t) (2) So lets say you have collected a series of vertices (in an array verts.) And you want their world co-ordinates: world_pts = verts.map {|v| v.postion(t) } We have to use map, because the API's Array#tranform() and Array#tranform!() methods, refuse to apply a transform to an array with anything other than than 3 numerics. Even though each individual element has a transform method. Example, you have an array of Geom::Point3d objects, and you want to transform ALL elements the same. The Array class transform methods should do this IF the the elements are not numeric, and they respond_to?(:transform). (Add: Any element that does not "respond_to" is returned unchanged.))
  • View.draw2d(GL_POINTS, pts) on ATI with AA

    3
    0 Votes
    3 Posts
    464 Views
    thomthomT
    Yea, think so.
  • Rounding a value for export with a ":" separator

    7
    0 Votes
    7 Posts
    645 Views
    IltisI
    OK, this works well : begin # Open a file for writing File.open(filepath, "w"){ |file| selection = Sketchup.active_model.selection # Get an array of faces that are in the selection. faces = selection.grep(Sketchup;;Face) faces.each_with_index{ |face, index| # Write a label for the face. file.puts("Face#{index+1}") # Get a transformation object that translates from model space to 2d space of the face. t = Geom;;Transformation.axes(face.vertices.first.position, *face.normal.axes).inverse # Write all vertices to the file. blnFirstPoint = true first_point_u=0 first_point_v=0 face.outer_loop.vertices.each{ |vertex| # Get the point of the vertex and apply the transformation. point = vertex.position.transform(t) # Convert the coordinates u, v = point.to_a.map{ |c| c.to_f } if blnFirstPoint==true first_point_u = u first_point_v = v blnFirstPoint = false end #if # Write the coordinates to the file. file.puts("#{(u*10000*25.4).to_i.to_f/10000};#{(v*10000*25.4).to_i.to_f/10000}") } file.puts("#{(first_point_u*10000*25.4).to_i.to_f/10000};#{(first_point_v*10000*25.4).to_i.to_f/10000}") } } Thanks a lot! Renaud
  • Mac read_defaults?

    20
    0 Votes
    20 Posts
    1k Views
    Dan RathbunD
    Well on the PC, we have been in the same boat. The API can read only string registry values. Many things are DWORD binary values. Often holding only 1 or 0 for true/false, on/off, etc. Such a simple thing that can not be read. A long time ago, I thought I filed a Feature Request for an application level options hash interface.
  • Get component definition name

    3
    0 Votes
    3 Posts
    507 Views
    alexandre skA
    ohhhhhh this one is for me: [image: http://www.loud-mouse.com/wp-content/uploads/2012/09/dumbass.jpg] Thank you very much. I was expecting something very simple but not that simple. Starting to like ruby. I only know php and javascript, but this ruby is good. Thank you Jim
  • Find vertex resulting from a pushpull or transformation

    8
    0 Votes
    8 Posts
    711 Views
    Dan RathbunD
    The wrapper method in "sketchup.rb" is in need of an overhaul. Post your suggestions in thread: [Code] better inputbox() wrapper
  • Reading registry values withouts quotes

    2
    0 Votes
    2 Posts
    334 Views
    Dan RathbunD
    What Windows version and SketchUp version ? EDIT. Nevermind, just go to this post from last Thursday, 1st of May: Re: get registry string from ruby 2.0 (Also works with older versions, if user has the old "win32ole.so" file downloaded from the Plugins forum [link shown.])
  • Nicedit for SketchUp (javascript issue)

    9
    0 Votes
    9 Posts
    2k Views
    inteloideI
    Hello, thank you for your answer. Actually the main reason why it didn't work, is beceause jQuery was required. Once added, it work fine. Inteloide

Advertisement