ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Geometry in which group after boolean subtract??

    3
    0 Votes
    3 Posts
    296 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
    308 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
    370 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
    521 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
    430 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
    578 Views
    K
    Ok, Thanks, Dan I will be able to fix it by myself ) Thank you!!
  • Vertex ordering problem

    8
    0 Votes
    8 Posts
    583 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
    666 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
    375 Views
    thomthomT
    I'll ping Chris as well.
  • Win32ole access violation

    5
    0 Votes
    5 Posts
    573 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
    585 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
    415 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
    508 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
    667 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
  • Misbehavior when work axes have been moved/rotated

    7
    0 Votes
    7 Posts
    413 Views
    PixeroP
    Big thanks. I will try this. I think I only need the orientation.
  • Entity.transform!

    7
    0 Votes
    7 Posts
    481 Views
    tt_suT
    By the way, if you transform multiple entities it's faster to do it in bulk with Entities.transform_entities or Entities.transform_by_vector. Ditto for erasing and selecting - the performance differences between doing this in bulk is significant. Whenever you use erase! or transform! etc or any other single entity action within a loop consider the bulk alternatives.
  • Two plugins needed to properly integrate VRAY with Sketchup

    13
    0 Votes
    13 Posts
    2k Views
    G
    Thread has been inactive for a while, but the 'Faceme' component issue has been fixed with V-Ray 2.00 and Sketchup 2015. Either when rendering animations or batch rendering scenes. I run through this issue with previous version of V-Ray. Works fine right now, and 'faceme' component shadows are now also taken in into account...
  • Question about edit_transform

    11
    0 Votes
    11 Posts
    2k Views
    Dan RathbunD
    @danmacumber said: This post indicates that this method is provided by the Dynamic Components extension. Correct. However, those methods that are listed as added to Sketchup::Drawingelement, that have to do with transformations, should not have been added at that level of the class hierarchy (in order to just add them to the Group and ComponentInstance subclasses.) IE, they got erroneously added to ALL Sketchup::Drawingelement subclasses. Those methods are meaningless with respect to primitive entity classes like Edge. They should (and may in the future,) be defined within a mixin module, and then mixed ONLY into Sketchup::Group and Sketchup::ComponentInstance classes. @danmacumber said: Is there any documentation for the Dynamic Components extension? Not at this time. @danmacumber said: I only seem to get these issues if I change the active path multiple elements at time. ... I get similar results if I switch between other levels of the hierarchy in odd ways. I wonder if the implementation of local_transformation() depends on the active path observer? I do "believe" it does. I think it does similar to what you described. It (the "DCX") saves transforms into hashes (using the object reference as the key.) I think they are global collection objects named $local_edit_transforms and $global_edit_transforms. So you could write some watcher code into your tests that watch those collections. (Just do not write code that changes them or the DCs could stop working.) @danmacumber said: In our plug-in, we only ever have two levels of nested groups and all groups are unique instances. So I guess this should work for us? As long as the SketchUp team doesn't remove the method? This would require that your users have the DC extension loaded, or your extension might have to require the dc loader script explicitly.
  • Problems with SketchUp 8 plugins in Sketchup 2015

    12
    0 Votes
    12 Posts
    643 Views
    Dan RathbunD
    @tig said: So your code ABSBMP::MoMo::class_variables returns an Array of Symbols >>> [:@@a, :@@b,...] So you need the step varstr = varstr.to_s to make it into a String. :@@a >>> "@@a" Then you use attstr = varstr.gsub(/^[@][@]/, "") to strip off the initial '@@'... Many of the global query methods changed from Ruby 1.8 to Ruby 2.0. They now return arrays of symbols (for each variable or method name.) In Ruby 1.8 they returned array of string (for each variable or method name.) There are also many other "breaking changes" in Ruby 2.0 that need to be dealt with. (@TIG, Was there a post here on breaking changes?) Also garbage collection is much better under Ruby 2.0, so any menu reference will most likely only be valid during the evaluation of the file in which the reference is first made by an API call. So the attempt to hold the reference @@menu[:top] across multiple files may no longer work. We have been complaining about the non persistence of UI element references, for years! (Especially menu references.) So the workaround is to save the menu NAME (as a string,) instead of the actual reference to the menu object. @@menu[:top]= "Plugins" ... then whenever you need the object reference, use: topmenu = UI.menu( @@menu[:top] ) or submenu = UI.menu( @@menu[:top] ).add_submenu( "MoMo" )

Advertisement