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

    Topics

    • H

      Webdialog visible/open?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      193 Views
      Dan RathbunD
      @hgroeneveld said: What is passed to " def initialize(show_dialog)"??? The initialize() method is an "internal" Ruby method that all Ruby class objects have. IF you do not override it, the class just inherits a copy from it's superclass. This initialize() method is called automatically by Ruby at the end of the new() class constructor method, after new() has created the instance. Realize that initialize() is an instance method, and new() is a class method, therefor new() calls the initialize() instance method, in the instance object, that it just created, passing along the entire argument list it itself received. So when you do: @dlg = ShowDialog.new("Plugin Options") The new() method (internally,) will create the new instance of the ShowDialog class, (referenced internally as obj,) and THEN call the new instance's initialize() instance method, passing it the string argument "Plugin Options", like: obj.initialize("Plugin Options") Lastly, the new() method returns it's internal local reference to obj, which you then assign to a reference in the outer scope. In the example above, that reference is the @dlg variable. @hgroeneveld said: I put a msgbox there, but it never gets triggered... UI.messagebox() is a Ruby method, that when evaluated (after the messagebox closes,) returns nil, so in effect you would be passing nil into the initialize() method. So.. whatever arguments that you want to pass into the new instance, at creation time, are passed via the class constructor method new(), and YOU must override the instance method initialize() in order to process those arguments, whatever they may be. (Usually by assigning them to instance variables that the instance will later use.) This is all in Ruby, Part I, Chapter 2, Classes, Objects, and Variables
    • H

      Intersecting and Attribute inheritance

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      299 Views
      TIGT
      Put very simply we need to see what face is under what point. We find all of the 'combined faces' in group3 [after the explosion of copies of group1 and group2 we added into it] - an array which I named faces3. Each face in faces3 has vertices, we consider the first one in each case = vertices[0], we find it's .position, we offset that position a little and rotate it around the Z_AXIS and the vertex.position by steps of 1.degree until we know it's on the 'face'. That's the classify_point method. So now we have a point we know is on the face. We test all of the faces in faces1 until we get on that 'contains' the point - we remember its 'Plot' attributes. We test all of the faces in faces2 until we get on that 'contains' the point - we remember its 'Zone' attributes. We add new attributes [Combo] to 'face' combining these two sets of attributes... You could probably do with testing group1 and group2 faces for both attribute dictionaries, since you can't be sure which group is which in the selection - unless they have 'names' that tell us?
    • 1 / 1