Mac User? | Join the Rayscaper Beta for Mac Learn More

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • PolygonMesh behavior

    34
    0 Szavazatok
    34 Hozzászólások
    4k Megtekintések
    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 Szavazatok
    10 Hozzászólások
    1k Megtekintések
    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 Szavazatok
    16 Hozzászólások
    1k Megtekintések
    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 Szavazatok
    4 Hozzászólások
    362 Megtekintések
    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 Szavazatok
    11 Hozzászólások
    15k Megtekintések
    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 Szavazatok
    3 Hozzászólások
    285 Megtekintések
    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 Szavazatok
    12 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    8 Hozzászólások
    690 Megtekintések
    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 Szavazatok
    5 Hozzászólások
    596 Megtekintések
    P
    suberb, and this on a sunday!!! Thx tig and dan, much appreciated!
  • Copy _ group array(newbie)

    10
    0 Szavazatok
    10 Hozzászólások
    749 Megtekintések
    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 Szavazatok
    4 Hozzászólások
    296 Megtekintések
    S
    ThomThom thanks so much! Paul
  • Reloading plugins while SketchUp is running

    5
    0 Szavazatok
    5 Hozzászólások
    2k Megtekintések
    J
    That fixed the 'issue', thanks
  • Solids Penetration Check plugin

    5
    0 Szavazatok
    5 Hozzászólások
    473 Megtekintések
    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 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    6 Hozzászólások
    807 Megtekintések
    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 Szavazatok
    9 Hozzászólások
    753 Megtekintések
    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 Szavazatok
    12 Hozzászólások
    2k Megtekintések
    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 Szavazatok
    7 Hozzászólások
    843 Megtekintések
    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.
  • Module class method defining confusion

    10
    0 Szavazatok
    10 Hozzászólások
    1k Megtekintések
    Chris FullmerC
    That is great Dan, thanks so much. That is very helpful, and is finally all starting to soak in and make sense. I don't entirely understand where I would use some of this, but I'm sure at some point I'll come across good reasons for things like module methods and mix-ins. I'm just not there yet in my programming needs. But a big big thank you for taking the time to write this out. Its very helpful, Chris
  • Who changed extensions.rb?

    22
    0 Szavazatok
    22 Hozzászólások
    3k Megtekintések
    fredo6F
    @chris fullmer said: Could we just re-write the sunposition plugin and send him an updated copy? It does not re-write that much. I started doing it yesterday, but in the end got in a little bit over my head. Anyone wanna give it a go? Chris Chris, I did it actually. See this post, which contains the modified version May be we should publish it in a place which is more accessible Fredo

Advertisement