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

    Posts

    Recent Best Controversial
    • RE: Ruby access to photo match image?

      @jim said:

      If you use the image as an "Image", then you will have total control over it - position, scale, transparency, visibility, etc. That may actually work in your favor.

      Nice work Jim testing out that DisplayWatermark option to show that the match photo image is something special.

      I intend to use an Image object for exactly the reasons you say. It would have been nice to construct it from a match photo image though. My vision of my new workflow is to use the existing Match Photo tool to get an initial alignment for an image with a model. Then use my new tool to refine the image alignment. It will seem hokey when I have to ask the user "could you please load that same image you loaded before for me now, with this other tool?".

      posted in Developers' Forum
      C
      cmbruns
    • Ruby access to photo match image?

      I'm interested in creating new ways to match photos in Sketchup 7. Does anyone here know how to access the photo image created with "File->Import->Use as new matched photo" from ruby?

      The photo does not appear to be part of the model. See for yourself:

      1. Load a new matched photo into an empty model.
      2. Open the ruby console "Window->Ruby Console"
      3. Type
      Sketchup.active_model.entities.length
      

      The answer is 0 (zero), suggesting that the photo is not a geometric part of the model.

      The photo appears to be associated with the scene tab. In ruby the scene tab is a Page object. I don't see anything in the possibly obsolete ruby API docs for Page that suggests access to a photo image. To double check, I tried to take advantage of ruby's introspection methods.

      
      page = Sketchup.active_model.pages[0]
      page.methods
      
      

      yields

      @unknownuser said:

      ["to_a", "set_attribute", "instance_eval", "typename", "add_observer", "type", "protected_methods", "style", "extend", "use_camera?", "use_hidden=", "eql?", "instance_variable_set", "is_a?", "hash", "to_s", "get_attribute", "valid?", "remove_observer", "use_style?", "use_camera=", "camera", "class", "tainted?", "private_methods", "parent", "hidden_entities", "untaint", "use_style=", "description", "deleted?", "use_hidden_layers?", "id", "label", "inspect", "attribute_dictionary", "delete_attribute", "description=", "layers", "clone", "public_methods", "use_axes?", "use_hidden_layers=", "transition_time", "model", "freeze", "display", "respond_to?", "id", "transition_time=", "methods", "==", "method", "use_shadow_info?", "use_axes=", "===", "nil?", "dup", "instance_variables", "instance_of?", "delay_time", "rendering_options", "send", "attribute_dictionaries", "name", "update", "use_rendering_options?", "entityID", "use_shadow_info=", "use_section_planes?", "delay_time=", "object_id", "name=", "=~", "singleton_methods", "send", "equal?", "taint", "use_rendering_options=", "frozen?", "instance_variable_get", "use_hidden?", "use_section_planes=", "set_visibility", "shadow_info", "kind_of?"]

      That's probably too much to digest; I don't see anything like "watermark_image" there. I wish ruby had the same sort of baked in API documentation that python has, so we wouldn't have to rely on our overworked Sketchup heroes to publish API documentation for us. But no. Like most other languages, ruby API documentation is in the comments, and thus unavailable from the run time environment.

      OK. So it's not in the model, and its not in the Scene/Page. Perhaps it is in the Style.

      Sketchup.active_model.styles[0].methods
      

      @unknownuser said:

      ["to_a", "set_attribute", "instance_eval", "typename", "add_observer", "type", "protected_methods", "extend", "eql?", "instance_variable_set", "is_a?", "hash", "to_s", "get_attribute", "valid?", "remove_observer", "class", "tainted?", "private_methods", "parent", "untaint", "description", "deleted?", "id", "inspect", "attribute_dictionary", "delete_attribute", "description=", "clone", "public_methods", "model", "freeze", "display", "respond_to?", "id", "methods", "==", "method", "===", "nil?", "dup", "instance_variables", "instance_of?", "send", "attribute_dictionaries", "name", "entityID", "object_id", "name=", "=~", "singleton_methods", "send", "equal?", "taint", "frozen?", "instance_variable_get", "kind_of?"]

      I don't see anything suggestive there either.

      Suggestions for new avenues of investigation are much appreciated.

      posted in Developers' Forum
      C
      cmbruns
    • Linear algebra plugin and dissemination

      In the course of trying to make some new photo matching tools, I installed the ruby linalg library (http://rubyforge.org/projects/linalg/) in my Sketchup plugins area. It occured to me that it would have saved me some time if the linalg library had already been available as a Sketchup plugin. It's not exactly rocket science putting all the files in the right places, but it did take me some time to figure out.

      1. Does this even count as a plugin, and would others be interested in having it?

      2. Is there a web site where free plugins can be distributed?

      posted in Developers' Forum
      C
      cmbruns
    • RE: Watermarks with Ruby?

      @unknownuser said:

      If you go to Help -> Ruby Help inside SketchUp, that should take you to the V7 ruby doc. You could perhaps figure out how to code up a google search to scan the online help doc for "watermark". I'm sure there's a way to do it.

      Believe me I have summoned arcane google magicks to find information about managing watermarks in sketchup ruby. But I have failed in my quest. Plus, as Chris Fulmer pointed out, there is no "Help->Ruby Help" menu in my sketchup (version 7.0.8657)

      Perhaps I could hijack this otherwise stale thread to ask for more general advice about what I would like to do: I am interested in getting access to the images used as backgrounds in the scene tabs that are created when using the "match photo" feature. Are these images even watermarks? I foolishly imagine that I will be able to create additional photo matching features if I can gain access to these images. One thing I would like to do is use Overlay watermarks in addition to Background watermarks for photo matching. Including automatically varying transparency/visibility during the photo matching work flow. Are there already existing "match photo on steroids" tools available?

      posted in Developers' Forum
      C
      cmbruns
    • RE: Watermarks with Ruby?

      @unknownuser said:

      Now, don't laugh, but I would have to actually download and install SU V7 to be able to answer that question.

      OK. Please don't laugh back at me; I am new to Ruby in Sketchup. As I have installed SU V7, what steps should I take to investigate whether there might be watermark manipulation support in V7?

      I browsed the API documentation at http://code.google.com/apis/sketchup/docs/developers_guide/index.html, but saw nothing obviously related to watermark images. It is unclear to me what version of Sketchup those docs refer to.

      Can I view current API documentation from within Sketchup?

      -Chris Bruns

      posted in Developers' Forum
      C
      cmbruns
    • RE: Watermarks with Ruby?

      @unknownuser said:

      No can do. The good news is that it's on the slate for V7.
      Todd

      Can watermarks be manipulated via Ruby in V7? I would like to do so if it's possible. Now that Sketchup V7 is out.

      posted in Developers' Forum
      C
      cmbruns
    • RE: [ruby doc] UI.messagebox - can't set title

      The messageboxname argument works with MB_MULTILINE messagebox type, but not with the presumably more frequent MB_OK type, which is the default.

      Bug. Annoying.

      posted in Developers' Forum
      C
      cmbruns
    • 1 / 1