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

    tictactoe

    @tictactoe

    10
    Reputation
    1
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    tictactoe Unfollow Follow
    registered-users

    Latest posts made by tictactoe

    • Sketchup-Version and SUModelSaveToFile

      I'm making tests with the 'Writing to a .skp file'-sample http://www.sketchup.com/intl/en/developer/su-api/index.html.

      Is there a way to determine the Sketchup versionthe saving with SUModelSaveToFileshould be done?

      Thanks.

      posted in Developers' Forum
      T
      tictactoe
    • Get Group Owner

      The following Code makes groups in groups.

      	
      width = 200
      depth = 100
      pts = []  
      pts[0] = [0, 0, 0]  
      pts[1] = [width, 0, 0]  
      pts[2] = [width, depth, 0]  
      pts[3] = [0, depth, 0]  
      	
      model = Sketchup.active_model
      
      g1 = model.entities.add_group 
      g1.entities.add_face pts
      g1.transformation = Geom;;Transformation.new([10,0,10])
      	
      g2 = g1.entities.add_group 
      g2.entities.add_face pts 
      g2.transformation = Geom;;Transformation.new([20,0,20])
      
      g3 = g2.entities.add_group 
      g3.entities.add_face pts 
      g3.transformation = Geom;;Transformation.new([30,0,30])
      	
      puts "model; " + model.entityID.to_s
      puts "g1; " + g1.entityID.to_s
      puts "g2; " + g2.entityID.to_s
      puts "g3; " + g3.entityID.to_s
      	
      puts "g3.parent; " + g3.parent.entityID.to_s + ", " + g3.parent.class.name
      puts "g3.parent.parent; " + g3.parent.parent.entityID.to_s + ", " 
            + g3.parent.parent.class.name
      puts "g3.parent.parent.parent; " 
            + g3.parent.parent.parent.entityID.to_s + ", " 
            + g3.parent.parent.parent.class.name
      
      

      And results in

      model; Model
      g1; 25
      g2; 49
      g3; 73
      g3.parent; 40, Sketchup;;ComponentDefinition
      g3.parent.parent; 3, Sketchup;;DefinitionList
      g3.parent.parent.parent; Model, Sketchup;;Model
      

      Now question:
      Given g3, how can I get the owning/creating group g2 by code? g3.parent is not the right way.

      posted in Developers' Forum
      T
      tictactoe
    • RE: Own Dynamic Component supported function

      The

      @source_entity 
      

      was the key. No echo!

      And get_attribute should only read values and not mess the dictionary.

      posted in Developers' Forum
      T
      tictactoe
    • RE: Own Dynamic Component supported function

      I found it. With

      @source_entity.get_attribute("dynamic_attributes", "somekey") 
      

      you can access the dictionary-values.

      posted in Developers' Forum
      T
      tictactoe
    • Own Dynamic Component supported function

      Whith the DC function CURRENT you can access the dynamic dictionary value 'LenX' of the component:
      =CURRENT("LenX")/2

      How can I make a similar function and access the dictionary?

      class DCFunctionsV1
      protected
      def mycurrent(param_array)
      # Question:
      # WHAT CODE IS NEEDED HERE TO ACCESS THE DICTIONARY?
      #
      end
      end

      posted in Developers' Forum
      T
      tictactoe
    • Set new value of Dynamic Component Attribute and recalculate

      I want to modify the value of a dynamic component not via property dialog but by ruby code.
      How can do that and enforce afterwards a recalculation of the component instances?

      Eg.: The Component makes the attribute 'copies' user-changeable. I want to define this value and the component should rebuild the instances.

      posted in Developers' Forum
      T
      tictactoe