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: Menue definition - small problem

      hi dan,
      super, thanx, i understood and it works now,
      besides a small message in the console:


      load '01.rb'
      C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:66: warning: already initialized constant THISFILE
      true


      i start the ruby directly, not in a module (when i put it in the module, it does not work, probably because of all the entities definitions etc. / still workin' on it)

      regards stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Transformation / rotate of an existing component

      post scriptum:

      now the transformations of components (turning around z) work,
      but i found out, taht the bounding box ( = component internal axes) won't change with the transformation.
      i read a lot topics about it, but found no solution.

      so, has the api a function to say something like

      t = transformation...whatever....component_axes (point, angelx, angle y, angle z) ??

      this would be very uswfull to prepare the components for use's edit in right directions!

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Menue definition - small problem

      hi,
      with my code i have the following problem:
      every time i restart the ruby in the ruby console per

      load '01.rb'

      the menue entry in the plugins-menue is duplicated (so after 5 calls 5 times the menue, the first one at the top, all the others then call by call at the botton of the plugins menue...))

      where is the problem?

      
      Sketchup.send_action "showRubyPanel;"
      
      submenu = UI.menu("Plugins").add_submenu("01-zf-ruby")
      submenu.add_item("1 ruby"){
      meth_1
      meth_2
      }
      
      submenu.add_separator
      submenu.add_item("2 save last model"){
      meth_3
      meth_4
      }
      
      submenu.add_separator
      submenu.add_item("3 load saved model"){
      meth_5
      meth_6
      }
      
      submenu.add_separator
      submenu.add_separator
      submenu.add_item("4 support"){
      UI.messagebox "support" # w.i.p.
      }
      
      

      thanx for checking and helping.
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Math-problem

      hi icehuli,
      that's it! of course, i already had the tanges, so......sometimes it's so clear afterwards...
      thanx a lot, the method works now!

      
      new_line = @entities2.add_line @pfm1, @pfm2	
      @vector = new_line.line[1]
      point = [0,0,0]
      angle = (Math.atan(var4/@run)).radians 
      angle = 360 - (Math.atan(var4/@run)).radians  if var5 == "right"
      tr = Geom;;Transformation.rotation(point,@vector,angle.degrees)
      @group.entities.transform_entities(tr, @group.entities.to_a)
      
      

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Math-problem

      hi tig, ok. i will make tests and learn.
      but anyway:

      why does

      angle = Math.tan(20.0/30.0)

      give (by puts angle)

      0.786842889472977

      instead of

      0.66666666 (normal tangens)

      and if 0.786842889472977 = 20/30 in radians,

      why does angle.radians then not give 33.69 degrees?

      sorry, i am confused, i seem to misunderstand someting totaly...

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Math-problem

      hi tig & icehuli,

      @tig: yes, the numbers come from another modules and should be float (with direct input "45.degrees" in tr for angle2 the object is turned by 45 degr.)

      in the code below i tried the 'simple way', not clear to me, why it still does not work

      @icehuli
      see the code, the function should be the right one

      
              new_line = @entities2.add_line pfm1, pfm2 # gives vertical line	
      	@vector = new_line.line[1]
      	point = [0,0,0]
      #
      	angle = (Math.tan(@lwidthplus/@run)) # x,y come from another module
      	angle2 = angle.degrees # trying to become degrees
      #
              puts "@lwidthplus",@lwidthplus #gives >> 7.8740157480315 (equiv. to 20)
      	puts "@run",@run #gives >> 11.8110236220472(equiv. to 30)	
              puts angle  #gives >> 1.5574077246549, should be 0,6666666 ( = 20/30 >> about 34 degr.)
      	puts angle2  #gives >> 0.0271818925912213
      #
      	tr = Geom;;Transformation.rotation(point,@vector,angle2) # turnes somehow 
      	group.entities.transform_entities(tr, group.entities.to_a)
      #        
      	@m_pf_l = group.to_component
      	defn = @m_pf_l.definition
      	defn.name = "@m_pf_l"
      
      

      it must be something very simple....but i cannot see it!

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Math-problem

      hi,
      i cannot find my mistake

      with

      @run = 30
      @lwidthplus = 20

      the formula

      angle2 = (Math.tan(@lwidthplus/@run))*180/Math::PI

      does not give me the right angle.

      as far , as i understand

      (Math.tan(@lwidthplus/@run)) gives me the RAD

      and

      *180/Math::PI should give me the degrees

      any idea, where my mistake is?

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Transformation / rotate of an existing component

      hi tig, thanx, that's the point.
      i understood before, that "transforming " the container (group or component) has to be applied to the instances, too.
      with your code i now have the desired access to its entities! wonderfull, thanx for that,
      it works now , every transformation is passed to the component instances.
      in that point, the ruby-skp-api gives too few syntax to play with...
      thank you.
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Transformation / rotate of an existing component

      hi tig,
      yes, my problem was the right asignment...but to find this out with the ruby-api... :_)
      so for one component it work for me.

      now i have an interesting issue with that:

      i learned, that when i turn THE COMPONENT like this and
      then make a instance (copy),
      the new instance is not turned (transformed). i want to have the MASTER ELEMENT prepared and ready for copying.

      so i tried to turn the GROUP, before the component is created out of it:

      
      
      group = entities.add_group
      @entities2 = group.entities
      
      new_line = @entities2.add_line pfm1, pfm2      # gives a vertical line	
      	@vector = new_line.line[1]
      	point = [0,0,0]
      	transformation = Geom;;Transformation.rotation (point, @vector, 45.degrees)
      	group.transform!(transformation)
      
      # and then create a component
              
      	@m_pf_l = group.to_component
      	defn = @m_pf_l.definition
      	defn.name = "@m_pf_l"
      	
              componentinstance =
      	entities.add_instance(@m_pf_l.definition, pf1) # pf1 is a defined point
      
      
      

      to my surprise,
      in the copy of the component then (new instance), the elements are also NOT TURNED.

      mysterious for me...

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Transformation / rotate of an existing component

      hi,
      i just cant get thru the syntax of transformations and need a small help at one point:

      i have a component defined and would like tu turn it along the vector-axis.
      so (all within a module)

      • the vector and the point and the angle are defined
      • the component is there (works perfectly without the last 3 lines below)

      but

      
              @m_pf_l = group.to_component # existng group to component
      	defn = @m_pf_l.definition
      	defn.name = "@m_pf_l"
              point = [0,0,0] # my point
      	transformation = Geom;;Transformation.rotation point, vector, 45 
      	t = defn.transformation
      	
      
      

      this code does not work. i know, i have a wrong connection to the component instance (i tried differet syntax-variantions), but
      i don't want to use the code from the api-guide, since there they ADD an instance, but i want to turn the existing component.
      so again, thanx for the tip
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Checking for a group?

      @ tig
      hi tig, thanx,
      with

      
      def delete_model_zf
      #***************************************************************************
      @putswitch = 0 
      	begin
      	@group_stair.erase!
      	rescue
      	end
      end
      
      

      it worked, as soon as i understood, that rescue can also be NOTHING, so the code runs thru end the method ends

      @ dan, thanx,
      this is still higher programming syntax (for my brain), i tried to encapsulate in
      require("sketchup.rb")
      MODULE AMS
      MODULE 01.rb // is it right to put hier 01.rb ??? (the work-name of the ruby)
      MY CODE
      END MODULE
      END AMS,
      but have errors. have to work it out! but i would like to put the ruby into a proper form for the first release / check. i'll get back to this later.

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Checking for a group?

      hi dan, have to correct it ( was only for me to see it better while working on it), thanx. (and i already study the files, you recomend for newbie's...but it's a lot to learn, of course)

      and i have to correct my previous statement:

      my "checking" code does not work in a new opended file. it again reports a deleted group, while searching for it.

      but, as soon as i create the first group and the activate the checking-line, it works.

      so now a question:

      is there a way to define 1 variable (true or false) ON LOAD ?
      so this variable would only be "true" when sketchup is opened and before my ruby script runs for the first time (i could overwite it then for the active session)?
      then i could run the checking code "unless onload == true " or something like that.

      ragrds stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Checking for a group?

      hi tig and yes,

      
      @group_STAIR.erase! if @group_STAIR.valid?
      
      

      works perfect.

      another advantage: when i generate my group and copy it manually to the desired place
      and then call the ruby again, the original is beeing deleted and the copy remains.
      that is, what i wanted to achieve: when the user is satisfied with the result, he can either make a copy or make a component out of the group.
      next step is done!
      thanx a lot
      stan

      ps: (on the other hand i was not sure in example 2 and 3, why they did not work for me, i still investigate, must be the NAME definition, i think).

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Checking for a group?

      hello,
      i went thru all snippets,
      but

      how can i check, if a group @NAME
      exists or not in the actve model.

      situation

      i create a group NAME by ruby
      then it either is deleted or not

      whith the next call ruby shall check, if group NAME is there

      if not, create it
      if so, delete and create it new

      my trial:

      
      entities = @NAME.entities 
      entity1 = entities[1]        
      status = entity1.valid?
      
      unless status == true
         model = Sketchup.active_model
         @NAME.erase!
      end
      
      
      

      reports an not existing group, so no check is possible

      tahnx for helping on this

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Another approach for copyying a compo in a loop - no success

      hi,
      sorry, i have to try again with another approach:

      this is , what ruby reports first:

      FROM RUBY:
      menues # my module running and ok
      masterdefinitions set # my module running and ok
      master-components defined # my module running and ok
      start masterloop # my module running and ok
      creating top-handrail tubes (followme)-beta # my module running : PROBLEM
      Error: #<NoMethodError: undefined method definition' for nil:NilClass> C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:2440:in top_handrails'
      C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:2404:in each' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:2404:in top_handrails'
      C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/01.rb:60
      END REPORT

      this ist the code

      MODULE start_masterloop

      ....some other code

      
      model = Sketchup.active_model
      
                      entities = @group_handlauf_mitte1.entities 
      		entities.erase_entities entities[0]
      
      		rl1 = [0, y1, 0]
      		rl2 = [0, y2, z]
      		
                      group = @group_handlauf_mitte1 = entities.add_group
      		entities2 = @group_handlauf_mitte1.entities
      				
      	for mth in 1..@podestnr
      
      		group = @group_handlauf_mitte1 = entities.add_group
      		entities2 = @group_handlauf_mitte1.entities
      		
      		new_line = entities2.add_line rl1, rl2
      		length = new_line.length
      
      		pf[mth] =  [0,  0 - @run+@run*@il*(mth-1)+@run*@la*(mth-1)+@ro.abs, (mth-1)*@il*@rise+@mr] #mitte
      
                      if mth == 1
      
      		centerpoint = pf[mth]
      		                             
      		vector = new_line.line[1]
      		vector2 = vector.normalize!
      
      		edges2 = entities2.add_circle centerpoint, vector2, @thradius
      		kreis2 = entities2.add_face edges2
      		status = kreis2.reverse!
      		entity1 = entities[0]
      		kurvem = entity1.all_connected
      		
      		status1 = kreis2.followme kurvem
      				
      		@group_handlauf_mitte1 = group.to_component
      		defn = @group_handlauf_mitte1.definition
      		defn.name = "@group_handlauf_mitte_compo" 
      		status = @group_handlauf_mitte1.explode  # NOTE 1
      		
      		elsif mth > 1
      		
      		model = Sketchup.active_model
      				
      		entities2 = Sketchup.active_model.entities
      		componentinstance =
          		entities2.add_instance(@group_handlauf_mitte_compo.definition, pf[mth]) # NOTE 2 (= LINE 2440)
          		puts mth # CONTROLL OUTPUT - WORKS
          		
      	end
       
      		new_line.erase! 
       
      end
      
      

      END OF MODULE

      what i want to achieve, is to create a component in step 1 of the loop and copy this component to points pf[mth] in the other steps of the loop.

      i desperately try, but always get an error for copyying the component.

      i also tried:
      explode the group, in which the component is created, but then there is not the component left, but the group (no idea how)

      so maybe someone has an idea...

      thank you

      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: Basic question - groups as array ?

      hi, thank you all, i tried to put my groups in the suggested ways into a loop, but i always get errors. with '@@groups' i would reach all grups, wouldn't i ?
      i will try to describe the whole problem:

      i have a defined amount of groups with one basic construction point (thanx dan), the amount changes by user input, so it must be variable, so there may be 2 or 20 @group_handlauf_mitte - groups.

      @group_handlauf_mitte1
      @group_handlauf_mitte2
      @group_handlauf_mitte3
      @group_handlauf_mitte4
      and so on

      i cannot find out, how can i access those 'group_handlauf_mitte ' groups in a loop to be able to select a group by
      @group_handlauf_mitte[index].entities. (my index here ist PODESTNR)

      i also tried to create the group name as a string-combination within a loop

      
      for step 1..20
      a = "group" + step.tp_s.name 
      a.name =  a
      end
      
      

      but that's obviously not working , too.

      at the moment i have to define like this:

      
                                              if @podestnr == 1
      					entities = @group_handlauf_mitte1.entities
      					new_line = entities.add_line rl13, rl14
      					entities = @group_handlauf_mitte1.entities
      
      					elsif @podestnr == 2
      					entities = @group_handlauf_mitte2.entities
      					new_line = entities.add_line rl13, rl14
      					entities = @group_handlauf_mitte2.entities      				
      
      					elsif @podestnr == 3
      					entities = @group_handlauf_mitte3.entities
      					new_line = entities.add_line rl13, rl14
      					entities = @group_handlauf_mitte3.entities  
          				
             					elsif @podestnr == 4
      					entities = @group_handlauf_mitte4.entities
      					new_line = entities.add_line rl13, rl14
      					entities = @group_handlauf_mitte4.entities 
      					
             					end
      
      

      instead of this i would like to make a loop in which STEP decides, which grop's entities will become ENTITIES, but only for those groups, not all groups i have.

      hopefully i can once understand the syntax for group selection by index, because i could then make the ruby-code many times shorter.

      in this loop i need the griup name 1,2,3,4 to become dependent from the index MTH

      
      model = Sketchup.active_model
                  
       
       y1 = 0 - @run ## the overall variables come from earlier code !!!
       y2 = 0
       y3 = @run
       z = @rise
       pf = []
       for mth in 1..10
       
                  entities = @group_handlauf_mitte1.entities ### MTH instead of 1 needed
                  entities.erase_entities entities[0]
                   
                  rl1 = [0, y1, 0]
                  rl2 = [0, y2, z]
                   
      group = @group_handlauf_mitte1 = entities.add_group      ### MTH instead of 1 needed
                  entities2 = @group_handlauf_mitte1.entities  ### MTH instead of 1 needed
                  new_line = entities2.add_line rl1, rl2
                  length = new_line.length
       
       pf[mth] =  [0,  0 - @run+@run*@il*(mth-1)+@run*@la*(mth-1)+@ro.abs, (mth-1)*@il*@rise+@sr] #mitte
                   
                 #point1 = Geom;;Point3d.new pf51
                 #constpoint = entities.add_cpoint point1
                 
                 centerpoint = pf[mth]
                 new_line = entities2.add_line rl1, rl2                              
                 vector = new_line.line[1]
                 vector2 = vector.normalize!
                 
                 edges = entities2.add_circle centerpoint, vector2, @thradius
                 kreis = entities2.add_face edges
                 entity1 = entities[0]
         	   kurvem = entity1.all_connected
         	   
       	   status1 = kreis.followme kurvem
        
       end
      
      
      

      thanx for helping
      stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • Basic question - groups as array ?

      hi,
      is it possible to create and define GROUPS as ARRAY?

      example: #create needed groups for later element assignment

      
      $groupname[0] = Sketchup.active_model.entities.add_group
      $groupname[0].entities.add_line([0,-50,0],[0,-50,140])   #element [0] will be later deleted
      $groupname[0] = "$groupname[0]"
      
      $groupname[1] = Sketchup.active_model.entities.add_group
      $groupname[1].entities.add_line([0,-50,0],[0,-50,140])   #element [0] will be later deleted
      $groupname[1] = "$groupname[1]"
      
      .....
      
      
      

      after this, one could assign elements to those groups within a loop using a
      the loop-step as the arry-index

      thanx stan

      posted in Developers' Forum
      artmusicstudioA
      artmusicstudio
    • RE: [Plugin] Component/group tools

      hi tig, thanx,
      this work well, one step further for me, now i can identify the "children" of the masters exactly. that's perfect.
      just to understand exactly:
      a name of component instance defined by this method appears in the field "description"

      a group named by group.name = "xxx" appears in the filed "name"

      is there also a way to NAME a component or its instance besides a description?

      thanx
      stan

      posted in Plugins
      artmusicstudioA
      artmusicstudio
    • RE: [Plugin] Component/group tools

      hello,
      i went thru all topics dealing with component naming,
      but i cannot find a solution.

      i would like to give a name to a created component by this code:

      ######## start code

      model = Sketchup.active_model
      entities = model.active_entities
      rl1 = [0, y1, 0]
      rl2 = [0, y2, z]
      group = entities.add_group
      entities2 = group.entities
      new_line = entities2.add_line rl1, rl2
      length = new_line.length

             centerpoint = rl1
                                        # Create a circle perpendicular to the normal or Z axis
             vector = rl2
             vector2 = vector.normalize!
         
             edges = entities2.add_circle centerpoint, vector2, $thradius
          
             kreis = entities2.add_face edges
             kreis.pushpull -(5/$faktor)/100
          
         $masterrailingtms = group.to_component      
         # HERE I WOULD LIKE TO DEFINE A NAME FOR THIS NEW COMPONENT, WHICH I CAN SEE IN IN SKP ENTITY-INORMATION-WINDOW. this name also hopefully appears in the copied instances of this component, but most important is the name for component [0]
      

      ######## end code

      can somebody help me?
      thanx
      stan

      posted in Plugins
      artmusicstudioA
      artmusicstudio
    • Problem with component-definition in a loop

      hello ruby friends,
      i took 2 weeks off to study some programminmg guides etc. for ruby. i could solve some variable-problems, but i cannot find a solution for the following:

      i want to define some master-components, which are copied later in the routine as instances.
      this works well, when i define one component after each other (linear).
      this all happens in one routine like this:

      def_programm

      define compo 1
      define compo 2
      define compo 3

      some other tasks

      copy compo 1 to instance .....
      copy compo 2 to instance .....
      copy compo 3 to instance .....

      end

      BUT

      when i try to make the component definition within a LOOP and define the compnent'S name as ARRAY,
      the components are again created, ok, but the creation of INSTANCES report, that they cannot find a deleted master component.

      so it seems, that the components made within a loop are not visible for the rest of the program.

      i am not sure, if i could explain my problem. in one other topics i was said, i should post the parts of programm code in some special way: could someone tell me, how to do it?

      until then, here is the loop for the component - creation:

       # edit 131107
      require 'sketchup.rb'
      
      Sketchup.send_action "showRubyPanel:"
      
      #Add a menu item to launch our plugin.
      UI.menu("PlugIns").add_item("01-ZF"){
      
      # Call
      programm
      }
      
      def_programm
      
      some code
      
      #******************************************************
        #DEF PFOSTEN MASTER COMPONENTS AT 0,0,0 AS LOOP
           
                  
      model = Sketchup.active_model
      entities = model.active_entities 
                    
               
               for pfosten in 0..2
               pfostenname=[]
               pfostenname[0] = "$masterpfostenl"
               pfostenname[1] = "$masterpfostenr"
               pfostenname[2] = "$mittelpfostenm"
                      
               pfm1 = [0, 0, 0+thickness]
               pfm2 = [0, 0, 0+thickness+sl-((5/faktor)/100)]
               pfm3 = [0, 0, 0+thickness+sl-((5/faktor)/100)]
               pfm4 = [0, 0, 0+thickness+sl]        
                       
               group = entities.add_group
               group.name = pfostenname[pfosten]
               entities2 = group.entities
               
               unless pradius<0
               
               #puts "tube-pole"
               
               new_line = entities2.add_line pfm1, pfm2
                            length = new_line.length
                            centerpoint = pfm1
      # Create a circle perpendicular to the normal or Z axis
                            vector = pfm2
                            vector = vector.normalize!
                             
                            edges = entities2.add_circle centerpoint, vector, pradius
                            kreis = entities2.add_face edges
                            kreis.pushpull length
                 
                 
               new_line2 = entities2.add_line pfm3, pfm4
                            length2 = new_line2.length 
                            centerpoint2 = pfm4
               	      vector2 = pfm3
        	              vector2 = vector.normalize!
        			                     
        		      edges2 = entities2.add_circle centerpoint2, vector2, pradius/3
        		      kreis2 = entities2.add_face edges2
                            kreis2.pushpull -length2            
                 
        else  
        
                           #puts "square-pole"
                           side = pradius.abs
                           #puts pradius
        
                           new_line = entities2.add_line pfm1, pfm2
                           length = new_line.length
                           centerpoint = pfm1
                           vector = pfm2
                           vector = vector.normalize!
                           pts = []
                           pts[0] = [-side/2, -side/2, 0+thickness]
                           pts[1] = [-side/2, +side/2, 0+thickness]
                           pts[2] = [+side/2, +side/2, 0+thickness]
                           pts[3] = [+side/2, -side/2, 0+thickness]
                           square = entities2.add_face pts
                           square.pushpull -length
        
        
                           new_line2 = entities2.add_line pfm3, pfm4
                           length2 = new_line2.length 
                           centerpoint2 = pfm4
                           vector2 = pfm3
                           vector2 = vector.normalize!
        
                           edges2 = entities2.add_circle centerpoint2, vector2, pradius/3
                           kreis2 = entities2.add_face edges2
                           kreis2.pushpull -length2              
        
        end    
        
        puts "creating component in loop"
        puts pfostenname[pfosten]
        puts "Gruppenname " , group.name
        pfostenname[pfosten] = group.to_component  
      
      # BUT THIS COMPONENT IS NOT REACHABLE FOR THE REST OF THE PROGRAMM
          
      end    # end of loop
      
      
      #here the code for copying of components (which works, when the compnents are created oe after each oother within programm
      
      #********************************************************************************************       
      # PFOSTEN SETZEN
      
      #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
      if $putswitch == 1
      puts "positioning posts"  
      end
      #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
       
      
          pf1 =  [x1+rol-$lwidthplus*(step+multistep-2),  y1-run+ro.abs+multistep*run, z-rise] #links
          pf3 =  [x2-ror+$rwidthplus*(step+multistep-2),  y1-run+ro.abs+multistep*run, z-rise] #rechts
          pf5 =  [0, y1-run+ro.abs+multistep*run, z-rise] #mitte
          
          pf1p =  [x1+rol-$lwidthplus*(step+multistep-1),  y1-run+ro.abs+multistep*run+run, z] #links
          pf3p =  [x2-ror+$rwidthplus*(step+multistep-1),  y1-run+ro.abs+multistep*run+run, z] #rechts
          pf5p =  [0, y1+ro.abs+multistep*run, z] #mitte
              
               
              if (step) / il == podestnr #posledni horni
             
                      stepcount = 0 
                      
              	componentinstance =
      		entities.add_instance($masterpfostenl.definition, pf1p)
      		componentinstance =
      		entities.add_instance($masterpfostenr.definition, pf3p)
      		componentinstance =
          		entities.add_instance($mittelpfostenm.definition, pf5p)
          		 		
          		elsif   pmod == 1 # na kazdy schod
                      
          			componentinstance =
          			entities.add_instance($masterpfostenl.definition, pf1)
          			componentinstance =
          			entities.add_instance($masterpfostenr.definition, pf3)
          			componentinstance =
          			entities.add_instance($mittelpfostenm.definition, pf5)	
          			
          			
          			if (step+1) / il == podestnr
          			componentinstance =
      			entities.add_instance($masterpfostenl.definition, pf1p)
      			componentinstance =
      			entities.add_instance($masterpfostenr.definition, pf3p)
      			componentinstance =
          		        entities.add_instance($mittelpfostenm.definition, pf5p)
          			end
          			
          			
                      elsif
                              
                              #pmodoffset =   2*((il / pmod).ceil+1)*pmod-il
                              
          			(step + (((il / pmod).ceil+1)*pmod-il)*(podestnr-1)) % pmod == 1      
                              # verteiler ab modulo 2
          			componentinstance =
          			entities.add_instance($masterpfostenl.definition, pf1)
          			componentinstance =
          			entities.add_instance($masterpfostenr.definition, pf3)
          			componentinstance =
          			entities.add_instance($mittelpfostenm.definition, pf5)
               end
      
      end     # end of PROGRAMM
      
       
      

      edit 131107, thanx to dan

      THANK YOU VERY MUCH FOR HELPING.
      stan

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