sketchucation logo sketchucation
    • Login
    1. Home
    2. Frankn
    3. Topics
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.8b introduces important bugfixes for Fredo's Extensions Update
    F
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 27
    • Posts 105
    • Groups 1

    Topics

    • F

      Help needed with Sketchup.exe -RubyStartup

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      76 Views
      F
      Let me try and explain what I'm trying to do because I have a few things I'd like to accomplish... this being what I think should be the first step. Though I tend to change/modify my ideas as I work on them. Basically I have a cabinet plugin I'm working on and one thing I'd like to do is add nesting/cut sheet/layout functionality... so basically... identify all the top faces of the panels (I can do this). make a copy of the faces before adding them to an array... still need to figure this out. launch a new instance of SketchUp and adding the faces from the array I copied... I was thinking of making a ruby script to do this and then launch/open a plugin to manage the nesting options. I got the idea after finding this... https://community.sketchucation.com/topic/139502/sketchup-command-line-switches Hopefully that's not to confusing and makes some sense.
    • F

      Get coordinates of nested components

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      556 Views
      Dan RathbunD
      @fredo6 said: For instance, if you pick interactively the nested component, the PickHelper will give you the chain of grouponents. Expanding upon this use of the PickHelper class ... This is using the Sketchup::PickHelper#path_at() method. It returns the instance path from the active entities context (for the given index in the list of pick paths.) To get the full path, you will need to add the pick path to the model's active edit path (if it is not nil.) edit_path = model.active_path ? model.active_path ; [] full_path = edit_path + pick_path Then, you can use a little known method in the InstancePath class to get the transformation ... ipath = Sketchup;;InstancePath.new(full_path) trans = ipath.transformation See: Sketchup::InstancePath#transformation
    • F

      How to replicate change axes

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      3k Views
      No one has replied
    • F

      Best practices for creating an rbe

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      7k Views
      F
      Where can I find info and/or examples on how to set this part of the loader file? I'm searching but not finding anything... require "Author_MultiClassPlugin/MultiClassPlugin_SharedConstants.rb" include SharedConstants # mixin the constant module And this from the SharedConstants file? SOME_SEARCH_PATTERN ||= /^Author/ Thanks
    • F

      Win32API is deprecated after Ruby 1.9.1

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      9k Views
      Dan RathbunD
      This is not an error. It is a warning. Prior to Ruby 2.x, Win32API was a compiled .so file. Then they (the Ruby Core project) deprecated it and began (with Ruby 2.0 in SketchUp 2014 thru 2016) distributing Ruby with a " Win32API.rb" wrapper file that defined wrapper calls using the DL standard library. But later on (by Ruby 2.2.4 with SketchUp 2017 and higher,) even the DL standard library was deprecated, and the " Win32API.rb" wrapper file was rewritten to change the DL library calls into Fiddle library calls. So even now with Ruby on the latest SketchUp, we would still expect old Win32API method calls to be translated correctly into Fiddle library calls. The warning cannot be suppressed as it is stated at the top of the " Win32API.rb" wrapper file without condition. You will see it output to the console by the first extension that calls a require "Win32API". Okay, but there is always a chance things could have been broken as changes to the Fiddle library might change with Ruby version changes. The latest SketchUp 2021 is now up to Ruby version 2.7.2. SketchUp 2020 was using Ruby version 2.5.5. Did you see differences between loading under these 2 Ruby versions ? I would suggest using a Ruby Console opener like Eneroth's to see what other errors are output to the console. It is best when troubleshooting to switch off the extension so it does not load at startup, and then manually load it with the console open to see any other errors.
    • F

      Moving a curved face/surface

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      5k Views
      F
      Found this post which helped me find the solution... https://forums.sketchup.com/t/transform-a-model-vertex-by-vertex/38771/7 Here's the code I'm using with some notes... if something can be improved or changed please let me know? I can also add the code to iterate the faces if needed? Basically you need the vertices of all the faces you want to move and each vertex needs a cooresponding vector to be moved to. That way you can pass the 2 arrays to transform_by_vectors(vertices, vectors) . Andif you're using sub components like I am, make sure you're in the correct entities context (not sure I'm using all the proper terminology here) oe else you get a mess as a result. Like Tig explained in the post I shared... @unknownuser said: ... if every vector has a separate vector-transformation you need to pass two full arrays - in one go! vectors=[] //array of position to move vertices vertices=[] //array of face vertices from the individual faces that make up the surface vertices.flatten! //in my case I need to flatten the array vertices.uniq! //make sure there are no duplicate vertex vertices.each{|vector| position=vector.position.clone position.x +=distance vectors.push vector.position.vector_to(position) } component_entity.transform_by_vectors(vertices, vectors) Hopefully this helps others out because it wasn't easy to find or understand... but it works!
    • F

      Undoing all transformations

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      4k Views
      F
      Thanks for all that info fredo... It'll certainly come in handy
    • F

      Ruby not returning correct dimensions

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      1k Views
      TIGT
      You have found your own solution.
    • F

      Move component diagonally and rotate

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      2
      0 Votes
      2 Posts
      426 Views
      S
      If you are using the Ruby API, Geom::Transformation.translation followed by Geom::Transformation.rotation.
    • F

      Working with millimeters

      Watching Ignoring Scheduled Pinned Locked Moved Woodworking
      4
      0 Votes
      4 Posts
      1k Views
      G
      I work with millimeters and imperial and I don't round. When I work in imperial I would cut a 4" nailer When I work in metric it would be a 100mm nailer I will check the thickness of panels and adjust them to 1 decimal in mm. I keep imperial and metric standards.
    • F

      Getting angle relative to component

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      275 Views
      No one has replied
    • F

      Retrieving bounding box corners Point3d

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      525 Views
      F
      @thomthom said: The BoundingBox object you get when you query the instance will always be oriented to world space. To get the bounding box as drawn in the UI you need to get the bounds of the definition - fetch all the points from its corners and transform them using the current edit_transform and the selected instance transform. That extension I linked to does all that. Ah! Thanks for the explaination ThomThom! I didn't realise that's what happened with instances' bounding boxes...very confusing for a novice! I did take the time to check out your extension and was able to understand what you're doing and apply that to my own code... thanks again sir!
    • F

      Escaping out of editing a component

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      404 Views
      tt_suT
      Note that if only close the currently open instance. If you are deeply nested you need to loop until you are back in the root - (if that's what you desire). And before SU2014 the method was bugged and could mess up geometry if the close was undone. (The method actually creates an undo item)
    • F

      Iterate selection

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      377 Views
      F
      Thanks Anton_s! Even though I'm still trying to figure out what and how your code works it does work perfectly!
    • F

      Sketchup2014 - undefined method `GetString'

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      3k Views
      Dan RathbunD
      @frankn said: As far as using .GetString or [], does .GetString still work in 2014 so that it's compatible with older versions of Sketchup? Yes the renamed the getter method [], then aliased it as GetString.
    • F

      Using each_slice possible?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      1k Views
      Dan RathbunD
      You get a NoMethodError because Enumerable does not have that method defined in Ruby 1.8.x. This should do the same, except you pass the array in as the 1st argument: def slicer(ary,num) a2 = ary.dup len = num.to_i.abs until (s = a2.slice!(0,len)).empty? if block_given? yield(s) else puts(s.inspect) end end # until end # slicer() See another example that will collect the slices into an output array, IF a block is NOT given. (Sort of like the opposite to flatten().) If a block is given, it returns an array of the block's return values. Prints to $stdout only if $VERBOSE == true. Fixed absolute call. It is not a Math module function. It is a standard Ruby Numeric instance method.
    • F

      Pushpull/move a component instance's face

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      603 Views
      F
      @unknownuser said: ](http://www.sketchup.com/intl/en/developer/docs/ourdoc/face#reverse!) I had seen that but I never tried it thinking it was like the Skethup function 'reverse faces' which turns the face from purple to white. No I guess not... that will change the faces for ALL instances. (Remember that it is the Definition that owns the component entities, not the instances. ALL instances share the same entities collection from their parent definition.) Actually that works in my situation because I make all my instances unique... but I'm just starting to play around with this and might run into problems later. edit: just took a closer look at my model and yes it does turn the face from white to purple doing exactly like the Sketchup function. So yes it works but not the ideal solution.
    • F

      Retrieving parent definition

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      2k Views
      F
      @chris fullmer said: Frankn, just to clarify for myself, but you really want only components that have sub-components in them? or is it that you want a list of definitions whose instances are NOT sub-components? Hey Chris, I wanted to be able to find the parent definition of components with subcomponets that aren't in the model but still in the definition list. Hope that makes sense... but if it doesn't, basically the 2nd code that Tig shared is what I wanted to accomplish.
    • F

      Hightlight/select component with mouse over

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      901 Views
      F
      WOW! Thanks sdmitch!! That's way over my pay grade, Damn! I tested it and it works great, though I must admit I'll have to study the code a lot to figure out how you did it and even then I'm not sure I'll get it.
    • F

      Scaling a component with subcomponents

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      418 Views
      F
      Hey Fredo6, I actually mentionned you plugin in my other post and how I was trying to figure out how you did it. Only problem is you're a ruby/sketchup god and I'm more of a peasant. Thanks to Chris, I now know that what I'm trying to accomplish is called parametric modeling, learn something new everyday . So I did a search for that and came up with this file parametric.rb (attached) and a couple of interesting websites, though I haven't had a chance to go through them so I apologize if they aren't that good. http://drivingdimensions.com/SketchUp/FAQ/ http://www.sketchup.com/intl/en/download/rubyscripts.html [EDIT: attachment removed by admin]
    • 1 / 1