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 (copy) by vector and distance ?

      hi dan,
      i came now back to this part of the ruby.
      is it possible to COPY instead of MOVE somehow? i tried several things, but ther is no

      group.copy!

      obviously in the ruby syntax.

      the trial of mine:

      
      #within a bigger loop  >>> FL
      #.....
      new_line1 = @entities2.add_line @rl1a, @rl2a # define line for vector
      length = new_line1.length
      #									
      rasterarray_h = length.divmod(5.0/@faktor/@teiler_cm ) # gaps shall be near 5 cm
      raster = length / rasterarray_h[0] # calculate gap between verticals ( == true length)
      #							
      @stab = @entities2.add_group
      @stab.name = "stab_senkrecht"
      entities_stab = @stab.entities   # the group to be copied along new_line1
      
      @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 in the group
      #			
      puts "#{__LINE__} ; edge created"
      puts "#{__LINE__} ; raster ; #{raster}"
      puts "#{__LINE__} ; length ; #{length}"
      puts "#{__LINE__} ; rasterarray_h[0] ; #{rasterarray_h[0]}"
      #			 
      for v_line in 1..rasterarray_h[0] # copy group along new_line1 in distance raster
      #puts v_line
      vector = new_line1.start.position.vector_to(new_line1.end.position)
      vector.length = v_line*raster # every step 1 raster more
      #@stab.move!(vector)   # TRIAL 1 ???????
      #@stab.parent.entities.transform_entities( vector, @stab )   # TRIAL 2 ???????
      			
      end  # v_line loop
      
      
      

      thanx for helping again. copying in 3d by distance would be a great step further......

      stan

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

      hi there,

      i declare my colours to my group's elements like this:

      
      @c_carrier = Sketchup;;Color.new(112,128,144)
      #
      @group41.entities.grep(Sketchup;;Face).each{|f| f.material=@c_carrier }
      
      

      wherever i looked for it, i cannot find any syntax for asigning additional colour-name , which appears in the colour-list (model's materials).

      a name is important in the dae-transfer to a vis-software, so i would like to create unique names for fixed material asignment in my vis.

      any idea?

      thanx a lot
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Setting the save path for files ???

      hi dan,
      that's exactly, what i ment.
      i want to restore the user file path after my ruby finished it's job.
      perfect!

      thank you very much, also for the other system variables, very useful for future development.
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Setting the save path for files ???

      hi dan,
      yes, this is for saving sketchup models from the ruby, right?

      but skp seems to use the last use directory for saving ( in my case MY save function for my ruby parameters) of further files, like autobackup. they all appear now in the ruby directory.
      so can i define somewhere the system variable for the save directory, whithout saving a model file myself ?

      means, restoring the value of model path from 'old path' by setting a value only?

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Setting the save path for files ???

      hi,
      here is a small one :

      retrieve file path works:

      
      model = Sketchup.active_model
      @local_user_path = model.path
      puts @local_user_path
      end
      
      

      but how can write back the path, when it was changed by save-operations from my ruby, so that
      autobackup writes its files to the original file directory and not to the plugin folder ??

      no "set_path" function in the model class found....

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Global scaling in skp 8

      hi,
      i got an model to work on, which is oversized (factor ca. 20,4243). when i want to scale it (measure tool and entering a length),
      sketchup reports, that

      components loaded from external files will not be scaled (free translated).

      so is there a way to scale the whole thing without doing it manually with the scale tool?

      thanx stan

      posted in SketchUp Discussions sketchup
      artmusicstudioA
      artmusicstudio
    • RE: Help adding arc in ruby script

      hi tig, ok,
      let's play with some formulas πŸ˜„
      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Axes-tool coordinates

      hi everybody,

      during my search i did not find newer topics then from 2009 , and at least no solution for

      retrieving the relative coordinates (to abs. 0,0,0) of the user-axes-system (axes-tool).

      i would like to let the user place the ruby-generated object

      at the axes-tool-coordinates (means: in place, where he draws now) instead of absolute 0,0,0.

      is there another way to define the insert point of a ruby generated model?

      i cannot find anything in the api (search : transform, move, axes etc.)

      thanx a lot
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Asigning colours to elements

      hi dan, thanx,
      next step is done!
      this one works:

      
      @c_step = Sketchup;;Color.new(30,125,180)
      group.entities.grep(Sketchup;;Face).each{|f| f.material=@c_step}
      
      

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Asigning colours to elements

      hi dan, thanx, i know, it is like working in skp itself,
      but when i have to transfer it to vis-software, i sometimes need all surfaces defined, since the importers do not transfer the group's color to the elements inside sometimes. but i will try once more, just not to be wrong on this.

      for that i would like to paint every surface, sometimes also the back-side directly.....

      besides that, i would like to understand the syntax of the coor asignment, somehow i cannot get it from the api guide.
      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Asigning colours to elements

      hi,
      after a long search i have to ask:

      is it possible to asign a colour to ALL faces within 1 group or 1 component?
      every colour shall become its own values and names and shall be written in model's colour table.
      what ever i try with the api-syntax, i fail....

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Help adding arc in ruby script

      hi,
      is it also possible to draw a 3-point-arc in ruby? without defining a center?

      i want to ad an arc along an edge, so the points would be (when edge is in y-direction):

      arc_1 = 0,0,0
      arc_2 = 0,y,0
      arc_3 = x,y/2,0

      is there a way?

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Round-function ???

      hi,
      after a research i could point out this function:

      
      @var  = @var.round.to_f 
      
      

      this works for me, but it seems , that the skp-ruby cannot use

      round (x)

      is that right?

      if so, is there another "simple" syntax for rounding to 2 after comma - position ( or any other, of course) ?

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: General question - definition of units (inch/metric)

      hi,
      thanx for the tips, i read the articles. i will make changes to my system, so that every saved value will be in inches (like basic skp) and i will recalculate to meters for "metric"-world.

      but i need a tip for the "inch"-world:

      do user prefer to input higher values (equivalent > 1,0 m) in feet or inches ?

      i would like to make my menues

      metric: meters for concrete etc / mm for steel-details

      would it be the same for

      feet / inches ? or shall everything be input in inches? what is common ?

      thanx

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: General question - definition of units (inch/metric)

      HI AND THANX TO ALL,
      this is going to be a challenge, i will report...
      stan

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

      hi dan,
      ok, this one moves any object along the vector , but for this i have again to calculate the start and end point of the edge first.

      the question is, when i already have a calulated and drawn line of any length,
      how can i move along this line (=vector) by defining a DISTANCE (in the 3d-direction of this line?

      so the endpoint would be calculated automatically by the ruby ?

      like:

      vector = edge xxx
      object = whatever
      distance = float-value
      object.move (vector, distance)

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Offset-function per ruby (simple)

      @slbaumgartner said:

      @artmusicstudio said:

      hi,
      is there an equivalent for the skp-function "offset" in ruby for simple forms like square or circle ?
      thanx stan

      Were you looking to move objects, per Dan's replies, or for a Ruby equivalent to the offset tool (i.e. to create a "parallel" shape inside or outside the original)?

      hi, slbaumgartner,
      yes , you got it,
      what i look for here (though dan's advice is also helpful for other things)
      is in deed the offset-function, creating a parallel shape (only simple forms like rectangles or circles).

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Offset-function per ruby (simple)

      hi,
      is there an equivalent for the skp-function "offset" in ruby for simple forms like square or circle ?
      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • General question - definition of units (inch/metric)

      hi all,
      when the ruby is for all over the world, how can i programm the ruby to know, in which units the user works and makes the input ( = user's skp-preferences-setting)?

      or is it ok fo "force" the user to use metric system (in my case) ?? that would not be user friendly, i think.

      thanx for a tip.

      stan

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

      hi experts,
      i did not really find an answer in the api, so

      when i draw a 3d line (any direction) ,

      can i take it's vector and then transfom an object from its origin (= startpoint of my vector)
      ALONG this vector with a defined (@distance_z) distance ?

      instead of calculation the target 3d-point ? this would make placing object along a line much easier.

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • 1 / 1