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

    Posts

    Recent Best Controversial
    • RE: Get Group Owner

      ... You can get some information regarding inheritance in one of two ways:

      1. If the user is actively editing a group or component, you can get the current path using: Sketchup.active_model.active_path

      2. If you are traversing through the model's entities, you can keep track of where you are in the model and develop your own inheritance structure that way.

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Face with 0.0 area

      How did you get this face?

      I played with the file a bit. In addition to each edge having the face listed twice, for the zero area face (face):

      face.edges.length = 8, in truth there are 4 unique edges, each listed twice.

      Also:

      If you select only the face in the model (do this by selecting everything in the model and then unselecting the 4 edges), and then move the face, all 4 edges shown move as if they bound a normal face.

      If you draw over one of the edges, the void in the center does not fill in as a face. Therefore, I think that this is what happened:

      If you look at the order of the edges returned by face.edges, it seems that the edges go clockwise and then counter clockwise (or vis-versa). So I think that somehow, the face is zero area because the four edges define the outer loop, plus an inner loop with a hole in it of the same size and dimension.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Ruby Code Snippets

      I also found the linetool.rb pretty dense.

      @chris fullmer said:

      There are always questions about learning bad habits from others

      It would be helpful to have some other coders review the files and make suggestions for cleanup prior to submission to the thread. I will definitely volunteer my material selection plugin (http://forums.sketchucation.com/viewtopic.php?t=31378), but would definitely like some criticism regarding the coding and clarity prior to having someone learn from it!

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Ruby Code Snippets

      How about compiling a list of simple plugins that newbies can learn from? I find it is really helpful to learn from something that actually does something useful. We can develop a list of existing plugins, that are well-written, short, and accomplish something useful. I've learned alot from reading other people's code, and it definitely would've been useful to me to have a short list of plugins to download and learn from.

      I think that lots of people on this forum could develop a short list of their plugins that would help a beginner. This would provide an excellent resource without sapping TONS of time.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Add_group( entity ) weirdness

      @unknownuser said:

      hmm im somewhat confuses here-why did the face appear to have been shifted to the origin of g1 - instead of preserving it's original position?

      I think that there is a problem somehow with the transformation of the objects. Following my instructions in the other post:

      http://forums.sketchucation.com/viewtopic.php?f=180&t=31443&p=276973&hilit=kwalkerman#p276860

      the end result is that in the outliner, a group is added to Sketchup.active_model.entities. The transformation of the group is equal to the transformation of the original face in it's original group.

      Then, when you open the original group for editing, the face appears in its original location.

      So, there are two major problems:

      1. when passing entities into entities.add_group, entities MUST equal model.active_entities
      2. the entities passed in retain their original transformation, relative to the previous entities collection, with some strange behavior.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Add_group( entity ) weirdness

      This is the same bug I detailed here:

      http://forums.sketchucation.com/viewtopic.php?f=180&t=31443&p=276973&hilit=kwalkerman#p276973

      posted in Developers' Forum
      K
      kwalkerman
    • RE: SU upgrade to 8.0.4811 (Maintenance 1)

      model.raytest fixed!! with the optional boolean attribute as well. THANKS!

      And the shadow bug fixed. That's a nice surprise.

      --
      karen

      posted in SketchUp Discussions
      K
      kwalkerman
    • RE: Newbie: Drawing state diagrams with Ruby - would this work?

      Also, what happens if you have a repeating pattern? Say two boxes are connected in such a way, and the user copies and pastes this pattern a number of times. You would need to be able to re-assign id's to each group of components, in order to maintain referential integrity.

      This is an interesting application for SU, I can certainly think of a number of uses for it.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Sketchup 8 Patch ETA

      Thanks for all the explanations. Hopefully we'll see the new release soon!

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Sketchup 8 Patch ETA

      I just noticed that under under the ruby API for model.raytest, a new flag has been added to select whether hidden entities should be returned or not:

      "An optional flag, added in SU8 M1, indicating whether or not to consider hidden geometry in intersection computations. If this flag is not specified, it defaults to true (WYSIWYG) - i.e. hidden geometry is not intersected against."

      Yay! However, my version of SU8 (downloaded yesterday) doesn't seem to be this M1 version. Anyone know anything about it?

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Plugin running indefinitely

      The reason that your while loops are crashing SU is that, in basic terms, any time ruby is running, SU is not running. The scripts that appear to run continuously while SU is running are alerted or activated by something. The ruby code executes, completes, and waits for until it is called again. There are different things that can call ruby code to execute. For example, many tools respond to an onMouseMove method, so they update every time the mouse is moved. Other scripts respond to observers. Your example of a while loop is a classic example of an infinite loop. If SU gets caught in an infinite loop (eg. your while loop with no output), it will crash.

      I hope this helps explains the current problem. I don't have much experience with timers, but read the thread Thom suggested and hopefully you'll find some answers there.

      Good luck.

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Sketchup 8 Patch ETA

      Thanks.

      posted in Developers' Forum
      K
      kwalkerman
    • Sketchup 8 Patch ETA

      Some of us are breathlessly awaiting the patch for SU 8, which fixes the raytest bug, etc. is there an ETA for this item?

      Thanks!

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Inverse Selection - where is it?

      I recently wrote a plugin that will hide all unselected entities:

      http://forums.sketchucation.com/viewtopic.php?t=31378

      For some of you, this is what you are trying to accomplish by inverting the selection.

      I'm pretty sure I first inverted the selection, and then hid geometry, so you are welcome to look at the code and modify (or add a menu option).

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Application Observer

      Any ruby file that exists in the plugins folder will run when SketchUp starts. So, if you want the web page to open every time someone opens SketchUp, not when a new file is open, you can do something like this:

      
      wd = UI;;WebDialog.new("My Page", true)
      wd.set_file(Sketchup.find_support_file("my_html.html", "Plugins"))
      wd.show
      
      

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: FaceMe - Ruby\SU bug?

      Something similar happens when you create a new group inside an existing group that consists of existing components. See this thread:

      http://forums.sketchucation.com/viewtopic.php?f=180&t=31443&p=276973&hilit=kwalkerman#p276860

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Duplicate "edit component" with api methods.

      Jim,

      there are some things that can't be done from Ruby without changing the work context. This includes creating a sub-group out of existing components.

      ...

      If you want to return control to the user, I think you would have your code do some stuff, then use an observer to wait for the user to complete some set of actions, OR have the user do a whole bunch of stuff, then click a button when complete, and let the code finish.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Selecting All Visible Faces

      I'm not sure what your end goal is here, but with SU pro, you can export as a 2D drawing into all kinds of formats, DWG included, which will show you only the current view.

      It would be nice if the camera object had an "all_visible" function... but as far as I know, it doesn't. The only way I know to find objects that are visible, is to do model.raytest, which is time consuming, and only tests one ray at a time.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Get objects at specified poitn

      Chris,

      you made my day, I'll stop worrying about it then.

      Thanks!

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Get objects at specified poitn

      I think just vertices would be ok, but some of them are nested components, and I'm trying to avoid running through all components to create a database... having raytest return hidden entities is really messing me up!

      Not sure if there's a way to do it with a view and pickhelper, or something like that... I'm not so familiar with those methods.

      posted in Developers' Forum
      K
      kwalkerman
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 4 / 8