🏢 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Getting Started with C++ and Sketchup

    3
    0 Votes
    3 Posts
    3k Views
    S
    Thanks. Now I know where to start.
  • SF Bay Area SketchUp meeting, 4/6

    2
    0 Votes
    2 Posts
    224 Views
    Chris FullmerC
    I'll be there. Its a little over an hour away for me, but I think it will be worth it. And its always fun to meet up with other SU users and talk about SU. It'll be good to see you again Rich, Chris
  • Component definition name

    3
    0 Votes
    3 Posts
    275 Views
    C
    Works great, thanks.
  • Integer vs string test time

    3
    0 Votes
    3 Posts
    196 Views
    honoluludesktopH
    Thanks, I will have to remember how to do that:)
  • Deleting a text

    3
    0 Votes
    3 Posts
    589 Views
    K
    oh, ok, great. thank you!
  • Plane from current view

    5
    0 Votes
    5 Posts
    487 Views
    M
    I have a similar workflow to what your describing but I use photo match and no ruby scripts. Set the view you want, save it at the screen resolution, edit it, then start a Photo Match session using the new image. Everything should line up perfectly as long as nothing has changed. Finally, just project the photo onto the elements of the model using the option on the Photo Match Dialog.
  • Taking a model to particular coordinates

    44
    0 Votes
    44 Posts
    2k Views
    TIGT
    Thanks Dan. As explained my example is just an example - you need to tailor it to you needs so 'f' >>> 'machine' with the .3ds added etc... In you example it much more difficult to read than mine. Your 'processing' is inside the if...end test when rotation is set, BUT my way will work with less likelihood of massing up - you simply gather the 4 lines of data as I show and use the references you set from them to do your processing for each 'machine'...
  • [code] reading a CSV file

    5
    0 Votes
    5 Posts
    3k Views
    Dan RathbunD
    @zps222 said: Hi, Dan, I simply paste "module MyTopLevelNamespace" in to Ruby console window of SU, but the error comes. So why? A module definition is a block statement. It's meant to be read by the interpreter. The console is a line evaluation function. You CAN make a module at the console by putting it all on 1 line, like: module Zps222; def say_hello(); puts "Hello!"; end; end YOU are supposed to choose YOUR OWNidentifier for a toplevel module name (namespace.) Replace "MyTopLevelNamespace" with a unique name that YOU decide. (You can use Zps222, or whatever you want, as long as it is unique for YOU, and noone else will use it.) Also "MyPlugin", you change it to whatever name you want your plugin to be. @zps222 said: By the way, can I use eclipse to run your code? Yes. This code is not Sketchup specific. It's just plain old standard Ruby.
  • Getting info from a text file

    5
    0 Votes
    5 Posts
    420 Views
    Dan RathbunD
    By the way... if YOU are creating the files.. why not simplify things and write out CSV records, where each line is: "string tag",x,y,rot We have a topic on reading CSV text files: [code] reading a CSV file EDIT: Oh you are using MatLab written files, as in this post http://forums.sketchucation.com/viewtopic.php?f=180&t=35961&start=30#p319047
  • Help with using begin, rescue, end

    12
    0 Votes
    12 Posts
    972 Views
    C
    As a good rule of thumb you should only use the begin..rescue..end construct for situations where if an error occurs you need to do something to prevent undesirable side effects. The most common example is with file handling, so say you open a file stream for reading and the program crashes in some way, it's important that you close the file even though it crashes. It is also considered good practice to only suppress the specific type of error that you're having trouble with, as suppressing all error can make debugging very difficult down the road. Also, you're testing using "arc_entities[0]!=nil" when you could test "!arc_entities.empty?" instead, which the code a bit more descriptive, although as already mentioned the .each method was designed for this sort of thing.
  • Flipping texture to opposite face.

    3
    0 Votes
    3 Posts
    217 Views
    J
    This sounds like it could work, as soon as i get chance i'll have a look. Many thanks, much appreciated!
  • Color in add_line?

    3
    0 Votes
    3 Posts
    229 Views
    S
    Found this: Edge color by material http://forums.sketchucation.com/viewtopic.php?f=180&t=35443#p312624 thx
  • Problem adding a face's edges to a layer.

    5
    0 Votes
    5 Posts
    229 Views
    honoluludesktopH
    Tig, Thanks.
  • If else

    15
    0 Votes
    15 Posts
    416 Views
    C
    From the looks of your code you're interested specifically in blocks of four lines, in which case you may gain some mileage out of the array.slice method by doing the following. for i in 0..a.length/4 #there are i blocks of four lines machine,x,y,rot = a.slice(i*4,4) #more code end
  • Compound Transformation

    11
    0 Votes
    11 Posts
    693 Views
    C
    @thedro said: Sorry, I realize how unclear that was since wanting to separate isn't related to the same situation as combining them. How very true. In the math world this is generally called matrix decomposition, and there are various schemes to do so depending on what information you're looking to extract. Some information is really easy to find, others are very hard. Scaling isn't to bad however. If you use the transforms .to_a method you'll get a 16 number array. It's best to think of this array as a 4x4 grid, with each group of four entries being one column of the matrix. The reason for this is that you can then interpret each column meaningfully by looking at your axis will change with respect to the transformation. If you think of your coordinate system as an x, y and z-axis together with an origin, then the first column is your x-axis, the second your y-axis, and the third your z-axis and the last column the origin. The only trouble here is that all of the columns have four entries while each of those vectors should only have three. This is pretty easy to resolve however since the last entry of the first three columns will always be 0, and the last entry of the final column will almost always be 1. I say almost always because there is one important exception, which is that if you use use the Transformation.scaling method, then this entry will be the reciprocal of the scaling factor. So for example Geom::Transformation.scaling(2).to_a[-1] will return 0.5, which is 1/2. This somewhat complicates finding the scale factor in that you can't just look at the length of the x-axis in the transformation to find the x-axis scaling, but you can however divide by the this value to achieve the full scaling in that direction. In general you can always take a transformation's array and divide each entry by the value in that last column to "normalize" the last value to 1 without actually changing how the transformation works. I won't bore you with the logic behind why they use this scheme, just know that it simplifies the math behind a number of common operations in computer graphics so they aren't just trying to invoke your wrath.
  • Quick theoretical question

    12
    0 Votes
    12 Posts
    385 Views
    M
    Super helpful, as always. Thanks.
  • Help with toolbars

    6
    0 Votes
    6 Posts
    411 Views
    Dan RathbunD
    Hello Christain... you describe a Mac quirk. I believe that there is work-around for that, but I am not a Mac user. Can any Mac guys explain to him how to get new toolbars to save position ?
  • Have moved to Linux Mint 10. Sketchup in Linux?

    10
    0 Votes
    10 Posts
    2k Views
    A
    As far as I heard from a Googler, they would like to completely overhaul the UI, but don't have the time. If they cannot achieve this, then the chance of porting SketchUp to another toolkit is rather low. Although Google massively applies Linux in its company (Maps developers, streetview etc.), they consider for their products mainly the market share outside the company (whereas the Mac OS X share is mostly a US phenomenon). In the SketchUp Help Forum, there are rapidly increasing requests for a version for iPad, iPhone, but also Android and ChromeOS (?) users demand their rights. I think if Google will ever support another platform, then it would be the web.
  • How make a window like the components window

    5
    0 Votes
    5 Posts
    344 Views
    Dan RathbunD
    Reread my previous post. Then readup on Components and Dynamic Components (which are actually Components with special Attribute Dictionaries.) What you really need to do is create a Building Component Manager plugin. But the buildings themselves will have to be Components, and/or Dynamic Components (which will likely have a "Building" Attribute Dictionary attached to them, with keys and values that your manager will use to keep track of and organize them.) Now.. it IS possible that within your manager namespace, you can have a class Building, whose instances hold a reference (instance variable,) to a Component Instance that is actually in the model. The SKP file format has an embedded thumbnail image, which if you have that file in a link in the browser (I'm talking webdialog,) then the thumbnail should display just as if you had any other image filetype on a webpage. It may be possible to drag and drop from the webdialog into the Sketchup client area. (We know we can do this from a folder explorer window.) Do a search for other topics on "Warehouse" as others have discussed making a webdialog or website similar to Google's 3DWarehouse. You may pick up some ideas in those threads.
  • Akshell.com - web based javascript IDE

    3
    0 Votes
    3 Posts
    620 Views
    tbdT
    for writing server code I usually do it on heroku as I can use Ruby, but on akshell everything is in the browser, with no install needed.

Advertisement