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

    Topics

    • artmusicstudioA

      Active_model.merry x-mas.entities.send_to_all

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      155 Views
      No one has replied
    • artmusicstudioA

      Code problem between windows-versions ??

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      205 Views
      artmusicstudioA
      hi, problem solved, it was sketchy physics. i will try to redifine my code later, maybe i will find the problem. stan
    • artmusicstudioA

      Coordinates of a vector-cross-point?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      925 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Ruby panel on/off

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      409 Views
      G
      @tt_su said: hm.. that looks like a SCF redirection error.... Redirect bug corrected. If the error message is cached, a browser cache-erase might be necessary.
    • artmusicstudioA

      Help needed with sin, cos & co...

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      244 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Basic understanding of instances ???

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      591 Views
      tt_suT
      A couple of years ago I wrote an overview of definitions and instances in SketchUp: http://www.thomthom.net/thoughts/2012/02/definitions-and-instances-in-sketchup/
    • artmusicstudioA

      Naming of new colours ??

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      167 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Setting the save path for files ???

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      496 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Global scaling in skp 8

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Discussions sketchup
      2
      0 Votes
      2 Posts
      163 Views
      BoxB
      Select all and use the scale tool.
    • artmusicstudioA

      Axes-tool coordinates

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      159 Views
      No one has replied
    • artmusicstudioA

      Asigning colours to elements

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      224 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Round-function ???

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      258 Views
      tt_suT
      @artmusicstudio said: if so, is there another "simple" syntax for rounding to 2 after comma - position ( or any other, of course) ? If you want a rounded float in return: <span class="syntaxdefault">module Example<br />  def self</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">round</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">number</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> precision</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">    i </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> 10.0 </span><span class="syntaxkeyword">**</span><span class="syntaxdefault"> precision<br />    </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">number </span><span class="syntaxkeyword">*</span><span class="syntaxdefault"> i</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">round </span><span class="syntaxkeyword">/</span><span class="syntaxdefault"> i<br />  end<br />end</span> ` Example.round(12.3456, 2) > 12.35` If you are formatting a number into a string to the UI you can use sprintf: ` sprintf('%.2f', 12.3456) > "12.35"`
    • artmusicstudioA

      Offset-function per ruby (simple)

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      424 Views
      icehuliI
      @artmusicstudio said: @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 you can try this: http://www.smustard.com/script/Offset simply works for faces(polygons) and polylines
    • artmusicstudioA

      General question - definition of units (inch/metric)

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      15
      0 Votes
      15 Posts
      941 Views
      jolranJ
      Heh, it was like this for 100 puts statements in the console. to_s_to_l: 2.884 using send: 2.915 Rookie premature refactoring gone bad
    • artmusicstudioA

      Transformation (copy) by vector and distance ?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      461 Views
      TIGT
      group2 = group.copy group2 = group.move!(vector) group2 = group.copy group2.move!(vector) Should leave group where it was ???
    • artmusicstudioA

      Menue definition - small problem

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      216 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Math-problem

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      275 Views
      artmusicstudioA
      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
    • artmusicstudioA

      Transformation / rotate of an existing component

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      428 Views
      TIGT
      An object like a group has a bounding-box with its XYZ axes a parallel to the groups' internal XYZ axes. So if the geometry inside the group is made parallel to its internal axes then its bounds hug the geometry. If you rotate the group its bounds rotate with it. If you rotate the geometry inside the group then it is rotated relative to the group's internal axes. So although the visible geometry is rotated the bounds stay as they were - now skewed... tr=Geom::Transformation(point, axis, angle) group.transform!(tr) Rotates the group [AND its geometry inside] so the bounds rotate. tr=Geom::Transformation(point, axis, angle) group.entities.transform_entities(tr, group.entities.to_a) Rotates the group geometry inside BUT leaves the group where it was, so the bounds do not rotate - so it is skewed... If you have skewed geometry that is made into a group the group.bounds are skewed relative to the geometry. To fix this first rotate the group then rotate the geometry in the opposite direction [use tr.inverse]. Visually it's unchanged but the bounds now match the geometry and the group is actually rotated... tr=Geom::Transformation(point, axis, angle) group.transform!(tr) group.entities.transform_entities(tr.inverse, group.entities.to_a)
    • artmusicstudioA

      Another approach for copyying a compo in a loop - no success

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      202 Views
      No one has replied
    • artmusicstudioA

      Basic question - groups as array ?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      270 Views
      artmusicstudioA
      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
    • 1 / 1