sketchucation logo sketchucation
    • Login
    1. Home
    2. Thomas214
    ℹ️ 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

    Thomas214

    @Thomas214

    10
    Reputation
    1
    Profile views
    11
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Thomas214 Unfollow Follow
    registered-users

    Latest posts made by Thomas214

    • RE: Multiple line select

      @thomthom said:

      @thomas214 said:

      what is the fastest way to do it without to much changing the code.

      You're making a big assumption here - we have no insight to your code...

      As for making a wall from selected set of lines, I'd create it using Face.followme method. http://code.google.com/apis/sketchup/docs/ourdoc/face.html#followme

      Create the profile of the wall at one of the end points of your set of edges and then face.followme.

      In the attachment is the code.


      Wall.txt

      posted in Developers' Forum
      T
      Thomas214
    • Multiple line select

      I have a simple written code to create a wall from a selected line, now I would like it to work for multiple lines. what is the fastest way to do it without to much changing the code. Can I do it with Loop and how??

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      Can someone explain to me what this lines are for? I know they are for creating faces and offset lines but witch ones do what?

      width, height = results
      

      pts = tl[0].vertices
      i = 0
      pts2 = []

      pts.each do |pt|
      pts2[i] = pt.position + [0 , 0 , results[1]]
      i = i +1
      end
      line_copy = entities.add_line pts2

      pts_copy = line_copy.vertices

      i = 0
      j = 0

      new_face = entities.add_face(pts[0], pts_copy[0], pts_copy[1], pts[1])
      new_face.pushpull (width / 2)

      model.commit_operation
      end

      if( not file_loaded?("zid.rb") )

      UI.menu("Plugins").add_item("Zid") { zid }
      

      end

      file_loaded("zid.rb")

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      @tig said:

      Choose the Select tool.
      Pick on an object [like a line].
      Hold down Ctrl and pick on another object to add it to the selection.
      Holding down Shift toggles an object in/out of the selection.
      Holding down Shift+Ctrl and picking an object removes it from the selection.

      With a face one click to pick face, two clicks to pick face and its edges and three clicks to select it AND all other edges and faces connected to it...

      I was talking about the plugin πŸ˜„

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      @sdmitch said:

      http://rhin.crai.archi.fr/rld/plugin_details.php?id=250 is the link to midline2wall.rb which looks to be exactly what you want.

      Hmmm yes but how can I select multiple lines?

      posted in Developers' Forum
      T
      Thomas214
    • Create a new line

      Does the code create a new line next to a existing line?

      model = Sketchup.active_model
      entities = model.active_entities
      pts = []
      pts[0] = [0, 0, 0]
      pts[1] = [x, 0, 0]
      pts[2] = [x, y, 0]
      pts[3] = [0, y, 0]

      Add the face to the entities in the model

      face = entities.add_face pts

      I just happen to know that the second and third entities in the

      entities objects are edges.

      entity1 = entities[1]
      entity2 = entities[2]
      edges = entity1.all_connected
      if (edges)
      UI.messagebox edges.to_s
      else
      UI.messagebox "Failure"
      end

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      I got this far

      prompts = ["x:", "y:", "z:"]
      defaults = [10, 20, 100]
      input = UI.inputbox prompts, defaults, "Input data"
      x = input[0]
      y = imput[1]
      z = imput[2]
      model = Sketchup.active_model
      ent = model.entities
      sel = model.selection

      model = Sketchup.active_model
      entities = model.active_entities
      pts = []
      pts[0] = [0, 0, 0]
      pts[1] = [x, 0, 0]
      pts[2] = [x, y, 0]
      pts[3] = [0, y, 0]

      Add the face to the entities in the model

      face = entities.add_face pts

      I just happen to know that the second and third entities in the

      entities objects are edges.

      entity1 = entities[1]
      entity2 = entities[2]
      edges = entity1.all_connected
      if (edges)
      UI.messagebox edges.to_s
      else
      UI.messagebox "Failure"
      end

      faces = []

      sel.each do |e|
      	if e.is_a? Sketchup::Face
               faces.push e
      	end
      end   
      
       Sketchup.active_model.start_operation "Wall"     
      faces.each do |e|
           ent.add_group e
           e.pushpull (z)
       end
      		Sketchup.active_model.commit_operation	
      

      end

      if( not file_loaded?('Wall.rb') )
      UI.menu('Plugins').add_item('wall') {wall }
      end

      file_loaded 'Wall.rb'

      I think I have to create a new entety for the faces theat are created to use it in push/pull ?

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      @tig said:

      @thomas214 said:

      @driven said:

      for something like this it's probably quicker and easier to draw [rectangle tool] the profile, select all lines and click followMe tool.

      there are lot of rubies that deal with more complex versions of this, but the standard tools can do quite a bit...
      [attachment=0:2kbtp9i4]<!-- ia0 -->use_followMe.png<!-- ia0 -->[/attachment:2kbtp9i4]

      This is somethin for my school project so to draw it this way it isn't an option πŸ˜„

      So write down the plan for your code...
      . check the model.selection contains some connected Edges (>>>path)
      . use a UI.inputbox() dialog to get the height
      . add a rectangle_face at start.position (p0) of first edge in path, calculating the other three points as p0=p1.clone; p1.z=p1.z+height etc using rectangle_face=entities.add_face(p0,p1,p2,p3)
      . use rectangle_face.followme(path) to extrude the new face along the path.
      . done

      Hmmm what if I useEdge.all_connectedthen the code from the the plugin push/pull face I have?

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      @driven said:

      for something like this it's probably quicker and easier to draw [rectangle tool] the profile, select all lines and click followMe tool.

      there are lot of rubies that deal with more complex versions of this, but the standard tools can do quite a bit...
      [attachment=0:1tdufwpm]<!-- ia0 -->use_followMe.png<!-- ia0 -->[/attachment:1tdufwpm]

      This is somethin for my school project so to draw it this way it isn't an option πŸ˜„

      posted in Developers' Forum
      T
      Thomas214
    • RE: Ruby plugin?

      @unknownuser said:

      Maybe a little concept image, because this plug is maybe yet existing πŸ˜„

      There is an Example in the attachment of what I would like to do with it.


      From a line to a wall

      posted in Developers' Forum
      T
      Thomas214