sketchucation logo sketchucation
    • Login
    1. Home
    2. Thomas214
    3. Topics
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    T
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 11
    • Groups 1

    Topics

    • T

      Multiple line select

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      229 Views
      Dan RathbunD
      There IS a work-in-progress on a BIM type plugin that can make walls, and export to IFC. Maybe you could join in with that project ?? [Plugin] bim-tools 0.9.0 (8 Oct 2011)
    • T

      Create a new line

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      171 Views
      TIGT
      You're making it too complex... pt0=[0,0,0] pt1=[1,0,0] Sketchup.active_model.active_entities.add_line(pt0,pt1) Adds a new line from the origin 1" long, to the right [i.e. X/red axis] The entities.add_... methods are listed in the API guides and cover many aspects of adding lines, arcs, circles, polygons, clines, cpoints, faces, text etc... please read them and have a mess around...
    • T

      Ruby plugin?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      16
      0 Votes
      16 Posts
      828 Views
      TIGT
      Thomas You really need to learn to crawl before you walk... You expect 'random lines of code' to be interpreted for you ! Please structure your questions a little more friendly... width, height = results presumably this follows a UI.inputbox that results= ? There were two answers... width & height ?? pts = tl[0].vertices sets an array called 'pts' to be the vertices related to the first element in the array tl - as it's not named logically that couls be a list of faces OR edges... i = 0 sets a reference called 'i' to be 0 [this is used later in the '.each do' loop ??? pts2 = [] Makes an empty array called 'pts2' - presumably this will be filled with elements later... pts.each do |pt| pts2[i] = pt.position + [0 , 0 , results[1]] i = i +1 end This process the vertices in 'pts' [it would've been better to call it 'verts' ??] And for each vertex [pt !!!] it returns its position as a 3d-point BUT swaps its z-value for whatever the results[1] was = probably the 'height' so why wasn't 'height' used ?? line_copy = entities.add_line pts2 Tis makes a line in [whatever] 'entities' [is] using the array 'pts2' as the 2 points - these have had their z values set to 'height'... pts_copy = line_copy.vertices This sets the array 'pts_copy' to be the vertices used by the edge 'line_copy' ??? i = 0 j = 0 sets the references 'i' and 'j' to 0 new_face = entities.add_face(pts[0], pts_copy[0], pts_copy[1], pts[1]) This sets the reference 'new_face' to be the face [if any] that is made using the 4 points listed [if they are not coplanar it will fail!] new_face.pushpull (width / 2) It pushpulls the 'new_face' by half of the 'width [i.e. results[0] set earlier] Do NOT leave a gap between the 'pushpull' and its argument in parentheses [i.e face.pushpull(xxx) NEVER face.pushpull (xxx)] model.commit_operation end This closes the 'operation' and 'end's something - presumably the ' def zid' ? You must have a model.start_operation("MyTool") to 'close' it later... [ruby:1dtqmkst]if( not file_loaded?("zid.rb") ) UI.menu("Plugins").add_item("Zid") { zid } end file_loaded("zid.rb")[/ruby:1dtqmkst] This makes the Plugins menu item a called '[ruby:1dtqmkst]Zid[/ruby:1dtqmkst]' which in turn runs the [ruby:1dtqmkst]def[/ruby:1dtqmkst] called '[ruby:1dtqmkst]zid[/ruby:1dtqmkst]' ??? The [ruby:1dtqmkst]file_loaded[/ruby:1dtqmkst] parts need you to have a [ruby:1dtqmkst]require 'sketchup.rb'[/ruby:1dtqmkst] earlier and ensure that only one menu item appears even if you manually reload the script into the same SKP session...
    • 1 / 1