⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • JSLint - what's important, what's not?

    9
    0 Votes
    9 Posts
    2k Views
    chrisglasierC
    @chrisglasier said: @ TBD ... will post any interesting (to me!) outcome. @unknownuser said: Error: Problem at line 116 character 5: Bad line breaking before ','. } Problem at line 161 character 65: Be careful when making functions within a loop. Consider putting the function in a closure. o.onmousedown = function() { coreDown(this , c , dv ); }; Problem at line 297 character 18: 'noldDown' was used before it was defined. function noldDown(params){ //params = cell , sliderName , sliderNo , cnt... Problem at line 389 character 18: 'moldDown' was used before it was defined. function moldDown(params){ Implied global: ActiveXObject 16,34, window 43,44 Well not perfect but I think acceptable (please correct me if I am wrong).
  • Changing Dashed Lines

    6
    0 Votes
    6 Posts
    680 Views
    TIGT
    @dave wood said: Thanks, again, TIG, I opened the 2D toolbar and couldn't get the help file from there, either. I can open the .htm file directly in the 2D Tools subdirectory. I get a message that the internet explorer can't display webpage. Windows can't diagnose the problem. What is the web browser? Good question, keep in mind you're working with a relative novice.-- The top of the window says SketchUcation Community Forums.- Internet Explorer provided by Dell. Below I've got a couple of Google search "panels" and a microsoft bing search "panel". I didn't have time to look into the commands, but a read some of the instructions. You started to lose me a little with some the info re: how the lines reside on edges, faces, etc. and how the width of the line is affected. I imagine it might be overly difficult to add some illustrations. See, you give the people all this, and all they do is ask for more! Thanks again very much. I'm looking forward to using some of these tools. Are you a Vista 'Administartor' ? The Help htm works in IE and FireFox for me... Strange ? It's easiest to try the tools out in a scrap Model - learn by doing...
  • MSDOS in Ruby Console

    14
    0 Votes
    14 Posts
    1k Views
    Dan RathbunD
    @martinrinehart said: @dan rathbun said: What's wrong with the standard included classes File and Dir ?? You can do all that would be desired with their methods. That's all I've done: def cd( path ) Dir::chdir( path ) end Shell Commands are already allowed within Ruby. [Examples for PC win32 platform, but also applies to Mac OSX.] use the %x delimiter, as in: %x{dir *.skp} or backquoted strings, as in: dir *.skp (from: Programming Ruby - The Pragmatic Programmer's Guide) The Ruby Language > Expressions > Single Terms Shell Command. A shell command is a string enclosed in backquotes, or in a general delimited string (page 200) starting with %x. The value of the string is the standard output of running the command represented by the string under the host operating system's standard shell. The execution also sets the $? variable with the command's exit status. [Example - '.c' changed to '.skp';'ls' changed to 'dir'.] %(#BF0000)[filter = "*.skp" files = dir #{filter} files = %x{dir #{filter}}] ! Backquoted strings allow replacement like doublequoted strings ! Expressions > Miscellaneous Expressions**http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html** Command Expansion If you enclose a string in backquotes, or use the delimited form prefixed by %x, it will (by default) be executed as a command by your underlying operating system. The value of the expression is the standard output of that command. ! The output is a String, so any String method can be applied to the expression: Ex: dir.include?('.jpg') returns true if there are any jpeg files in the dir _
  • Help with Components

    30
    0 Votes
    30 Posts
    4k Views
    honoluludesktopH
    Yes, "comp_entities" is the exploded array. OK, so when I see is_a? in this manner, the do loop is "select(ing) the entity(s)" in the array that is a (are) %(#FF0000)Sketchup::Drawingelement. Is it faster (better) then: comp_entities.each do |e| if e.is_a? Sketchup;;Drawingelement comp_new.push e end end Addenda: Corrected as noted below.
  • Extrude edges by Normals?

    20
    0 Votes
    20 Posts
    1k Views
    EarthMoverE
    Thanks Fredo. It's working now!!!
  • Problem with script

    9
    0 Votes
    9 Posts
    540 Views
    P
    @unknownuser said: But can't this already be done in SU with the Generate Report function? The problem with the inbuilt report generator is the same as the script referred to above. It is not very flexible, even if you take the option to report on selected components ony, it still includes all the attributes of all the components, and it reports in imperial measurements even if the model is in metric. What I would prefer is a report which is more selective such as the example I detailed above. The problem I am having is finding someone who could modify the above script.
  • (Required) Point inference On Edge when Using rotate tool

    9
    0 Votes
    9 Posts
    2k Views
    TIGT
    Daniel I agree that a configuration as you provided won't inference snap though similar ones will ! There is a way to find the true intersection of the edge and the arc that would sweep through the rotated end hole's center itself centered on the middle hole... Use my Tangent Tools script. Draw a cline through the desired edge and two concentric arcs [same radius] centered on the middle hole passing through the end hole to be rotated. Select the cline and both arcs. Those arcs will be too segmented to give an accurate intersection with the cline BUT the Tangent Tool > True Intersections will place cpoints at the two possible intersections on the cline and two additional cline guides from the arcs' center to these cpoints. It will also beep and report an error in the Ruby Console since the arcs are concentric and can't intersect with themselves... It's probably best to place the cline and two arcs into group of their own for easy erasure later... Simply use one of the cpoints to rotate the shapes about its central hole's center and snap to... This is convoluted BUT does give an accurate snap cpoint on the edge.[image: NGvj_inferenceonrotate.png]inferenceonrotate.skp
  • WxWindows for SketchUp Dialogs

    45
    0 Votes
    45 Posts
    8k Views
    T
    @dan rathbun said: That is because in module definitions, the module statement is a block statement so the word module works the same as begin (after all, the module does need an end.) Thanks for the explanation.
  • Json name value pairs

    19
    0 Votes
    19 Posts
    1k Views
    J
    Right - eval gets passed String objects. So before the eval is called, json is a variable which references a String. After the eval, the variable foo refers to a Javascript Object. However, @unknownuser said: To convert a JSON text into an object, you can use the eval() function. eval() invokes the JavaScript compiler. Since JSON is a proper subset of JavaScript, the compiler will correctly parse the text and produce an object structure. The text must be wrapped in parens to avoid tripping on an ambiguity in JavaScript's syntax. var myObject = eval('(' + myJSONtext + ')'); and @unknownuser said: ..If the server is not rigorous in its JSON encoding, or if it does not scrupulously validate all of its inputs, then it could deliver invalid JSON text that could be carrying dangerous script. The eval function would execute the script, unleashing its malice. To defend against this, a JSON parser should be used. A JSON parser will recognize only JSON text, rejecting all scripts. In browsers that provide native JSON support, JSON parsers are also much faster than eval. It is expected that native JSON support will be included in the next ECMAScript standard. var myObject = JSON.parse(myJSONtext, reviver); I believe Chris is using json2.js on my recommendation, which is based on DC's recommendation because it is possible CG's data could come from an outside source. And I would also repeat what TBD said and watch the "Good Stuff" video - at least you will know what to avoid in Javascript to make your life easier.
  • Tooltips?

    3
    0 Votes
    3 Posts
    369 Views
    J
    Did I help, or just confuse you?
  • Missing ruby in su7

    5
    0 Votes
    5 Posts
    332 Views
    G
    Thank you, That did the trick…..hadn’t even crossed my mind. I figured it was something painfully obvious that I was missing. Thanks again, Glenn
  • Where's My Inference Dots?

    7
    0 Votes
    7 Posts
    891 Views
    thomthomT
    @chris fullmer said: I could be way off, but I was thinking it was an optimization thing. I think they are just checking to see if the inputpoint changed, and only if it changes do they refire the draw method. Chris But as the manual says: @unknownuser said: true if a valid InputPoint was picked and it is different than it was before. From that, it sounds like the InputPoint object is performing the check for you. It returns true only if it's different from the last time you called pick.] (Note: I haven't tested that the implementation actually works as the manual says it should. We have enough examples of deviance... )
  • SketchUp to ASE

    7
    0 Votes
    7 Posts
    753 Views
    thomthomT
    @martinrinehart said: I've found materials to be so dangerous that I no longer let them near Ruby. face.material = '[Wood_Cherry_Original]' Problem: the face looks like cherry, but model.materials has no cherry. Bug Splat coming soon. face.material = model.materials['[Wood_Cherry_Original]'] If there is no material '[Wood_Cherry_Original]' then model.materials['[Wood_Cherry_Original]'] will return nil, which indirectly means Default Material. I've not experienced any problems with materials using this method.
  • Ruby beginner

    2
    0 Votes
    2 Posts
    351 Views
    M
    Start here: http://www.MartinRinehart.com/models/tutorial/tutorial_11.html You'll need chapter 15, too, which I'm working on at the moment. 11 through 14 cover a lot of ground. Good luck. Pick a simpler project for your starting go.
  • Fredoscale

    3
    0 Votes
    3 Posts
    460 Views
    R
    cool feature, thanks a lot
  • Fredo related plugins

    8
    0 Votes
    8 Posts
    598 Views
    R
    thanks a lot
  • How to save a model SU 7 (cp1251)

    11
    0 Votes
    11 Posts
    783 Views
    TIGT
    Within a Tool's class have this def getExtents bbox=Sketchup.active_model.bounds bbox.add(@ip.position) if @ip and @ip.valid? bbox.add(@ip1.position)if @ip1 and @ip1.valid? bbox.add(@ip2.position)if @ip2 and @ip2.valid? bbox.add(@ip3.position)if @ip3 and @ip3.valid? ### etc return bbox end where the various @ip's are input points that are called from mouse moves etc, as you move/pick with the tool... The tool auto-runs getExtents() so you don't do anything else ? Works for me in my tools
  • HTML export with hotspots?

    2
    0 Votes
    2 Posts
    948 Views
    M
    Hello Fredrick, Check out Chris Fullmers Camera Recorder - http://forums.sketchucation.com/viewtopic.php?f=323&t=23517 Its quite close to what you asking. might require some leg work but should get the job done. I also have been working on a Museum plugin for a while, hope to find time to finish it already. Myne is definitely not what you are looking for but might be useful for a project like yours - check back in some time. Great initiative you have taken on this project Cheers
  • Context Menu Trimming ...

    4
    0 Votes
    4 Posts
    294 Views
    H
    ... thanks guys
  • I need a script

    4
    0 Votes
    4 Posts
    334 Views
    TIGT
    Without reworking it to draw just four edges rather than make a face_with_its_four_edges, you can recast it to make the face and then erase it immediately - its four edges should get left behind... lines 107 et al... def create_rectangle # check for zero height if( @pts[0] != @pts[3] ) face=Sketchup.active_model.active_entities.add_face @pts face.erase! if face.valid? ### edges will remain... end self.reset end EDIT: CF beat me to it !

Advertisement