ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Get rotation(transformation)

    31
    0 Votes
    31 Posts
    1k Views
    jolranJ
    I finally got TIG's version going(forgot to comment out #def.self when running it in R.code.editor, amanidiot!) SOme funky thing going on when changing hatch_angle. But its stable and works in any axis. Not what can be said about "my" script. A bit unstable, until the intersectionpart. My intuition tells me doing copying edges within groups + intersection gives more predictable hatch_result when rotating hatches. But is alot more unstable when gathering and erasing? Plan A: Stop whining and get the work done so Layout-users finally have a hatch-plugin Plan B: Adjust TIG's script so it works in all angles, with menus and such. (will be difficult, since I don't totally understand it yet) PlanC: Continue to work on mine(a bit egoistic but I won't learn from copy/paste), integration as much of TIG's script as I can, thus make my script more stable if possible. However. That might not be possible, and I would have to do at least 5 different methods for views. I guess I'm asking if there is any pointers for things to avoid that make this script crash.
  • How to detect the closed body?

    6
    0 Votes
    6 Posts
    206 Views
    voljankoV
    Ok,I like this definition:If all the edges in the geometry have 2 faces ,it is a solid. Maybe I have complicated a little
  • PolygonMesh behavior

    34
    0 Votes
    34 Posts
    2k Views
    thomthomT
    @adamb said: @thomthom said: I did that for Vertex Tools, I take the average normal of the faces connected to the vertex. You're missing a step with your averaging there. You need to weight by the contribution each face connected to the vertex makes - ie weight by the interior angle otherwise a cube constructed of triangles will end up with vertex normals not all pointing out exactly at 45 degrees. How does one do that?
  • Very difficult key codes!

    10
    0 Votes
    10 Posts
    626 Views
    TIGT
    Also note that TAB on MAC only fires with onKeyUp and is ignored otherwise ! The TAB key == 9 or 15 or 48 [for PC or MAC or ??]
  • Iterator problem

    16
    0 Votes
    16 Posts
    504 Views
    Dan RathbunD
    @spireup said: Now Im just trying to get the syntax right for those inner args arrays. eg(not working) class WidgetSet < Array > end # class > > class Widget < Hash > > attr_accessor ;arg1, ;xPos, ;yPos, ;zPos, ;height, ;width, ;type > > def initialize(arg1, xPos, yPos, zPos, height, width, type) > > Hash.new["arg1", arg1, "xPos",xPos,"yPos",yPos,"height", height, "width", width,"type", type] > @arg1 = arg1 ##etc for each arg > MyWidgets < self > end It does you no good to construct an object without a reference to it (the line with Hash.new). If you want to use a Hash, then use one for your Widgets. They need not be a custom subclass, unless you need custom methods. Hashes dont need attributes (instance refs,) because they use key / value pairs, instead. my_widget_1 = { 'xPos' => 3.4, 'yPos' => 1.0, 'zPos' => 2.3, 'height' => 6.784, 'width' => 4.0, 'type' => "some_type" } There is another thread on how to save and retrieve hashes into/from an Attribute dictionary. see: http://forums.sketchucation.com/viewtopic.php?f=180&t=30066 Arguments: *list_name compacts an argument list into a local array referenced by list_name Within the method, you can access array elements using the [] method. def some_method(*args) @xPos =( args.size>0 ? args[0] ; 0.0 ) @yPos =( args.size>1 ? args[1] ; 0.0 ) # etc. end If you use 5 arguments, but a call gives more than 5, the addtional arguments will be still be stored in the local array, and no ArgumentError, will be raised. I suggest you visit the Code Snippet index: http://forums.sketchucation.com/viewtopic.php?f=180&t=28846&p=323876#p322175
  • Looping over menu item creation

    4
    0 Votes
    4 Posts
    182 Views
    P
    Thank you Jim! That did the trick! So .each method does not hold the iterator variable, but a for loop does in Ruby. Good to know. Thom, I'm only inspecting the first item that is selected. I'm hoping that doesn't load the entire selection set and cause delays. I'm a relatively novice programmer so I don't really know, but I don't see any studdering with the menu when I have a large selection.
  • Random Push Pull by Tig

    11
    0 Votes
    11 Posts
    15k Views
    TIGT
    Here's a new v2.0 that tidies it up a bit... http://forums.sketchucation.com/viewtopic.php?p=340452#p340452
  • Text tool default text

    3
    0 Votes
    3 Posts
    115 Views
    Dan RathbunD
    It's likely that "Enter Text" is a localized string, defined within the Sketchup executable's resources (ie, a string table.) It will change depending on which language edition the user is running. You could write a custom Text tool, and use either UI.inputbox() or a UI::Webdialog instead.. then you can control what the default text is.
  • Newbie to Sketchup / Ruby

    12
    0 Votes
    12 Posts
    2k Views
    J
    Bill, Serge, Everyone - I've moved the Hotkeys discussion to a new topic. Keep on trussing.
  • Mac $LOAD_PATH and Examples Scripts Extension

    8
    0 Votes
    8 Posts
    342 Views
    Dan RathbunD
    @unknownuser said: sort of off topic but.. when lion is released this month, the user library is hidden by default.. pretty much anything messing with the user library is going to become more complicated to describe to other users as there's going to be an extra instruction needed to explain how to unhide it or how to find it.. Well.. not really off topic... this has become a continuation of anothor thread (also started by Jim I think, titled something like, "Where to store user files" or similar.) In that thread I explained that Windows has hidden (maybe since Win95?) the user's %AppData% path. I can see it because I always go into the File Settings and set show all files types and file extensions. (What can I say... geeky as charged.) Weird that OSX gets more like Windows.. and Windows is now built upon a Linux core.
  • Observer question

    5
    0 Votes
    5 Posts
    355 Views
    P
    suberb, and this on a sunday!!! Thx tig and dan, much appreciated!
  • Copy _ group array(newbie)

    10
    0 Votes
    10 Posts
    327 Views
    jolranJ
    AAHH! Yes! Now it works. I spotted the . 25cm mistake. But did not think about the spaces. Thank you very much TIG and Jim!! I've learned a lot from this. Now I need to learn what has really happend in the code And acctually I only needed 1 edge in the group. I did not know one could add the entities in an empty group. This is a lot better.
  • Class struggle

    4
    0 Votes
    4 Posts
    138 Views
    S
    ThomThom thanks so much! Paul
  • Reloading plugins while SketchUp is running

    5
    0 Votes
    5 Posts
    2k Views
    J
    That fixed the 'issue', thanks
  • Solids Penetration Check plugin

    5
    0 Votes
    5 Posts
    228 Views
    voljankoV
    Here it is,my first public plugin In some cases the intersections between solids can be considered as mistakes. Just select some SOLIDS and click the Solids Penetration Check from the Tools menu. The intersections between solids will be highlighted (selected) and colored red. What do you think about it?
  • Does anyone use UML?

    10
    0 Votes
    10 Posts
    1k Views
    T
    Thank you for all your imformation! UML seems to be not so popular. But thank you for the link!!
  • OnCancelEvent - Differentiating Undo from Redo

    6
    0 Votes
    6 Posts
    428 Views
    thomthomT
    @unknownuser said: You are right again. I found that you have to remove the observer (in the deactivate). Otherwise, in new instances of the Tool class, you will get the observer notifications of the ones previously created! I've begun to make my observers into Singletons. So I can use a factory method to get the singleton instance at any time when I need to add / remove the observer.
  • How to make a component-placer tool?

    9
    0 Votes
    9 Posts
    307 Views
    D
    @unknownuser said: And you also need to listen to the ToolsObsever to check if the user activates another tool - instead of actually placing the component. That doesn't seem to be an issue. onComponentInstanceAdded gets fired when the component is placed, not when you activate the tool.
  • Reverse Face Script

    12
    0 Votes
    12 Posts
    2k Views
    TIGT
    If you have made [or imported] a model where the back faces are the wrong way round but have been textured as if they were the front face - visible when viewed in Monochrome mode - then my FixReversedFaceMaterials script tools can help... http://forums.sketchucation.com/viewtopic.php?p=264134#p264134
  • Some critique

    7
    0 Votes
    7 Posts
    458 Views
    D
    Saying that Ruby doesn't have variables is plain wrong though. Even if the variables just hold references to objects, they're still variables, and the term "instance variable" is found throughout most object oriented programming languages (and I think the fact that Matz himself calls them variables is proof enough that Ruby has variables :)) Of course it might be wrong to compare BASIC variables and Ruby variables, but then it's also wrong to compare apples and oranges.

Advertisement