sketchucation logo sketchucation
    • Login
    1. Home
    2. fredo6
    3. Posts
    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!
    Check out Febhouse | New extensions for Shadow Analysis in SketchUp Download
    fredo6F Offline
    • Profile
    • Following 0
    • Followers 70
    • Topics 175
    • Posts 5,452
    • Groups 3

    Posts

    Recent Best Controversial
    • Unhide All edges

      Here is the dual of the script posted by Sorgesu (see http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=8568)
      It just unhide all edges of the model or the active group / components if it is opened.
      Menu item is in the Plugin menu

      Of course the same script can be derived to soften, unsoften, etc...


      UnhideAllEdges.rb

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Push/pull to work on 'unopen' groups

      Well! it depends if you want to do it on a plane or a 3D curved surface.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Push/pull to work on 'unopen' groups

      @a4chitect said:

      btw: why did you decide to have JPP work only on selected faces and not the way original PP tool works - first activate the tool and then confirm the on-mouse-over face by clicking on it?

      It's true that it would be more natural. I may actually do it in a next version.
      And this is what I am doing for the Offset on Surface script.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Push/pull to work on 'unopen' groups

      It is indirectly possible with the JPP script.

      In fact, because it would always be difficult to agree on what to do with a group or a component, what I did is to publish an API for the 3 kinds of JointPushPull where you specify the faces you want to act upon. It is documented in the tutorial.

      
      def JointPushPull.Api_call (type="J", selection=nil, distance=0, vector=nil, 
                                  finishing='K', borders='A', group=true, influence=true,
                                  angle=30.0)
      
      

      So all you need to do is to write a surrounding script that select the groups and the faces within the groups and then execute the JPP API.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Problem with input box displaying values

      For those interested in Windows-style dialog boxes (i.e. not Web dialogs), I had written a library Libtraductor.rbthat supports also language translation in dialog boxes and ease the checking of parameters (min, max, string patterns, ...). It also preserves defaults and previous values.

      I use it in Bezierspline and in JointPushPull (and actually in other unpublished scripts).

      Attached is the script, as well as a tutorial for programmers in English.

      Here is a snippet of the interface

      
      dlg = Traductor;;DialogBox.new title
      
      #Declaring fields, either string, numeric or unit-based numeric, or enumeration list;
      dlg.field_string symbol, label, default, validation_pattern
      dlg.field_numeric symbol, label, default, value_min, value_max
      dlg.field_enum symbol, label, default, enum_hash
      
      #Showing the dialog box;
      Hash_results = dlg.show hash_initial_values
      
      

      to drop in Skecthup Plugins folder


      Tutorial for Ruby script programmers

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Queston for Fred06 concerning BezierSpline tools

      This is possible, but remember that there is always an issue with the last segment, which cannot be made equal to the others mathematically, unless you changed the End point.

      Also, if your original curve is a Bezier or Spline curve, there are other ways to 'simplify' the curve, by playing with their Precision parameter.

      Attached is a small script BZ__Segmentor.rb, which draws a polyline with a given number of segments. Just drop if in the BZ_DIR folder. I do not provide an icon for it, but the menus should be fine.


      to drop in BZ_DIR folder

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Select all geometry

      @laxmarsk said:

      I am working on a little script that is moving groups or components based on offset values read from a txt file and saving the files again at the new location.

      Script is working but now I want to get things done without having to manually "select all".

      What I meant is that you do not need to select entities to perform your 'move' operations. Sketchup.active_model.active_entitiescontains all the entities of the model, and you can then apply your transformation to this list.

      For instance, if you want to move all objects of the model by an offset offset_vector (which you'll read from a file), then all you have to write is

      
      all_entities = Sketchup.active_model.active_entities   #all entities of the models
      t = Geom;;Transformation.translation offset_vector
      all_entities.transform_entities t, all_entities
      
      

      Now, if your problem is about the selection, Todd's and Didier's code will make it as a Select All.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Select all geometry

      I guess you need to perform your loop exploration of entities on

      Sketchup.model.active_entities
      

      instead of

      Sketchup.model.selection
      

      This will be thus independent from the selection

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Unicode, UTF8 and Ruby

      @didier bur said:

      Bonjour Fredo,
      Le problème ne vient pas d'un fichier. J'ai des noms de matériaux à récupérer dans un modèle SketchUp, pour les re-exporter vers une feuille Excel. Quand tu récupère le nom d'un matériau pour une face f, f.material renvoie par exemple une chaîne s "béton". Quand tu écris cette chaîne dans le fichier Excel, par exemple fichier.puts(s) tu n'obtiens pas "béton", mais "béton", parce que les caractères accentués sont codés sur 2 octets au lieu d'un. Et Ruby n'a pas de méthode pour convertir de l'UTF8 en Unicode.

      Then, with the explanation from Todd, I understand why I had problem with the dialog boxes, as Windows does support UTF8.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Unicode, UTF8 and Ruby

      @didier bur said:

      Hi all,
      When I try to retrieve the name of a material (material.display_name) in a script, I have to translate it first with a LanguageHandler object and the materials.strings local file.
      This returns a string, from the prepared $mat_strings I have built with LanguageHandler.
      Of course sometimes french materials names have special characters in them: béton, plâtre, etc.
      When the script sends such strings to an output file, these characters are NOT converted, for instance the string "Matière 1" is output as "Matière 1".

      Didier,

      I am unclear of where are the French strings coming from in your exemple. Is it from a file? or from a constant definition?

      As Gaieus mentioned, in Ruby, it is careful to put a backslashbefore any character which is not straight ASCII, like many accentuated characters.
      So, to define a constant:
      Text = "b\éton"
      and not
      Text = "béton"
      Otherwise you may get an error when loading the script (but not always)

      This also works from and to the Ruby Console
      Now, I don't know what happens when reading and writing from files, as I never tried.
      Could you attach your files so that I try

      Thanks

      Fredo

      PS: The only things I noticed concerns the dialog boxes, where you have a different encoding and decoding of the accentuated characters, which makes the == comparison fail. This seems to be due to the fact that Sketchup uses Windows SDK dialog boxes, which have a different encoding method.

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      Coen

      If you scale uniformly a surface, it will never match the original (think of a sphere for instance). However, this is somehow an approximate way to offset its contour, while preserving the overall shape of the surface.

      With the first method (only offset the borders), you just use the shape of the outer borders and ignore the ones which are inside. So if you offset by a large distance, you will certainly 'dilute' the shape of the surface.

      Both methods have their own benefits and drawbacks, and both can be implemented via a script.

      That's what I meant.

      Fredo

      posted in Plugins
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      Oops...!!
      Updated with correct code in Ruby repository

      Fredo

      posted in Plugins
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      Urgen,

      Very good idea and quite natural in Sketchup.
      I updated the files in the script repository (also with non blurry icons).
      http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=6708&p=42783#p42783

      Thanks

      Fredo

      posted in Plugins
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      @jclements said:

      "The editor makes full usage of the Sketchup inference mechanism so that you can
      visually adjust the distance by reference to a particular point in your model, as in most
      Sketchup tools. However, when you drag, you may want to skip some inferences. For
      this, just keep the SHIFT key pressed down, while dragging faces."

      For me, keeping the SHIFT key depressed doesn't appear to do anything. The black triangle at the cursor seems to be inferencing to other geometry. Perhaps I am misinterpreting its usage?

      The black triangle will seem to 'block' on other geometry, but it position will be ignored when you drag the faces. So inference is skipped 'geometrically', but I did not find a way to skip it 'visually'. Hope this answers your question.

      posted in Plugins
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      On offset tool for curved surfaces:

      I am not totally clear on what several of you are targeting. Personally, I see 2 categories of such surface offset tool:

      1. Only offsets the external border edges of the surface. This means for instance that all interior faces are left untouched. This does not exist in native Sketchup but can easily be done by a script. Actually the faces are just there to give the overall contour the planes for offsetting and the direction interior / exterior.
        First method - Offset only the border contour

      2. Deform continuously all faces of the model to accommodate the offset of the contour. In such a case, I think it would always change (even slightly) the shape of the overall surface. The best is probably to Scale the surface in all directions, and then move it to the closest position to fit the original surface. This can also easily be automated by a script.
        Second method - Scale up the whole surface and try to fit to the original surface

      Maybe I lack imagination and there are other forms of surface offset someone would think of!?

      posted in Plugins
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      @unknownuser said:

      that's great.. i like the feel much better than the first one.. it's faster and more intuitive for me..

      a couple of the tool bar icons are showing up blurry.. any idea why?

      I guess you are on Mac.
      No idea of what happens with the PNG files, especially because only 2 of them appears in the 'fog'. They all come from the same source (thanks to Daniel S. who designed them). One idea, make sure you got all 5 icons of the latest version (they are all 24 x 24). The two I designed and published in the initial version were 32x32.

      posted in Plugins
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      @unknownuser said:

      Is it possible for this script to explode the curve after it is run? Or at least segment it into parts. It would cut down on a step if you are trying to erase lines for a cleaner face. See image.

      I put precisely some code to keep curves on the original surface (to be as less destructive as possible). Note however that the generated corresponding contour is not welded as a curve. Is it the situation you have?

      posted in Plugins
      fredo6F
      fredo6
    • RE: Creating a material from an existing one

      @jim said:

      I agree about needing to read or write on the disk in order to accomplish this; however... if you are going to be reading and writing files, why not copy the .skm, load it, and make the adjustments? Either way, it looks as if the best you are going to do is a clunky work-around.

      Well, this is to create programmatically a semi-transparent material from an existing material. This is the only way to build a macro that would show part of the model in Xray (as the View mode of Sketchup applies to the whole model). At the moment, I can do it with color of material, but cannot get the textures to be Xray'ed.

      See discussion thread in the forum at http://www.sketchucation.com/forums/scf/viewtopic.php?f=57&t=6638
      and also in the French section (http://www.sketchucation.com/forums/scf/viewtopic.php?f=51&t=6589&start=0)


      model from Claire

      posted in Developers' Forum
      fredo6F
      fredo6
    • RE: Joint Push Pull Classic (Old version) - v2.2a - 26 Apr 17

      @daniel s said:

      Totally Amazing!!
      How can i set for default for Joint, Vector and Normal Push pull in the finishing options "thickening" instead "erase original faces"?? it´s easy with the TAB or F5 keys... but when i restart SketchUp i have to set my defaults again.

      Edit the rb file, line 334, and change @option_finishing = 'D' to @option_finishing = 'K'

      @daniel s said:

      PS. It´s possible to make the plugin work like the SketchUp push/pull? I mean... now you must select at least one face before running the plugin... and after doing the PP you have to select the icon again to PP another face....

      This would only work in single-face push pull (but there would be no difference compared to the Sketchup tool). Because you need to be multi-face, you have to select the faces first. Remember that 2 successive JPP may not be equivalent to a single one on the total set of faces!

      posted in Plugins
      fredo6F
      fredo6
    • RE: Creating a material from an existing one

      @al hart said:

      Did you call tw.write(entity, fname)

      No. My intention is not to export material or even get the JPG file for the texture, but just clone a material within the model, and then change parameters of this new material.

      posted in Developers' Forum
      fredo6F
      fredo6
    • 1 / 1