🚨 Skimp | 25% Off until March 30 Buy Now

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
  • Import image (in padded cell..!)

    16
    0 Szavazatok
    16 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @tig said: I assumed that if you stop a timer it's the same as ' break' in a block, so then it'd never get to image.erase!, but having tested it I see that it complete the entire iteration after the timer is stopped ! Of course it does. A timer just loops and calls the block on the set interval. (The setInterval timers in Javascript work the same way.) This why you should always stop the timer immediately when the condition is met. Otherwise the block gets queued up to be executed again, perhaps even before the first time is done doing it's work. @tig said: I don't immediately see the advantage of using @tid over tid - the block of code executed by the timer is referring back to itself, ... Sometimes it works. But I have experienced that in some situations, the ID reference becomes invalid (perhaps gets garbage collected.) And then the call to stop the timer does not work. [I remember having a discussion with Jim Foltz about timer IDs being invalid, or garbage collected.] The Ruby docs say a proc is supposed to have access to it's environment (like a snapshot,) when it is defined. But the API UI timer is implemented on the C++ side. @tig said: ... it's not like we are stopping it in another def method ? I always assume code samples are going to run in a method. It is rare that code is something that runs once at startup, (although we sometimes do post code like that.) THIS feature we are discussing, is something that will be used "on demand" (by a end user,) in a Tool class or a UI::Command, which means it'll likely be wrapped in a method. Bottom line, ... the above is my best advice on best practice. Believe or not, as you will. It is not arbitrary. I have had timer use fail in the past when using local var for the id. Perhaps under Ruby 2.0, things have changed with regard to the timer IDs, .. but I still always use a persistent reference for timer IDs on the Ruby side, until I know it is no longer needed. As far as using rescue in modifier position goes, that is a no brainer. (And is not a best practice rule I made up. I got it from one of the Style Guides or maybe the "Pick-Axe" book.) begin; statement; rescue; end is just plain uglier, and doesn't read as nice as: statement rescue nil
  • 2D Export > Export All Scenes?

    20
    0 Szavazatok
    20 Hozzászólások
    13k Megtekintések
    J
    Thanks for all the replies even though it sounds as though what I want isn't easily obtainable! Yes, I was talking about Didier's ADO plugin. I'll remove the files from my plugins folder as suggested though they didn't get loaded by SU 2015 at all that I could see. Jon
  • PLUGIN - some help please

    4
    0 Szavazatok
    4 Hozzászólások
    471 Megtekintések
    xombie1912X
    @tig said: So, what I see is a parametric 'box', which is an effective 'wall'. What is it you are trying to do in a SketchUp Plugin ? There are already some examples of parametric forms - e.g. su_shapes available from the EW... THANKS TIG i want to do a block workflow this is a older research i made with autocad and sketchup http://www.youtube.com/watch?v=Q4hqt_aNuog sorry its in spanish language because its an older research i made its like revit or archicad the problem i have in this research its the time for export and the materials and my new research i want to do its make a plugin can swap 1 component and other instances for other component with no exactly the same name example in autocad i use component bed-A if i export to sketchup i want to select and replace for bed-B or bed-C bed-A its a line block in autocad bed-B its model for sketchyp in the same folder the bed-A is and the bed-C its proxy the final result you can swap or replace every autocad blocks you work for sketchup 3d models or proxys with a few clicks in sketchup
  • Delete hidden geometry

    3
    0 Szavazatok
    3 Hozzászólások
    2k Megtekintések
    B
    Ok found it, I installed the thomthom's CleanUp toolset and using the "merge faces" did the trick (5119 faces merged). Saved me a lot of work thanks for the suggestion! Regards, Boein
  • Test Comp to see if it has Nested Components

    4
    0 Szavazatok
    4 Hozzászólások
    472 Megtekintések
    Dan RathbunD
    A bit shorter ...more brute force. The any? enumerable method returns boolean and stops on the first true result: return unless obj.respond_to?(;manifold?) ents = obj.entities rescue obj.definition.entities any = ents.any? {|e| e.is_a?(Sketchup;;ComponentInstance) } exp = any ? "Yes" ; "No"
  • PolygonMesh triangulation... ?

    23
    0 Szavazatok
    23 Hozzászólások
    3k Megtekintések
    thomthomT
    IN Ruby 1.8 for loops used to be faster - at least in the tests I performed on my extensions. But Ruby 2.0 swapped that around. In any case - you don't really know until you profile your specific case.
  • Plane

    3
    0 Szavazatok
    3 Hozzászólások
    426 Megtekintések
    S
    As happens too often in the API docs, they give a technically correct but superficial definition and expect you to figure it out on your own. If you care, when a plane is represented as [Point3d, Vector3d] The point is a location on the plane, and the vector is the normal to the plane. When a plane is represented as a four-element array, the first three values are the x,y,z components of the normal vector to the plane, and the fourth value is the distance from the origin to the plane along the normal vector. Face#plane returns this version.
  • Passing instructions to active tools

    4
    0 Szavazatok
    4 Hozzászólások
    435 Megtekintések
    thomthomT
    Yea, even the Line tool has a lot of details. I've been replicating Rotate and Move in Vertex Tools. So much more than I originally though. Recently I started on a custom version of PushPull - it's giving me nightmares...
  • Geometry in which group after boolean subtract??

    3
    0 Szavazatok
    3 Hozzászólások
    408 Megtekintések
    Dan RathbunD
    Also, if the subtract statement is the last one evaluated in the method, it's result will be the return object from the method itself. Otherwise you can insert a statement like: return result as the last statement.
  • Getting Rotation Value From Rotate Tool

    4
    0 Szavazatok
    4 Hozzászólások
    413 Megtekintések
    Dan RathbunD
    @kayeee said: Thank you! Exactly what I needed! To see how to wrap that up into a macro file, look at the sample I posted here: forums.sketchup: [Code] Determining Angle Between View and Model’s Axes
  • How to pushpull through a 3d object?

    4
    0 Szavazatok
    4 Hozzászólások
    537 Megtekintések
    TIGT
    Make the new geometry inside a temporary group. Make edges, find_faces of one edge you know will be the loop. Get a reference to the face as I shewed... PushPull in the group. Explode the group when done. If you have a series of ordered points [or edges] they will work with add_face If you have a 'donut shape' face, you need to make the inner face [that will eventually be a hole], get a reference to it, then make the outer face, now erase the inner face to leave a hole. Or find_faces for inner and outer loops' edges, then collect the faces into an array faces=gents.grep(Sketchup;;Face) faces.each{|face| face.erase! if face.loops.length == 1 ## the face with will be the hole - erase it. face.loops.length > 1 ## will be the donut. }
  • Add_face from edges??

    8
    0 Szavazatok
    8 Hozzászólások
    783 Megtekintések
    Dan RathbunD
    @wawmsey7 said: > edge1.transform!(tr) > again the edge draws fine but my rotation code throws up an error! Matt, have the Ruby Console open when testing code, and paste the error message in the post, if your asking about Ruby errors. The first error message line in the backtrace will contain a sub-string like: “filename:lineNo: inmethod'”or “filename:lineNo.”` which tells you exactly what ruby script, it's line number, and possibly the method that it occurred within. The message tells you (usually) exactly what went wrong. For example, Error: #<NoMethodError: undefined methodtransform!' for #Sketchup::Edge:0x00000009e8e690>... tells you that the Sketchup::Edge class has no instance method named " transform!`". So at that point your quickest way to resolve your dilemma, is to go to the API's Method index, and find methods in the "T" category that have to do with transformations. See Exception class, backtrace() method. And more generally dealing with exceptions.
  • Can't glue to face that Sketchup thinks is deleted

    6
    0 Szavazatok
    6 Hozzászólások
    556 Megtekintések
    TIGT
    @Dan you are right. Typo mess. I've corrected the original post.
  • [code] On Screen GUI RGB Colorpicker

    14
    0 Szavazatok
    14 Hozzászólások
    3k Megtekintések
    D
    download the ruby file... open SU menu >> 'Window' >> 'Ruby Console' copy/paste/return the first line load "~/Downloads/rgb_picker.rb" should return true in 'RC' if that's of your path... copy/paste/return the second line... Sketchup.active_model.select_tool(Col_pick.new) should work... hit spacebar to close the color picker... john
  • Making submenu

    7
    0 Szavazatok
    7 Hozzászólások
    779 Megtekintések
    K
    Ok, Thanks, Dan I will be able to fix it by myself ) Thank you!!
  • Vertex ordering problem

    8
    0 Szavazatok
    8 Hozzászólások
    732 Megtekintések
    tt_suT
    We actually had this issue with the STL exporter. STL doesn't have object hierarchy so we must export everything into one big mesh. See issue here: https://github.com/SketchUp/sketchup-stl/issues/129 Then I think the commit that fixed was this one: https://github.com/SketchUp/sketchup-stl/commit/4ad199a2d46245f2a668e47f2ee81bc36c9b9763
  • SDK: Get Images data

    7
    0 Szavazatok
    7 Hozzászólások
    775 Megtekintések
    tt_suT
    @marc477 said: What is the equivalent of SUTextureGetImageData for a SUImageRef? How can I access images pixel data? Update - SUImageGetData should be equivalent. http://www.sketchup.com/intl/en/developer/su-api/image_8h.html#aedb99aee21a39619602866fc400766cb
  • Google Code Shutting Down

    5
    0 Szavazatok
    5 Hozzászólások
    531 Megtekintések
    thomthomT
    I'll ping Chris as well.
  • Win32ole access violation

    5
    0 Szavazatok
    5 Hozzászólások
    703 Megtekintések
    icehuliI
    I think you need to use another thread for the WinForm windows, e.g MessageBox. I checked the following code. It works. It actually makes more sense to let the WinForm window in a separate thread other than the Sketchup's thread. Imports System.Windows.Forms Public Class MyFunctions Private Sub showMessage(ByVal msg As String) MessageBox.Show(msg) End Sub Public Function AddMyValues() Dim Result As Double Result = 20 Dim t1 As New Threading.Thread(AddressOf showMessage) t1.Start(Result) Return Result End Function End Class
  • Odd results from add_circle/add_face combo

    10
    0 Szavazatok
    10 Hozzászólások
    929 Megtekintések
    thomthomT
    [image: 0Fbs_2015-04-06_21h44_53.png] For for me as well - SU2015 Win8.1. Have you tried with extension disabled?

Advertisement