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

    Topics

    • W

      How to select everything touching a bounding box?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      405 Views
      Chris FullmerC
      I doubt that anyone has published a helper method to do exactly what you are looking for. But you have the logic correct. First clear the selection (in case the user has something selected). Then search through all entities and find the ones on the wrong side of x. Then add all those to the selection set. ` model = Sketchup.active_model ents = model.active_entities sel = model.selection sel.clear! ents.each do |e| if e is on the wrong side of x- Add your code here sel.add e end end` Everything in that "your code ghoes here" part needs to decide what type of entity is being looked at and then you have to specify how to determine if that entity is on the wrong side of x. To simplify it, you could just look at the bounding box of each entity and determins if the center of the bounding box is on the wrong side of x. If it is, then add it. That would be the simplest way and would look something like this: if e.bounds.center[0] > my_x sel.add e end Chris I guess I pretty much wrote the whole thing, so I might as well just finish it up. Here is a whole little snippet of working code: ` model = Sketchup.active_model ents = model.active_entities sel = model.selection sel.clear my_x = 0.0 ents.each do |e| if e.bounds.center[0] > my_x sel.add e end end`
    • W

      How to use Geom::Transformation.rotation?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      1k Views
      thomthomT
      @wpd said: Is there any mechanism for feeding back additions and clarifications to the Sketchup documentation? I'd be glad to write something about the meaning of the point and vector arguments and about rotating using the right hand rule. Even a simple example of rotating a line or a face (one that had been written using 45.degrees) would have gone a long way to getting me where I wanted to go much sooner. I second this. Transformations sounded greek to me. Still does. "Translation" does a move..? I'd never have guessed that.
    • 1 / 1