🏒 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Advice : Developing Ruby extension for Sketchup (Windows)

    4
    0 Votes
    4 Posts
    225 Views
    Dan RathbunD
    You have read the FAQ page I made? [Info] C/C++ Ruby extensions & SketchUp plugins
  • Understanding Variables

    3
    0 Votes
    3 Posts
    155 Views
    A
    Okay, now I know!! And yeah at first my question made sense to me, but now it doesn't! Thanks
  • TextTag

    15
    0 Votes
    15 Posts
    3k Views
    TIGT
    If you are using Layout you are better off doing your text in Layout. This is a pretty old tool! Try my 2dTools 2dText - it's much more flexible than this old thing... BUT the size is fixed height - you can make it sat 100mm and then make three copies scaled at x2 and x3 use layers called TEXT-100, TEXT-200 and TEXT-300 etc. Put copies on different layers and have only one layer on in a scene-view. Then you can switch the layers as needed so text size seems to varying. 2dText is a 'component' so making layered copies means you can edit one and they'll all change across the layers and the scaling will be kept too...
  • Another grouping a group issue?

    10
    0 Votes
    10 Posts
    180 Views
    Dan RathbunD
    @tomot said: Interesting! I have 2 scripts, on replicates joists the other studs both use count. One script constantly gives me an '<' error in the console the other does not. ....very aggravating! Yep.. and same with: entities.add_instance(count, t) The word 'entities' is a method name. It often works OK, but is poor form. Using something like: grp_ents.add_instance(joist, tx_vec) is much better, and more understandable.
  • DC instance make unique

    22
    0 Votes
    22 Posts
    622 Views
    Dan RathbunD
    @jolran said: However there is no "glue_to" method for groups in the API. Right.. and you should not use a Group, for the job of a ComponentInstance. Groups are best used for temporary editing both manual and in scripting. By collecting objects together into a Group, you can: move them from one edit context to another, protect them from being modified by crossing edges, apply a tranform to a set of objects all at once (where they move, scale or rotate all together.) I would say, that when you get a "set" of objects the way you want, and then wish to use that set multiple places in the model, it's best to then convert them into a ComponentInstance. Especially if your going use scripting, to manipulate them, or glue them to faces.
  • Geom.intersect_line_plane = point3d?

    5
    0 Votes
    5 Posts
    207 Views
    Dan RathbunD
    @voljanko said: I can not set my browser (chrome) to show the comments. You are seeing the localized language version of the API page. Somehow you must try to set Chrome to English, so you can see the main English pages that have the comments. This is a known issue with the API Doc pages, and complaints have been logged with Google.
  • API redefinition required!

    9
    0 Votes
    9 Posts
    434 Views
    T
    @tig said: Please don't use global $ variables unless you really have to Rats! I can't count how many times I have been reminded of that issue. My typical response: I use global's so I can verify the 3d point location in the Ruby console, I need this to verify any mistakes I may be making (which happens frequently !) when I'm developing a script which corresponds to 3d points on my gridded 1/4" notepad. It would be really nice if @ variables where able to display the same information in the Ruby console.
  • Deleting group.copy?

    8
    0 Votes
    8 Posts
    210 Views
    L
    Yeah, that worked, and not having to explode my group fixed a lot of problems. Thank you!
  • Angle between two edges in a face?

    11
    0 Votes
    11 Posts
    686 Views
    TIGT
    My code was a quick example to show that you could get the correct angles. Of course edges=face.edges can easily be replaced with edges=face.outer_loop.edges or we iterate through the loops to get their edges in turn... BUT if its for only one vertex it's then easy enough to find the two edges belonging to that vertex [and that face] and run similar code on them to get the angle between them, using the face normal and vectors cross comparison to trap for concave corner angles >180 degrees... remembering to trap for ==180.degrees, as well as < and >...
  • [Code] How do you compute weighted vertex normals?

    26
    0 Votes
    26 Posts
    6k Views
    thomthomT
    Now I seemed to have corrected it. I had to ensure the vectors I used came in the same direction as the edge loop.
  • Writing to specific lines in a File

    4
    0 Votes
    4 Posts
    97 Views
    Chris FullmerC
    Awesome Dan, thanks! I'll go look into those.
  • 2 issues; inheritance &amp; require ?

    10
    0 Votes
    10 Posts
    170 Views
    T
    @dan rathbun said: @tomot said: Unfortunately some addons today wont run anywhere else than from c:\Program Files That's not your fault.. it's the fault of the plugin author. If they are not scrambled, you can tweak them... if they are, you can try to ask the author to fix the plugin. A friend of mine recently said " if I want an appliance I'll buy a MAC if I want a computer I'll buy a PC. I think Microsoft is heading down the same road as Apple. A pay for everything, the user wants, freeway! So I saved $350.00 by NOT having Apple install a new HDD, on my wife's iMac, I did it my way! [image: YNLo_imac.jpg]
  • Sketchup kind of 'stuck' after scripts

    13
    0 Votes
    13 Posts
    260 Views
    TIGT
    Sketchup.send_action("selectSelectionTool:") should work cross-platform - it's only the numerical codes that are PC specific like Sketchup.send_action(10501) which is PC only whereas the equivalent Sketchup.send_action("viewTop:") works on PC & MAC...
  • Free Chinese localization

    12
    0 Votes
    12 Posts
    700 Views
    Dan RathbunD
    Language translators, and proofreaders needed. http://forums.sketchucation.com/viewtopic.php?f=323&t=36465&p=350198#p350198
  • Changing View with Ruby

    9
    0 Votes
    9 Posts
    201 Views
    T
    @dan rathbun said: Secondly... your breaking a cardinal rule of global variables. DO NOT create them only for use by one single plugin, or for only YOUR own use. Create either Constants, or Module or Class variables, within YOUR namespaces. (That way they will not conflict with other sloppy scripts that are using globals of the same name.) My bad! I only use global variables to confirm values in the Ruby console, If the console could evaluate @ variables I would never, never ever use $ variables.
  • File, Dir, IO - wow I struggle

    8
    0 Votes
    8 Posts
    343 Views
    Chris FullmerC
    Ahh, interesting. Odd to me that a and w both make new files, but r does not. Oh well. Very good, now to fill my files with useful data. Thanks guys, Chris
  • Messed up model

    6
    0 Votes
    6 Posts
    163 Views
    TIGT
    If you erase a long edge and draw another one there is no new face, if you erase a short edge and draw another one there is a new face. This s is a common issue with manually drawn faces where tiny tolerances cause issues, BUT the edges are coplanar enough to keep a face!
  • Triangulate concave mesh

    8
    0 Votes
    8 Posts
    476 Views
    Chris FullmerC
    I've got a personal plugin that does this. I shoot rays to test if the line crosses an edge. It works well enough. Though I am not triangulating from each vertex, but from the cursor. I could email you a copy if you want to see it in action. Chris
  • Copy array (again)

    5
    0 Votes
    5 Posts
    146 Views
    jolranJ
    Ok..................
  • Move an edge?

    13
    0 Votes
    13 Posts
    672 Views
    thomthomT
    @tig said: Moving one vertex and then perhaps another will often have a quite different results, compared to moving them all in one fell swoop with the entities. transformation methods that do all of the changes together... Plus - it's much much faster to perform one big entity transformation instead of many.

Advertisement