⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Delete hidden geometry

    3
    0 Votes
    3 Posts
    2k Views
    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 Votes
    4 Posts
    417 Views
    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 Votes
    23 Posts
    3k Views
    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 Votes
    3 Posts
    387 Views
    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 Votes
    4 Posts
    386 Views
    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 Votes
    3 Posts
    368 Views
    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 Votes
    4 Posts
    370 Views
    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 Votes
    4 Posts
    455 Views
    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 Votes
    8 Posts
    704 Views
    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 Votes
    6 Posts
    497 Views
    TIGT
    @Dan you are right. Typo mess. I've corrected the original post.
  • [code] On Screen GUI RGB Colorpicker

    14
    0 Votes
    14 Posts
    3k Views
    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 Votes
    7 Posts
    678 Views
    K
    Ok, Thanks, Dan I will be able to fix it by myself ) Thank you!!
  • Vertex ordering problem

    8
    0 Votes
    8 Posts
    663 Views
    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 Votes
    7 Posts
    715 Views
    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 Votes
    5 Posts
    472 Views
    thomthomT
    I'll ping Chris as well.
  • Win32ole access violation

    5
    0 Votes
    5 Posts
    634 Views
    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 Votes
    10 Posts
    808 Views
    thomthomT
    [image: 0Fbs_2015-04-06_21h44_53.png] For for me as well - SU2015 Win8.1. Have you tried with extension disabled?
  • Exit a script before it completes

    4
    0 Votes
    4 Posts
    468 Views
    G
    My client wants to be able to stop the process. I've got him copying a file named stop.txt into a folder. I check it every loop. Works great.
  • Start_operation/commit_operation with sandboxTools

    10
    0 Votes
    10 Posts
    652 Views
    fredo6F
    Just published the API in the main TopoShaper thread. Documentation is attached in the main post. Fredo
  • Volume calculation issue with scale in group

    9
    0 Votes
    9 Posts
    825 Views
    TIGT
    If you are in an edit context the model.active_path returns an array of the 'containers' - groups/instances - so you can directly get the volume/scaling of those to apply to the object in question ? This assumes you physically [pre]select the object you are testing - which by its nature sets up the active_path [or nil if in the model] for you. I think there is a possible 'trick' using a new input_point and pickhelper.all_picked or .path_at ? Getting an array of all of the picked point's nesting ? None of this is easy

Advertisement