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

    Remmel

    @Remmel

    10
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online
    Age 75

    Remmel Unfollow Follow
    registered-users

    Latest posts made by Remmel

    • RE: Offset a line Ruby command

      @tig said:

      First, your code...
      which I assume is just a sample...

      door_width = 3
      makes it 3" wide

      door_width = 3.feet
      makes it 3' wide !
      etc...

      I.E. force the use of a 'length', rather than passing a default 'number' - which SketchUp always interprets as inches !

      Also... you'd probably be better off adding a new group into model.active_entities and then adding your new geometry into that group.entities

      Currently your code draws a rectangle on the ground [Z=0 - and 0 is 0 in ALL length-units!] and then you extrudes it downwards by -1["]...
      If you wanted -1' then use -1.feet etc


      AND... you haven't actually explained 'how' you want to 'offset a face' !?
      Your code uses 0 for all of the Z values used in the rectangle's corner-points, but of course you could use any value for those Z's - but remember that they should be set to the same length if a valid 'flat' rectangle is to result...

      now i know in Sketchup API , there is no method to offset a face.... but i thought to offset a face like this..... pl.offset 1, to get a border of 1" width

      posted in Developers' Forum
      R
      Remmel
    • RE: Offset a line Ruby command

      i have the same problem... not to offset a edge... but offset a face in ruby code
      i hope TIG have a solution for this issue
      see example

      Set the house dimensions (in feet)

      @num_windows = 4
      door_width = 3
      door_height = 7
      house_height = 9
      house_length = (@num_windows + 1) * (door_width + 2) + 2
      house_width = 10
      roof_height = 2

      ents = model.entities

        pl = ents.add_face([0, 0, 0], [0, house_length, 0],
           [house_width, house_length, 0], 
           [house_width, 0, 0], [0, 0, 0])
      	 pl.pushpull -1
      
      posted in Developers' Forum
      R
      Remmel
    • Grouping and ungrouping

      Hi There, i wonder..... when you make an group with ruby in sketchup.... you can explode
      that group.... but is it possible to make the same group egain...???
      can anyone help me...?

      see the following simple exaample

      #create a group and add a line into the group
      model = Sketchup.active_model # Open model
      entities = model.entities # All entities in model
      selection = model.selection # Current selection
      group = entities.add_group #make emplty group

      #create a line in group
      line = group.entities.add_line [0,0,0], [100,50,20]

      #explode group
      group.explode

      posted in Developers' Forum
      R
      Remmel