ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • List of keyboard keys constants

    3
    0 Votes
    3 Posts
    716 Views
    K
    Thanks for your answer TIG, using non modifier keys is indeed a bad idea inside a tool, because they are already bound to lots of different tools. I also discovered that the int values corresponding to keystroke can be accesed like this valueFor_W_Key = ?W a bit weird, but it works. I ended up not using keys
  • Modifying or extending SU native tools

    5
    0 Votes
    5 Posts
    1k Views
    Dan RathbunD
    Most of the native tool ids are defined as global constants, that begin with "CMD_" List them, at the Ruby Console: Object.constants.grep(/CMD/).sort The tool state integers vary from tool to tool, and some tools do not use them at all.
  • How to upload skp to server by ruby plugin?

    10
    0 Votes
    10 Posts
    1k Views
    Dan RathbunD
    There are already several Ruby bindings written for curl. http://rubygems.org/search?utf8=%E2%9C%93&query=curl Maybe one could be made to work under SketchUp ??
  • Wrap gem under own namespace

    14
    0 Votes
    14 Posts
    316 Views
    thomthomT
    The string you feed create_makefile should relate to the init function in your C extension. As you see from the Hello World example, extconf contains this: create_makefile( 'SX_HelloWorld' ) And in the C source you have the init function: void Init_SX_HelloWorld( void ) Note how "Init_" is prepended of the name you feed makefile - and it's case sensitive. @anton_s said: change the vcvars32.bat path to your current vcvars32.bat path, and run it to compile. I have found after making the tutorial that it is easier to just launch the command prompt shortcut that ships with Visual Studio. It's there in it's folder in the start menu. The environment is set up automatically.
  • Can you adjust the "strength" of a transformation?

    8
    0 Votes
    8 Posts
    281 Views
    TIGT
    The object's 'position' is relatively easy to find - it's just the t=object.transformation.to_a for the xyx point as an array of the last few elements thus: point=[t[-4],t[-3],t[-2]]... OR transformation.origin ! The transformation's scale and rotation interact with each other, so they are much more complex to extract from the transformation array... but not impossible - there are already some earlier post discussing this...
  • Js / DOM / HTML questions

    6
    0 Votes
    6 Posts
    103 Views
    Dan RathbunD
    @dan rathbun said: What I'm I'm wondering is if I can do this, for cross-platform: %(#8000BF)[document.head] OK I understand now (those new MSDN pages are so confusing!) %(#8000BF)[document.head] is part of HTML 5. http://stackoverflow.com/questions/7557868/document-head-document-body-to-attach-scripts and http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-head
  • Pollution Private methods of Class

    9
    0 Votes
    9 Posts
    244 Views
    J
    Sandbox Tools are responsible for most of them: @unknownuser said: CalcTriangleProperties CheckEntity CountDuplicates Equal2D Equal2D2 FacesAreTriangles GetAllVertices GetCursorID GetFaceNormal GetFaces GetPolyNormal GetTransformedVertexPositions GetVertsInWCS In2DCircle InPlane IsAlreadySelected LineFaceIntersection NegIfEven PointInArray PutsTransform RemoveNonFunctionalVerts SegmentsCross2D SelectAllConnected TriangulateDelaunay VectorScalarMult getOffsetPolygon getOffsetPolygon2 getOffsetPolygon3 isOdd paramT sign tellPctComplete
  • How to import several models to designated positions

    13
    0 Votes
    13 Posts
    459 Views
    Dan RathbunD
    When I first listed the methods, I thot for a moment (until I looked twice,) that the seventh method was named eat_me! ...
  • Bulletproof sample code for a plugins menu ???

    12
    0 Votes
    12 Posts
    265 Views
    TIGT
    Now you understand how to debug! Missing _item ... ...@KSORsubmenu.add**_item**... My typo - which occurs twice when the item is added to the submenu [or it wasn't thanks to the typing error ] Edit those two 'add' lines in your script and it should then work. I have edited the original post so other browsers won't get confused...
  • Leaving out one field in inputbox ???+

    6
    0 Votes
    6 Posts
    174 Views
    K
    Thx to Aerilius - very usefull explanation !
  • Sketchup and open-uri

    4
    0 Votes
    4 Posts
    605 Views
    D
    Sorry for the late reply. So basicly what I want to do is upload files to and from a restful api using multipart/form data that are not in sketchup format. ie, export obj file > upload to server > delete obj file or download stl file > import to sketchup > delete stl file after giving up on net stuff through ruby which all seemed to crash sketchup I started looking into accomplishing this through the web dialog with ajax. While it works for communicating with the api in other ways and solves a lot of my problems. It is still not possible to upload or download a file with out the file dialog (and for good reason) but I want something more seamless. So far the closest thing I have found is https://github.com/danawoodman/google-sketchup-file-downloader but it isn't working. Thanks for your help, I will keep at it and appreciate any more help Thanks!
  • [Code] Executing a cmd without the black screen (Windows)

    17
    0 Votes
    17 Posts
    7k Views
    Dan RathbunD
    One issue is there is what I consider a bug in the Ruby Win32 source. If you try to set ENV["RUBYSHELL"] to "Wscript" it will not work because the source always wants to inject a " -c" switch into the command. Problem is, Microsoft wrote Wscript.exe and Cscript.exe to poop out if any unknown switches are in the command. (I think cmd.exe just ignores unknown switches.) So any way, the normal Ruby means of changing the shell that %x and ` Kernel.`` use, will actually not work on Windows.
  • System command without window

    2
    0 Votes
    2 Posts
    51 Views
    thomthomT
    Never mind - found this thread: http://forums.sketchucation.com/viewtopic.php?f=180&t=36973&start=0
  • How to get the saved file path

    13
    0 Votes
    13 Posts
    2k Views
    OricAtmosO
    Hey, I ran into the same problem as Nick60 today and was glad I found this thread with an nice solution. However there's still one use case with a problem: when the user saves the model with "Save copy as..." the side-car file will be saved under the wrong name. Any suggestions how this could be fixed?
  • Entities.intersect_with crash

    10
    0 Votes
    10 Posts
    264 Views
    K
    @unknownuser said: ?? The API docs really need to expand with more info on this method! yeah - most confusing method in the API!
  • Iconv.so dependency fails

    7
    0 Votes
    7 Posts
    791 Views
    N
    Hey I get the same problem, Just copy iconv.dll from C:\Ruby\bin in the directory C:\Program Files (x86)\Google\Google SketchUp 8 to fix the problem.
  • Pompidou WebGL Viewer

    10
    0 Votes
    10 Posts
    1k Views
    A
    (You could look it up in the above list). I found only a couple of times something with "layer", and no method to set/change visibility of a layer. I suppose all the layer methods (like many others) are up to now only empty place holders. In addition to that, it depends on what features can be read from the .dae model. As we know, SketchUp's .dae exporter doesn't preserve scenes and layers (but on the SketchUp Showcase they have scenes!). Similarly, the Pompidou Viewer also contains methods for handling geometric primitives and materials (edges etc.) but models are up to now only loaded as a big mesh object, without distinction into single entities.
  • One Face that Should Be Two...

    5
    0 Votes
    5 Posts
    153 Views
    K
    @unknownuser said: ... would Sketchup.send_action("fixNonPlanarFaces:") do anything in this case? ... I should've saved the file with the messed up face to try it on! I ended up with something similar to TIG's suggestion,except that I found any vertices referenced more than two edges on the same face. Then I was able to re-create the faces using the original face's vertices. -- Karen
  • Number of processors

    4
    0 Votes
    4 Posts
    265 Views
    TIGT
    num = ENV['NUMBER_OF_PROCESSORS'].to_i is much easier than the other way and should be fine unless you want to have a cross-platform solution... We don't know if MAC has the same ENV variable 0 - some references are similar to PC, while others can be the same ??
  • Move vertex using absolute coordinate

    5
    0 Votes
    5 Posts
    2k Views
    TIGT
    That is a much more efficient way of doing it [transforming [or erasing] entities en mass is often preferable]... But in my defense... the title of the post is move **vertex**... NOT move **vertices**... - so there is probably no significant benefit in the en mass way when he's moving just one or two or three vertices - obviously if a whole load of things are changing a time lag will be noticeable...

Advertisement