ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Get latLong of origin?

    7
    0 Votes
    7 Posts
    939 Views
    TomPendergrassT
    Thank you for your help! Turns out the camera that the photos were taken off of had some weird GPS offset, which is why my photos were imported yet placed kilometers away. I solved my problem by using a 'reference point'. I have the user import one photo and place that photo where they believe it was taken. I use that photo's lat and long to modify the rest of the photos that were imported. Success
  • Is the ruby source for rectangle tool or similar available?

    2
    0 Votes
    2 Posts
    209 Views
    TIGT
    There are several 'rectangle' plugins available, like '3 point rectangle' ... My own 2Dtools includes a 'rectangle tool' making 4 edges - no face... The principal is very similar to the line-tool example, instead of picking 2 points, you pick 3. The 'box' tool also has a potential crib... Point 1 click = p1 the start of an edge Point 2 click = p2 the end of that edge A Vector - vec = p1.vector_to(p2) Point 3 click - poff - this defines the offset to the opposite side NOT a vertex. A Line - line = [poff, vec] Project p1 & p2 to line p3 = p2.project_to_line(line) p4 = p1.project_to_line(line) Now if you want a face: face = Sketchup.active_model.active_entities.add_face(p1, p2, p3, p4) The edges get automatically added. If you want just edges: edges = Sketchup.active_model.active_entities.add_edges(p1, p2, p3, p4, p1) Remember to close the loop by reusing the first point again at the end... ***To get the temporary graphics rubber-banding that is needed in 'draw'... use the initial 2 points as if it's the line-tool, and then after the stare increments... while waiting for the 'poff' click the mouse's cursor-position can be used for calculating the the dynamically changing projected points from those 2, to draw the four sides of the potential rectangle as the cursor moves...
  • Can't read backslash with Sketchup.read_default !

    7
    0 Votes
    7 Posts
    462 Views
    Dan RathbunD
    Well it is replaced with Win32API.rb which is a wrapper that uses the DL library. So you can still use it. In later versions even DL is deprecated and becomes a wrapper into the Fiddle library. They (the Ruby Core people,) want coders to begin using the newer libs. But not every user installs the full Ruby libraries. It is easier to just use the Win32API class, for now.
  • Internal numbering of entities differs in iterations?

    7
    0 Votes
    7 Posts
    288 Views
    artmusicstudioA
    hi tig, yes, i understand the principles of giving attributes to entities now and will try to experiment with this. maybe i may go step back to my special situation (just for understanding): i have an axis of different edges, giving a path for 'followme' , then i let create the ruby the same object again and again (imagine: square, path, followme, delete square, path, followme, delete etc.) the funny thing is, that the entities DO have a numbering , which is their position in the array, right? and so a thought, while knowing , which entity has which number in the row, i could access them easily (again: always the same object with same amount of edges and faces from the same procedure) but at this point the numbering of faces in the array changes, although generated thru same procedure. and since the object is a follow-me- object, i cannot give any attributes to single faces, i guess..... so that's the trouble. but i can gerate these objects per hand too (face by face), so i will be able to use the 'attribute' option. regards stan
  • Transformation of single entities ???

    7
    0 Votes
    7 Posts
    309 Views
    artmusicstudioA
    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
  • How do I represent and keep a track of cuboids I create?

    9
    0 Votes
    9 Posts
    570 Views
    Dan RathbunD
    @bobdiya said: But given that the user is likely to rotate the cube (<90 degree off the global axis) ... Because now the default bounding boxes are larger and they don't represent the bounds of the cube themselves. Correct? True. @bobdiya said: ... then I will have to create and keep references to the bounding boxes? BUT then THOSE bounding boxes are not rotated,... their corners do not occupy the same vertices points that the cuboids do. Meaning that cubiods could have been rotate away from each other... so as not to be intersecting after rotation.
  • Coordinates of a vector-cross-point?

    10
    0 Votes
    10 Posts
    918 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
  • Code problem between windows-versions ??

    5
    0 Votes
    5 Posts
    204 Views
    artmusicstudioA
    hi, problem solved, it was sketchy physics. i will try to redifine my code later, maybe i will find the problem. stan
  • Include page in animation

    6
    0 Votes
    6 Posts
    229 Views
    jiminy-billy-bobJ
    Ho I didn't see that, thanks a lot!
  • Ruby panel on/off

    9
    0 Votes
    9 Posts
    407 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.
  • Speed up

    6
    0 Votes
    6 Posts
    385 Views
    tt_suT
    Sorry, the official name is "SketchUp C API". "SLAPI" was just an acronym thrown around before I begun which has stuck with me.
  • Help needed with sin, cos &amp; co...

    3
    0 Votes
    3 Posts
    243 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
  • Transformation (copy) by vector and distance ?

    10
    0 Votes
    10 Posts
    456 Views
    TIGT
    group2 = group.copy group2 = group.move!(vector) group2 = group.copy group2.move!(vector) Should leave group where it was ???
  • Naming of new colours ??

    3
    0 Votes
    3 Posts
    166 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
  • Question about "puts" "Kernel.puts" "Kernel::puts"

    4
    0 Votes
    4 Posts
    677 Views
    Dan RathbunD
    Functionally, there is no difference. BUT.. technically, Kernel::puts(), is a COPY of the instance edition of puts() that got mixed into Object, and will get inherited by ALL other classes and modules. The Ruby Core Team wrote the Kernel module as both a Mixin and a Library module. They used the module_function() method, so that all the library instance methods (that get mixin in using include,) had module method copies made. These copies can only be called by qualifying them with the Kernel module name. [ruby:1c8jtequ]Kernel.module_eval "class<<self; method(:puts).inspect; end;" >> #<Method: Class(Kernel)#puts> Kernel.module_eval "method(:puts).inspect;" %(#000000)[>> #<Method: Kernel.puts>]
  • Run Validity Check

    8
    0 Votes
    8 Posts
    2k Views
    Dan RathbunD
    Thank you, Thomas!
  • Access database files

    11
    0 Votes
    11 Posts
    6k Views
    Dan RathbunD
    I stumbled onto this download at Microsoft (looking for something else.) Microsoft SQL Server ODBC Driver 1.0 for Linux The Details say it's for 64bit RedHat 5/6. (But maybe if your Linux uses the same Core..)
  • Unfold tool from Jim Foltz

    11
    0 Votes
    11 Posts
    5k Views
    BoxB
    Two posts above you Tig has given you the link.
  • How to get Surface (Group of faces) via Ruby API?

    3
    0 Votes
    3 Posts
    248 Views
    fuzzybroF
    @tt_su said: These snippets should work: http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=41211#p365380 Oh, cool! Thanks a lot!
  • Setting the save path for files ???

    5
    0 Votes
    5 Posts
    493 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

Advertisement