FredoBend | Powerful new bending tool for SketchUp Download

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Help for Macfriendlying a plugin (Jim's custom toolbar)

    3
    0 Szavazatok
    3 Hozzászólások
    440 Megtekintések
    M
    Thanks! Yeah I know about the different files and such and this one is such a complex branched one, a beautifully programmed one. As for the sketchup API (toolbar, command and menu) I'm not 100% fluent yet, but getting there, already fixed many plugins. The thing is it seems to me that it's a difference in file behavior from the PC to the Mac, as if I understand comments made it behaves properly on the PC (looks in the plugin folder) but doesn't seem to on the Mac. Since Jim wrote it for PC there may be a quirk on Mac for which there is a way around that someone had already encountered. Of course I won't hack without backup and protections and what not, and without understanding the behavior of the original program, but I can only imagine what it does on a PC and see what it does or doesn't on the Mac. In this case the program and the UI work great. OK I know you're right I'll do more homework! Thanks for the links.
  • Module Wrapper for Your Ruby

    7
    0 Szavazatok
    7 Hozzászólások
    915 Megtekintések
    Dan RathbunD
    @martinrinehart said: Your class names are not protected, even though your classes are defined in the module. Absolutely and totally WRONG ! A module namespace protects evrything inside it. It can have it's OWN constant of the same name as another constant in a higher namespace. The same for variables and method names. YOUR module can have a class Matrix, and MINE can have a class Matrix, and they are different. @martinrinehart said: By the way, your "xxx.rb" file provides a namespace wrapper for its variables. Next time you see Matz, ask him why its just for variables. Clarification: Only local_variables NOT instance_variables (@var), class_varaibles (@@avr) or Constants ( MSG, Value etc.) Running unwrapped code corrupts the ObjectSpace, with: Constants will be left behind in Object and become globally available. @vars will be left behind in Object and even when set nil, GC does not clean them up. @@vars will be left behind in Object and even when set nil, GC does not clean them up, AND worse... every class inherits them.
  • Instance @variable vs class @@variable

    19
    0 Szavazatok
    19 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    @martinrinehart said: @unknownuser said: Within the class statement, you can declare methods with their name, without any prefixing. I find Ruby's insistence on self.xxx to define module-level functions is quite a nuisance. On the other hand, if you create a singleton instance of your class, then to manipulate anything you have to instance.xxx() whereas in the module you can call your functions without a prefix. You don't need to prefix methodnames in modules. Use a class << self block wrapper around all the methods inside the module. See my post: [info] Using Ruby Modules
  • Entering components

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @ben.doherty said: I am having lots of trouble with modules though, if I ask the ruby console for Voyeur::FaceMaker::instance_methods it gives me back a list of the methods as I'd expect, but if I say Voyeur::FaceMaker.makeAnalysisFaces it throws a #<NoMethodError.... any idea how to fix that? moved to it's OWN topic thread, so folks can find it easier: See: [info] Using Ruby Modules
  • Defining Length, Width and Thickness

    10
    0 Szavazatok
    10 Hozzászólások
    1k Megtekintések
    D
    To update the changes - right click - Redraw! To sort the attributes as You like just put the alphabets in front: [image: 721C_2010-08-13_210132.jpg]
  • Webconsole NOT in #@$%&amp; Plugins folder

    7
    0 Szavazatok
    7 Hozzászólások
    822 Megtekintések
    Dan RathbunD
    @archtobe said: I use a free image editor called: Paint.Net << Thanks! I used Windows Paint; crude but it does the trick. OH man... Paint.NET puts the MS-Paint to shame. MultiLayers, opens and saves in many more formats. Version 1 was a college programming project, by a group of guys. They did such a good job, (everyone loved it,) that they updated it, released, etc. etc. and it's up around ver 3 now.
  • Dynamic Component Length Parameters ???

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    D
    I also started to play with dynamic components as a way to put some info. But extracting all this information is a big pain - SketchUp's Generate report is a big mess - only inches and a lot of useless data!
  • Checking for users viewport settings?

    8
    0 Szavazatok
    8 Hozzászólások
    570 Megtekintések
    TIGT
    My approach avoids the confusion of vectors, eye, target etc... Just use the API functions to set a plan view and zoom to what you want to see, switching off perspective as needed...
  • Module for Skeletal Animation

    6
    0 Szavazatok
    6 Hozzászólások
    3k Megtekintések
    D
    @xolotl said: Hello SketchUcation Xperts. Has anyone else tried this plugin, and if so, what were the results? ThanX. X (Xolotl) yes, it works, on PC and even the Mac (if your careful), but it's not really a "plugin", but a 'proof of concept' chapter of a very good book on learning how to use ruby for SU. "Automatic Sketchup" have look on amazon I did a some 'Mac' example debugging when Matt was writing it and have been meaning to post a review, it is easy to follow and well worth buying... and a lot of it's downloadable from the books website... If your interest extends to writing your own or testing for others RubyConsolePro is also worth a look, along with Martins book on ruby for sketchup... john
  • Get/Set Image and Group glue_to ?

    3
    0 Szavazatok
    3 Hozzászólások
    444 Megtekintések
    Dan RathbunD
    see new beta post, SKX forum: [code] beta Group/Image parent, glued_to? etc.
  • [Code] layer-color= v1.2

    7
    0 Szavazatok
    7 Hozzászólások
    2k Megtekintések
    TIGT
    Typo corrected in v1.3 in first post...
  • Dialog to Return a Folder

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    TIGT
    Thanks I clobbered together a folder_browser as part of a larger code set using your ideas... as it's subject to a NDA I can't post it here, BUT here are some tips about what I changed/added - in no particular order... I set a @ variable to represent the returned folderpath. The starter is def startfb(dir=nil, input=nil) this is to separate it from another 'start', by running it with arguments I can determine which directory to start the list in [dir] and then what action to take [def to run] with the resulting @folderpath [using input]. So we don't mess with the current working directory we remember it, reset it to dir then process and set it back on closing [inside the calling code NOT the fb itself] I made it a sub-def of a wider class and ensured that @dlg etc were renamed so as not to clash with another @dlg I already had open. I changed the dialog to be a fixed size [also added 'instructions' into the top-bar] - in the js etc I made the list 80% so it never squeezes the buttons off screen. I also swapped the location to the top of the dialog and removed the 'Location:' text as it sees clear what the string is anyway. I changed the 'OK' button size to be bigger value=OK style='width:146px' and added new functions to 'Cancel' and 'New Folder' onclick="cancel()" and onclick="mkdir()"... These in turn 'call' back and close the dialog or open another dialog into which you can type the new folder name... If you add a new folder it is added to the list immediately after the folder-up item, the rest are listed in order - this makes finding that new folder much easier - if you navigate away and back it will now get added to the list in the correct order... The call back is a new sub-def called 'newfolder()' and that opens another simple dialog to get the the new name - it's trapped in my case to ensure it only has _ and alphanumerics in it - newDir.gsub!(/[^_A-Za-z0-9]/,''). It also checks for validity and preexistence and warns appropriately. Dir.mkdir(newDir) @dlgfb.execute_script('clear_list()') self.populatefb(Dir.pwd, newDir) Note how the populate def [renamed to avoid a clash] takes arguments - this is to set the starting directory and IF there's a new-directory to pass it over so that the list can be manipulated to have its name second on the updated list. list << file if File.basename(file) != newDir and scr='appendDiv("../");' @dlgfb.execute_script(scr) scr='appendDiv("'+newDir+'");' if newDir Then the list is appended... @dlgfb.show_modal{} ensures that the dialog stays foremost until you Cancel or OK, I added img{ opacity:0.66; /*Firefox & Chrome*/ filter:alpha(opacity=66); /* IE */ } to the css so that the images are slightly transparent and show the selected item through themselves. I also edited the folder.png and erased the white edge areas so that it was 'transparent'. I also duplicated it as folderup.png and added an 'up' arrow onto it - this img is then added to the listed item IF its text is ../ - i.e. it's the navigate folder-up at the top of the list... if ( txt == '../') d.innerHTML = '<img src="./folderup.png"/> '+txt; else d.innerHTML = '<img src="./folder.png"/> '+txt; Also added tests for js's OK if ( selected_elem == null ) my_alert(); else if ( selected_elem.innerText.trim() == "../" ) my_alert(); else use_this( selected_elem.innerText.trim() ); Where my_alert() opens an error message telling you to select a folder before clicking OK - - the first trap is you haven't selected a folder yet and the second is you've selected the first item 'folder-up' which can't be taken as a folder-path. Also note how this d.ondblclick = function(id) { selected_elem = null folder_select(d.id);return(false); } ensures that if you have double-clicked the folder-up item or another folder, to move the list into there, then there is nothing remembered as the selected_elem - otherwise hitting OK when you were in the next folder level would take the last selected folder [double-clicked >> current-folder] as the desired one which is not what's wanted - but this way my_alert() will tell you to select something in the current list before pressing OK... I also changed the selection color to be less dark [ruby:3dez4ubj]this.style.background = 'gray';[/ruby:3dez4ubj] Hope these bits help...
  • Bug in Vector angle_between

    6
    0 Szavazatok
    6 Hozzászólások
    574 Megtekintések
    Dan RathbunD
    @dan rathbun said: @unknownuser said: Note that the result is correct is the vector length is.. The cutoff appears to be (works at or above): vec.length = 0.03162316231623162**...** inches Actually, I think the cutoff is more like the rounded value, of the square root of Sketchup's internal tolerance (0.001) ie: (0.001)**(1/2.0) >> 0.0316227766016838 [table=bg1 table1:34jvzu3e][thead:34jvzu3e][tr=:34jvzu3e][th=1:34jvzu3e]So the general rule is:[/th:34jvzu3e][/tr:34jvzu3e][/thead:34jvzu3e][tbody:34jvzu3e][tr=bg2:34jvzu3e][td=1,:34jvzu3e]If the product of the lengths of the two vectors, is less than that of Sketchup's internal tolerance (0.001"), the angle returned by angle_between is Math::PI/2 [ (Math::PI/2).radians.round= 90 deg,] instead of Math::PI [ (Math::PI).radians.round**= 180 degrees.]**[/td:34jvzu3e][/tr:34jvzu3e][/tbody:34jvzu3e][/table:34jvzu3e] viz: v1.length = 0.03162278 v2.length = 0.03162278 v1.angle_between(v2) >> 3.14159265358979 v1.angle_between(v2).radians >> 180 %(#000000)[# degrees] @unknownuser said: I would imagine that SU would normalize the vectors first before computing the angle, so that it's independent of the size. AGREED !! At first i could not imagine why the length would have anything to do with it, but then seeing how a square root is involved, they are likely using pythagorean trigonometry. @unknownuser said: And why return PI / 2 and not 0? That's funny also, PI/2 radians is 90 degrees. Perhaps they choose a known 'reference' vector (say the X-axis) and find the angle between it an v1. Then choose another 'reference' vector 90 degrees from the first (the Y-axis), and compute the angle between it and v2. If there's a bug in there (say half of the algorithm craps out,) that may be why you wind up with 90. now your inline fix, in code is: v1.normalize.angle_between(v2.normalize) or v1.normalize.angle_between([array].normalize)
  • Using an observer to delete a screen note

    31
    0 Szavazatok
    31 Hozzászólások
    5k Megtekintések
    P
    Hello, I experimented a little with modules now and I think (hope) I now understand the use of them. Despite all your great help it took me several hours till I found this: @unknownuser said: Like class methods, whenever you define a method in a module, you specify the module name followed by a dot and then the method name. Before that I used the method name without the module name in front and nothing worked... Matthias
  • How to input a time ?

    15
    0 Szavazatok
    15 Hozzászólások
    2k Megtekintések
    P
    @dan rathbun said: @pvbuero said: Where to find the variable with the time ? def get_shadow_time > model = Sketchup.active_model > shadowinfo = model.shadow_info > shadtime = shadowinfo['ShadowTime'] > # shadtime is a Time class object > end > Ruby Time class from the 'Pick-Axe' book. Time class in Ruby Core Docs. I didn't mean in SU. I meant "variable with the time" in the javascript file ... But I think that's to much new stuff at once.
  • WebDialog and utf-8 Problem

    5
    0 Szavazatok
    5 Hozzászólások
    449 Megtekintések
    B
    thanks for your advice, I will try your suggested methods.
  • Posting tables of data in the forum

    11
    0 Szavazatok
    11 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    @thomthom said: No Ruby fun - only PHP... I posted a Ruby Hilited test example(s) at the phpBBStyles forum, ie: Code Test - Ruby EDIT: corrected URL as topic was moved by phpbbstyles moderator. .. in order to see how well the phpBB Syntax Highlighter MOD works/looks. Adds a BBCode 'syntax' which allows you to post programs / scripts in upto 132 languages and have the post Syntax Highlighted using GeSHi.General description: http://www.phpbb.com/customise/db/mod/syntax_highlighter More info (install notes, etc.): http://www.phpbb.com/community/viewtopic.php?t=1697035#p10232505 Extra info: http://www.phpbbstyles.co.uk/info/viewtopic.php?f=6&t=39&p=83 Supported coding Syntaxes: [ emphasis on some by me ] @unknownuser said: Syntax Highlighter - 1.0.8](http://www.phpbbstyles.co.uk/info/viewtopic.php?f)":sk3p0i6l] now supports 138 languages. Supported Syntaxes: abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, cmake, cobol, cpp, cpp-qt, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, gnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml, ocaml-brief, oobas, oracle11, oracle8, pascal, per, perl, php, php-brief, phpbb, pic16, pixelbender, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xhtml, xml, xorg_conf, xpp, z80 Using GeSHi version: 1.0.8.4
  • Export images: how to?

    14
    0 Szavazatok
    14 Hozzászólások
    1k Megtekintések
    Didier BurD
    @thomthom: correct, I need the names for another purpose, along with the associated definition. (su2pov) @Dan: - I didn't even know that an image could have no name... How can this occur (each image has a path (with a file name at the end) image.path=nil occured only one time with an old model and I cannot reproduce this, so I think I made an error whan typing code in the console or something like that... - tw exports at the original format.
  • Find the global position of a Vertex in a Group/Component

    25
    0 Szavazatok
    25 Hozzászólások
    6k Megtekintések
    K
    one small correction to the code posted by Glenn: after calling createVerticesArray on line 14, add the line: trans_h.pop otherwise, if there are multiple sub-components in the entities collection, you will take into account the transformation of any entity that came before. Otherwise, great code, very useful. Thanks! -- Karen
  • Auto add numbers in Ruby?

    12
    0 Szavazatok
    12 Hozzászólások
    813 Megtekintések
    J
    @dan rathbun said: also.. printf "%04d%s\n" % [i, name] is adding an extra operation eval that's not needed. Note to self: % is a method of Strings. Thanks.

Advertisement