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

    Topics

    • P

      Component automatic placement

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Discussions sketchup
      5
      0 Votes
      5 Posts
      111 Views
      GaieusG
      Ah yes, geolocated models, surely.
    • P

      [Code]Text label system

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      150 Views
      TIGT
      Plain variables, or perhaps more correctly 'references', [e.g. x] are only used/changed in their specific def [method] that defines them. Ones starting with @ [e.g. @x] - their current value is accessible to all methods during that instance of the class/module. Any method can define or redefine them, Ones starting with @@ [e.g. @@x] are similar to @ ones, BUT their current value is remembered across multiple uses of that class/module - e.g. good for remebering values last used in dialogs. They need to be 'declared' outside of any method, but after that any method can then redefine them. Constants [starting with a capital letter, or commonly with all caps, e.g. Z_AXIS] are similar to @@ ones, they are remembered across all uses of that class/method, BUT they are not readily changeable - because they are 'constants'! Move your 'start_operation' out of the iteration block [to match the 'commit_'] that way all we become 'undo-able' in one go. The selection.each{} block adds a piece of text to every selected object when the code starts. However, the Sketchup.send_action("selectSelectionTool:") will stop more that one iteration. It simply exits the tool and activates the 'Select' tool. If you want to be able to 'pick objects' in turn you will need to [re]write/launch this as a proper Tool... this will involve getting input-points, reading mouse-positions and mouse-clicks etc... Then using those for new text objects etc... See the API and examples - 'linetool.rb' etc - for some Tool method ideas/examples... Or other authors' tools' .rb files - like say some of my 2dTools... There is limited access to 'Text' objects' properties through the API - see the relevant pages - http://code.google.com/apis/sketchup/docs/ - height is not one of them - unless you make it as '3d-text'... It's a long standing request...
    • 1 / 1