⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • RBZ update issue

    22
    0 Votes
    22 Posts
    1k Views
    jiminy-billy-bobJ
    Hmmm, right. Thanks
  • Material Take-Off by layers

    3
    0 Votes
    3 Posts
    370 Views
    pingpinkP
    Wow ! I changed the codes and it can analyze the layers. Thank you very very much , Dan !! selection.each { |s| is_group = s.is_a? Sketchup;;Group is_component = s.is_a? Sketchup;;ComponentInstance if s.layer.name == "Aluminium" ----continue---- }
  • Problem with component-definition in a loop

    2
    0 Votes
    2 Posts
    210 Views
    Dan RathbunD
    See the BBcode help page You need to use the [ code ] ... [/code ] bbCodes around your code example and it will look like this: [code:11ffgczd] Some example code; a = [1,2,3] last = a.pop puts last[/code:11ffgczd]
  • [Webdialog] freeze during Ruby operation

    9
    0 Votes
    9 Posts
    1k Views
    jolranJ
    Draw method, in a tool. Sorry, my misstake. Calculations for nodes are done outside the tool class. Passing through those methods I collect information to be sent to a container that the Tools draw method fetches information for rendering. I have a bit of work left there to get things organized. The data changes constantly so it will probably cost more to iterate what is needed to be updated then to redraw everything in 1 go. Since mostly dealing with Points and vectors, the new data will probably be totally different then the old anyway. I just clear the old data and bring in new, sort of, without going into details.. There are different types of data though. Persistent data that references to a Sketchup entity for ex, can be cached and updated only when switched. Anyway got a new situation now(TOPIC), have to redesign a lot on the Ruby side. I've studied your render cache. It's very nice and good example. Need to study it more though. Thanks for the input
  • Coordinates entered with InputBox

    5
    0 Votes
    5 Posts
    817 Views
    TIGT
    The last line newFace = selection[1].offset(-.25) is wrong! Try selection=model.selection newFace = selection[1].offset(-0.25) OR newFace = model.selection[1].offset(-0.25) The error is actually quite clear - it is telling you that 'selection' hasn't been defined ... Note it's best to use 0.25 NOT .25 Also how do you know what selection[1] is going to be ??? The API's offset() method is to offset a point3d by a vector3d + an optional length BUT there is an offset() method that can be added for faces, edges etc - BUT this is added by another script [by Rick Wilson?], but I don't see you 'requiring' it at the start of your code... Another tip: your input... defaults = [10,20,15] fixes the inputs as integers, if you want the input in inched use decimal numbers: defaults = [10.0, 20.0, 15.0] OR defaults = [10.inch, 20.inch, 15.inch]
  • Learning Ruby by Writing a Working Shell?

    9
    0 Votes
    9 Posts
    487 Views
    M
    Thanks Dan, coincidentally I just bought the pick axe. I'll be hammering though my way through that starting this weekend Sent from my Galaxy Nexus using Tapatalk
  • Transforming an array of points

    27
    0 Votes
    27 Posts
    774 Views
    jolranJ
    Yet Another test Don't know how reliable this test is but it appears face get appended in the same order as indexed in Polygonmesh. But Polygonmesh Count indexes starting at 1. Edit: Updated for adding c_point in polygonmesh index as well. But wonder how hidden edges affect the Index ordering.. The API says: @unknownuser said: The negative values should not be used as an index for point_at, take the positive value of the index value in the polygon array Perhaps hidden edges will only happend if mesh is constructed from a collection of Sketchup::Face's. Not relevant in this case. In that case maybe use index.abs or perhaps double negation: index = index<0 ? -index : index ents = Sketchup.active_model.active_entities def centerpoints(f) cx = (f[0].x + f[1].x + f[2].x + f[3].x)/4 cy = (f[0].y + f[1].y + f[2].y + f[3].y)/4 cz = (f[0].z + f[1].z + f[2].z + f[3].z)/4 return Geom;;Point3d.new(cx, cy, cz) end face1 = [ Geom;;Point3d.new(-5,-5,0), Geom;;Point3d.new(5,-5,0), Geom;;Point3d.new(5,5,0), Geom;;Point3d.new(-5,5,0) ] #create points for 4 faces faceHash = {} for i in (0...4) faceHash[i] = face1 face1 = face1.collect{|pt| pt.offset([20,0,0])} end #get refference to the center of "face"#3 Before appending to mesh. fC = centerpoints(faceHash[2]) ents.add_cpoint(fC) # Bit strange to loop hash this way, but they get ordered. msh = Geom;;PolygonMesh.new for n in (0...faceHash.length) msh.add_polygon(faceHash[n]) end #Test PolygonMesh index. How does hidden edges affect indexes for this ? # +1 index for polygons in Mesh. 2 c_points should get added at same spot meshface3 = msh.polygon_points_at(2+1) mc = centerpoints(meshface3) ents.add_cpoint(mc) group = ents.add_group group.entities.add_faces_from_mesh(msh) faces = group.entities.grep(Sketchup;;Face) #Red material to face 3 faces[2].material = "red"
  • Trim along a sandbox outline

    8
    0 Votes
    8 Posts
    666 Views
    BoxB
    I'll leave it at that, You are an advanced user and are obviously talking over my head.
  • Glued_to problem

    6
    0 Votes
    6 Posts
    378 Views
    tt_suT
    @existme said: Thanks so much It's a pity that you cannot glue to other component's faces via API. Indeed.
  • Co planar test

    27
    0 Votes
    27 Posts
    916 Views
    tt_suT
    With an Point3D version of the Oct tree I don't think the point comparison will be an issue any more. From the tests with vertices it scaled very well. Though I have some more ideas for the PolygonMesh class.
  • Thumbnail images as textures

    3
    0 Votes
    3 Posts
    253 Views
    A
    Thanks TIG.
  • Excluding from undo stack

    8
    0 Votes
    8 Posts
    386 Views
    Chris FullmerC
    If this system is entirely under your control, it would be easy to include all the geometry in the template model. Then when the user opens a new model, all those components are there without any possibility of being undone.
  • Store Patterned Data

    4
    0 Votes
    4 Posts
    268 Views
    pingpinkP
    Thank You So much,Tig. It works ! This is the idea to revise a model from architect by storing data at the first time. And later use to recheck data for tagging panels , and take the panel out in order that the facade engineer can do the life size panels to do mapping back on sub-dividing panels. The method I do : The subdividing faces are in the "Layer0". The patterns are in the Layer-"Patterns". So , they are not mix together in the same layer. For the shortage time to "delete coplanar edges or patterns" , I have to select edges by degrees and use your code to delete edges because the group edge and original edges are overlap that I have to delete original edges.So , it doesn't affect to bring tagging panels out , and I can recheck the patterned data to do retag panels. For the store patterned data , maybe it comprise of 3 functions : 1.Make edge group 2.Select Coplanar edges by degrees 3.Delete Coplanar edges selection
  • How to subclass a drawing element

    7
    0 Votes
    7 Posts
    454 Views
    Dan RathbunD
    @curator said: How can I add, sets say, an option like "change radius" or "change position". How do I add such an option only to "sphere", and not to "cube" or whatever. IF you use a group: UI.add_context_menu_handler {|menu| sel = Sketchup.active_model.selection if (not sel.empty?) && sel.single_object? && sel.first.is_a?(Sketchup;;Group) && sel.first.entities.parent.name == "Curator_Sphere" menu.add_item("Change Radius") { # do code here, or call a method like; Curator;;SphereWorx;;set_radius(sel.first) } end } IF you use a component instead: UI.add_context_menu_handler {|menu| sel = Sketchup.active_model.selection if (not sel.empty?) && sel.single_object? && sel.first.is_a?(Sketchup;;ComponentInstance) && sel.first.definition.name == "Curator_Sphere" menu.add_item("Change Radius") { # do code here, or call a method like; Curator;;SphereWorx;;set_radius(sel.first) } end }
  • Check if component exists before making it

    6
    0 Votes
    6 Posts
    365 Views
    TIGT
    At best it will find a match immediately 1/2000, at worst at go 2000/2000, on average at go 1000/2000. You can but test it and see... If you are adding all cube-instances in the same SketchUp session then why not make a @points array to push [ <<] all of the points you will use during the placements - these need to be as arrays so they are 'comparable' [use point.to_a] - points are comparable as == but include? is faster [most probably] with array comparisons ? Then... instead of finding all instances and comparing each 'instance.origin' to 'point' use: @points.include?(point.to_a) If the tested point is in the current list then it's taken and you skip the operation... Of course this doesn't work when instances have been erased or across SketchUp sessions
  • 2013 Unconference

    4
    0 Votes
    4 Posts
    337 Views
    tt_suT
    That will be released later as we get closer to releasing SketchUp 2014. We cannot release all the details publicly yet. We do have a great amount of recordings from the event.
  • Intersect_line_line question

    8
    0 Votes
    8 Posts
    410 Views
    s_k_e_t_c_h_yS
    Ah, Good point sl. I used a similar test for a line-plane intersection test.
  • From string to not a string

    9
    0 Votes
    9 Posts
    2k Views
    renderizaR
    Dan Rathbun I can't thank you enough you sir are brilliant!
  • Add_face gives error duplicate point in array

    16
    0 Votes
    16 Posts
    3k Views
    G
    In this example I increased the width of the stringer which results in a small triangle that you can see. Width is 304 mm. Where the sketchup error occurs the stringer width was 300 mm and the small triangle would not be visible at this zoom. What I have done for now, which works in these type of situations, is simply use a rescue block. I would normally consider this bad form as it can hide errors. This code only works on the last section when the stair has a heel and when we should have a triangle. The sketchup error was misleading and cost me a bit of time trying to track this down. begin # try to add the face ent.add_face( pts ) rescue puts( pts ) if ( debug_level > 0 ) end Any thoughts on this? [image: EYAC_collinearissue.JPG]
  • Variables - issue

    7
    0 Votes
    7 Posts
    340 Views
    artmusicstudioA
    @massimo said: Moved to developers forum. Hi Stan, would you mind to post such threads in developers section of the forum? Usually the newbie section is about SU's usage. Thanks. hi massimo, sorry, of course, didn't think about that , i'll be carefull in the future! stan

Advertisement