sketchucation logo sketchucation
    • Login
    1. Home
    2. artmusicstudio
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 84
    • Posts 217
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Transformation of single entities ???

      hi everybody,
      thanx for this interesting discussion,

      and yes, tig's way worls perfectly, so it is possible to immitate the mouse movement of single entities in any angle and direction.
      fantastic!

      
      
                      new_line10 = entities31.add_line pts[1], pts[0]
      		tr = Geom;;Transformation.rotation(pts_senkrecht1,@vector,@angle_m.degrees)
      		group31.entities.transform_entities(tr, new_line10)
      
      #MOVE 1 FACE  >>>> number
      						
      		distance_m_result = @carrier_w *@totaloffset_x_center/@run 
      		vector2 = new_line10.line[1]
      		vector2.length = distance_m_result.abs
      		
      		tr = Geom;;Transformation.translation(vector2)
      		group31.entities.transform_entities(tr,group31.entities[number])
      				
      
      

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Transformation of single entities ???

      hi,
      again i cannot really find a solution in the api-description:

      when i have a group of 100 entities (edges and faces) and i know, that entity(50) is always the one i have to transform (it is a face),

      how can i MOVE this face (like with the mouse) , so that all connected edges and faces adapt automatically?

      i have the distance, the vector and the number of the entity.

      thanx for helping!
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Active_model.merry x-mas.entities.send_to_all

      merry x-mas to all helpers in the forum.

      thanx a lot!

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Coordinates of a vector-cross-point?

      πŸ˜„
      oh yes, and how it went......i am just about to begin to understand the basics.

      but i am proud of having the first version of my ruby nearly finished. the code is still more linear then intelligent, but will be improved step by step.

      and one day, who knows, i also can deal with metrices in the 5th dimension.

      merry x-mass

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Coordinates of a vector-cross-point?

      hi and thanx, this is interesting, for me still a bit too high, although i understand it basically, but the time will come.....

      btw., i could solve my problem and can now generate points at the cross-point of lines (from edges).

      thanx to all, once again.
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: How do I represent and keep a track of cuboids I create?

      edit:
      found out:
      edges are numbered first
      then the faces (depending on the order of the edges...
      so it is rather easy to point out, which numbers are for the faces and delete thems selectivlely.
      stan

      hello,
      maybe i may expand this topic a bit:

      i just look for a way, how to identify the single faces on a cuboid (let's say, it is a cube, so it has 6 faces).

      i would like to delete two of the four vertical faces,
      so i cannot identify them by the normal vector only (just excluding the vertical ones).

      since the element are turned in different angles, also x- or y- direction is also not the exclusive factor.

      so:

      is there a way to find out the number of face (face 0 .. 5) somehow, to be sure, that these faces have always this number 'in the row' and then i could delete them by

      face[x].erase! in EVERY 6-FACE-CUBOID

      or something like that.

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Code problem between windows-versions ??

      hi,
      problem solved, it was sketchy physics. i will try to redifine my code later, maybe i will find the problem.
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Ruby panel on/off

      @tt_su said:

      I remembered I'd been messing around with this myself a while back. For reference:
      https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-220

      https://bitbucket.org/thomthom/tt-library-2/src/80af18d802d2576f54016d3c48f61a5a31fc6fd9/TT_Lib2/win32.rb?at=Version%202.9#cl-380

      hi,
      from here the links are broken.
      maybe only free for the "expert group" ?

      regards stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Code problem between windows-versions ??

      hi tt, although i synchronise the plugin-folders carefully,
      making the win7 folder empty in deed was the solution.

      so now i have to find out , which plugin has a conflict and can correct my code.

      it was the first time, something like that happend. interesting!

      thanx a lot for your "expert's eye".

      stan

      ps: i just wonder, where to send all the cookies afterwards,,,,

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Code problem between windows-versions ??

      hi,
      i have a strange problem:

      in windows vista / skp 8 and skp 6 this peace of code (within the whole ruby) works perfectly (the group is copied, named and transformed copy-times:

      
      angle = @arena_angle_half*2
      		puts angle
      
      		entities = @group_stair.entities
      		group_arena = entities.add_group
      
      			for copy in 1..@arena_angle_devider
      			angle1 = copy *  angle
      			group = @group_stair.copy
      3863			group.name = "arena-copy" + copy.to_s
      			tr = Geom;;Transformation.rotation(point,vector,angle1)
      			@entities2.transform_entities(tr, group.entities.to_a)
      			end
      
      

      to my surprise, it does not work on

      win 7 / skp 8
      win xp / skp 8

      this error is reported in the console

      Error: #<NoMethodError: undefined method name=' for nil:NilClass> C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:3863:in arena'
      C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:3860:in each' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:3860:in arena'
      C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:212

      has anybody an idea, what this problem could be?

      thank you very much!

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Ruby panel on/off

      hey, very good idea to go with win.api

      i use this trick in my excel basic sound database to controll external programs from the code.
      i will try tonight and report!

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Coordinates of a vector-cross-point?

      hi tt & tig,
      thanx for that, i am going to dive now into the deep space line for the edges and hopefuly come back much smarter than before!

      thanx for the great help!!! what would all the ruby - manuals be without you all in this forum....

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Coordinates of a vector-cross-point?

      hi tt,
      yes, i was just about to put edit 2 in the text:

      
      entities2 = Sketchup.active_model.entities
      @centerpointline_left = entities2.add_line @bottom_c_point1_l,@bottom_m_point2_l
      @centerpointline_right = entities2.add_line @bottom_c_point1_r,@bottom_m_point2_r
      
      point = Geom.intersect_line_line (@centerpointline_left, @centerpointline_right)
      
      

      the lines are created, the crosspoint is there (can catch a line),

      but ruby conole still reports

      "
      Error: #<TypeError: wrong argument type Sketchup::Edge (expected Array)>
      C:/Program Files/Google/Google SketchUp 8/Plugins/01.rb:3783:in intersect_line_line' C:/Program Files/Google/Google SketchUp 8/Plugins/01.rb:3783:in top_handrails'
      C:/Program Files/Google/Google SketchUp
      "

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Coordinates of a vector-cross-point?

      hi,
      when i generate a crosspoint from two lines:

      
      ector = @centerpointline_left.start.position.vector_to(@centerpointline_left.end.position)
      vector.length = @centerpointline_left.length
      vector2 = @centerpointline_right.start.position.vector_to(@centerpointline_right.end.position)
      vector2.length = @centerpointline_right.length
      v = vector.cross vector2
      
      

      where the centerpoint-lines are 100% crossing,
      i get the point v (sort of virtual point, i think).

      but now i would like to place a c_point at this position

      this:

      
      point1 = Geom;;Point3d.new v
      
      

      does not work.

      also the

      
      d = vector.dot vector2
      
      

      does not give me the point.

      thanx for helping.
      stan

      edit 1 : now i understand, that v is also a vector. the problem is still, how to place the 3d-point!

      thanx for ideas.

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Ruby panel on/off

      hi,
      is there a way to hide the ruby panel from the code?

      switch on: Sketchup.send_action "showRubyPanel:" works.

      switch off : Sketchup.send_action "hideRubyPanel:" ?????

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Help needed with sin, cos &amp; co...

      hi tig,
      great , good formulas for further studies.
      my code works now, by the way.

      just to precise my informations:

      i understand, that "atan" only works for right-angled triangles (one angle = 90 degrees),
      but: is the sum of angles not 180 degrees in all triangles?
      so the criterium is the right angle, not the sum of 180 Β°, right ?

      "jumbling up radians and degrees [again]" _:)
      yes, i still sometimes mix it somehow, but i try to keep all calculaction in skp-origin
      and only to display in the console in degrees. seems to work now! _ πŸ˜„

      so thanx again, all your tips makes my learning much easier!

      btw.: when a beta of the ruby is done and i made my tests, do you think, you and maybe somebody else , too, could check it on his machine?

      i have lots of rubys in my sketchup, so the compatibility here is ok, but who knows...!!!

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Help needed with sin, cos &amp; co...

      hi there,
      so i stick in place with a math-problem:

      let us assume, i have

      two lines in a traingle defined with
      a1
      b1

      i can count the angle by

      
      @mainangle_l = Math;;atan(a1/b1).radians
      
      

      puts also gives me the right angle in the console (compared with the drawing = check)

      in the next step i have to calculate another triangle, same angle, but have values
      @mainangle_l
      c2

      BUT

      
      a2 = c2 * Math.sin(@mainangle_l))
      
      

      does not give me the right value for a2

      i tried different variations of the syntax, but no way to get it.

      obviously i define the Math-function in a wrong way. but in the api, i canot find examples.

      can anybody help fo rgeneral understanding of trigon. functions??

      thanx a lot!!!

      stan


      131215.jpg

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Transformation (copy) by vector and distance ?

      hi tig,
      thanx so much, but this one really makes me crazy.....

      what ever i do , the move! - instructions MOVES but does not copy, it's magical...( i tried all your codes, the code from the api....)

      my code so far ( i am on the level of @entities2 (coming from a method above this one)

      
      new_line1 = @entities2.add_line @rl1a, @rl2a # define line for vector
      length = new_line1.length
      #									
      rasterarray_h = length.divmod(5.0/@faktor/@teiler_cm )
      raster = length / rasterarray_h[0] # calculate gap between verticals ( == true length)
      #
      # so the raster is the 3d-distance on the vector from new_line1
      #
      group = @entities2.add_group
      entities_stab = group.entities
      @rl1a = [(fl)*  const1+var2*var3  , (fl)*  const2+var4 , 0 + (fl)*(@pmod * @rise)+@railsgapunten]
      @rl2a = [(fl)*  const1+var2*var3  , (fl)*  const2+var4 , 0 + (fl)*(@pmod * @rise) + var6+@railsgapunten]
      #
      edge = entities_stab.add_line @rl1a, @rl2a # create 1st vertical
      #			
      #entities = @entities2 # tried this, too..
      #			
      for v_line in 1..rasterarray_h[0]
      #			
          vector = new_line1.start.position.vector_to(new_line1.end.position)
          distance = v_line*raster
          vector.length = v_line*raster/2
      #
          group2 = group.copy
          group2 = group.move!(vector)  
      # and the line is moved, not copied....or the original group disappears? there shold be lots of vertical lines in distance of "raster".....
      #			
      end
      #
      
      

      grrrrhhh....
      i make a break now, the brain is just about to explode.......πŸ˜„

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Basic understanding of instances ???

      hi,
      i would like to discuss the basic structure of how skp works:

      i normaly generate a model per ruby (some elements in some groups and some components) , which are all packed

      in a master group.

      so i can delete the whole thing by deleting the master group from ruby.

      ok.

      when i again genarate the object with same parameters, the components have additional numbers ( like
      @m_pf_l#27 , while starting with @m_pf_l before 1st delete.)

      so what happens? if i delete the master group WITH all components in it, does sketchup keep a table of names of deleted compnents or even all the components ??? my file gets bigger after a certain time, so maybe this is also a point.

      so is is possible to purge the file from ruby , but to purge only the elements from the latest deleted group?
      or shal i somehow delete or component instances WITHIN the master group, before deleting the master group itself?

      i found this in the forum:

      Sketchup.active_model.definitions["CompoName"].instances.each{|e|e.erase!}, but don't know, if it will work for the master group only , or delete also its copies, which the user wants to keep.

      thanx
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Naming of new colours ??

      hi tig,
      understood, works perfect !

      
      model = Sketchup.active_model
      materials = model.materials
      
      names = ["zf_carrier", "zf_step", "zf_landing", "zf_fill", "zf_wange", "zf_pfosten", "zf_handlauf", "zf_bars", "zf_topstift", "zf_railplate"]
      
      color_val = [[112,128,144],[200,220,200],[230,230,230],[100,120,100],[255,0,0],[0,255,0],[0,20,255],[10,10,10],[60,180,180],[0,206,209]]
      
      zf_c = 10
      	for col in 0..zf_c-1
      		if @pref2 == "no" #option for the user for coloured screen output (in my ruby-preferences)
      	        material_name = names[col]
      			unless material = materials[material_name]
      			material = materials.add(material_name)
      		        end
      		material.color = Sketchup;;Color.new color_val[col]
      
      		elsif @pref2 == "yes" #option for the user for monochrome screen (in my ruby-preferences)
      		material_name = names[col]
      			unless material = materials[material_name]
      			material = materials.add(material_name)
      		        end
      		material.color = Sketchup;;Color.new(230,230,230)
      	end
      end
      
      

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 10
    • 11
    • 5 / 11