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: [Info] Allowable Classes for "set_attribute"

      Dan,

      For applications I can think of, this is actually an advantage, especially if you are using attributes between sessions, as the 'entity' attached to your particular point3d would be lost. AND, it works just like any other key for attributes.

      string1 = "My Attribute"
      string2 = "My Attribute"

      entity.set_attribute "a", string1, "q"
      entity.get_attribute "a", string2 ==> "q"

      string1 and string2 are different objects, but both can reference the same attribute dictionary.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: [Info] Allowable Classes for "set_attribute"

      Dan,

      Good point. A quick check indicates that any point with the same x,y, and z values can access the attribute.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: [Info] Allowable Classes for "set_attribute"

      yep, vectors work too. I wonder about the other Geom classes (although transformation doesn't work, I just tried it).

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: [Info] Allowable Classes for "set_attribute"

      Nice. I just tested it as well. I'll add it to the list.

      It also seems to work as an attribute dictionary key:

      p1 = Geom::Point3d.new(1,2,3)
      p2 = Geom::Point3d.new(4,5,6)

      entity.set_attribute "k", p1, p2

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Custom Dynamic Component Functions = Ruby links

      Cool!

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Smooth Curve

      Absolutely!!! I would like to be able to start with either an ArcCurve, or just a curve.

      I have Fredo's bezier curve plugin installed, but I don't know how I would use it in this instance. Can you walk me through the steps a bit more?

      Thanks so much,

      --
      Karen

      EDIT: Oh, wait, the polyline divider is what does it. I think I can take it from here. Thanks for the clue.

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Inherit from Sketchup Classes

      @pierreden said:

      I would love to be able to make my own My::Point3d class with additional methods, and still be able to use My::Point3d together with Geom::Point3d without errors.

      The other option is to extend an instance of a Point3d...

      
      module YourPoint3d
      attr_accessor ;your_var1, ;your_var2
      
      def your_def1
      end
      def your_def2
      end
      end
      
      p = Geom;;Point3d.new
      p.extend YourPoint3d
      p.your_var1 = 20
      

      This gives your particular Point3d additional methods and attributes without messing with the Point3d class at all.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • Smooth Curve

      I would like to be able to convert a curve into a similar curve where each line segment is a known length. Any ideas on how to achieve this?

      Thanks,

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Inherit from Sketchup Classes

      I ran some simple tests in the webdialog Ruby Code Editor. It seems that creating a sub-class has a number of issues (although some may be specific to the webdialog code editor):

      1. In my example, none of the code created within the sub-class was executed
      2. You can extend the parent class and create new methods, but any new methods in the sub-class are not recognized.

      how about doing the following (taken from an example found here: http://railstips.org/blog/archives/2009/08/07/patterns-are-not-scary-method-missing-proxy/)

      
      
      class MyVector
      attr_reader ;v
      attr_accessor ;wt
      def initialize(x,y,z,wt)
        @v = Geom;;Vector3d.new(x,y,z)
      end
      
        private
          def method_missing(method, *args, &block)
            args = args.collect{|a| a.v if a.is_a? MyVector}
            @v.send(method, *args, &block)
          end
      end
      
      
      

      This takes care of the following scenario:

      myVector1.angle_between myVector2

      Although, this doesn't take care of what happens if you send a MyVector instance to another Sketchup class, such as

      t = Geom::Transformation.new(myVector1) --> returns error

      --
      Karen

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

      Thanks TIG.

      TT - I revisited your observers chart page after posting the initial message. Definitely very helpful. Thanks for maintaining it.

      --
      Karen

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

      ...
      except that onInstanceRemoved doesn't fire
      and onInstanceAdded doesn't fire for a delete-undo event

      ... I think I'm going back to entities observers... seems more stable in SU8

      posted in Developers' Forum
      K
      kwalkerman
    • Definition Observer

      Hello,

      I'm trying to use definition observers in a script instead of multiple entities observers because they seem to be a little more stable. There are a number of quirky things about it, but one that I haven't been able to work around is as follows:

      When I add a component instance to the model, the onComponentInstanceAdded method fires. However, if I delete the component instance and then undo, onComponentInstance added does NOT fire. I need to be notified both of new instances and of instances that are back from the dead.

      Any ideas?

      Thanks a bunch,

      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Execute_script trouble

      Not sure if this is what is tripping you up, but I usually use a ";" at the end of my javascript command. JS is pretty picky about semi colons:

      js_update_command = "UpDateVisionList("+ updated_visions_div +");"

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Adding attributes help

      Also, I have found that in the following:

      hash = {"q"=>"t"}

      value = face.set_attribute("a","b",hash)

      value == hash

      however, as the Hash class is not a valid attribute type for set_attribute, face.get_attribute("a","b") is nil.

      I'm not sure why a valid value is returned, but this could also explain what is happening.

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Adding attributes help

      in your latest example, you would read the attribute as follows:

      face.get_attribute("agw_attributes", "location)

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Webdialog Question on .show

      A webdialog is an object that presumably has variables of its own, one of them most likely being the current url.

      In order to show the start page every time you show the dialog, you can reset the html path either straight in ruby, (WebDialog.set_html), or you can use onfocus or onload in the html file to load information.

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: Few Quick Question for Tool
      1. I have found webdialogs far more useful than the standard UI options. Post questions here when you get into it. Passing information back and forth has its challenges.

      2. You can do Model.set_attribute, and you are allowed to save arrays of data. See this thread: http://forums.sketchucation.com/viewtopic.php?f=180&t=30066 for information about what types of data are allowed in set_attribute. I've found that set_attribute is by far the best way to save data between sessions. This way the data is saved even if the file name is changed, the file is moved, or the file is edited by a user that does not have your plugin.

      3. No Clue. I'm sure someone else will have an answer for this.

      Good luck!

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: I saw plugin for selecting objects with material

      @didier bur said:

      Besides all this, isn't it a built-in function ?

      This only captures elements in the currently active entities collection. My plugin also searches for that material in any sub-components or groups.

      EDIT:
      It also doesn't work on the default material.

      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: I saw plugin for selecting objects with material

      It might be my material selection plugin found here: http://forums.sketchucation.com/viewtopic.php?f=323&t=31378

      --
      Karen

      posted in Developers' Forum
      K
      kwalkerman
    • RE: [Plugin] Select by Material, and Hide All Unselected

      Right now it looks only at the front side. I could do another run that looked at the back side, if that would help?

      posted in Plugins
      K
      kwalkerman
    • 1 / 1