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
  • Face or line or vertex inside a solid

    4
    0 Szavazatok
    4 Hozzászólások
    242 Megtekintések
    voljankoV
    Hello Tig, I have also thought about rays. What do you think about this solution: If the tested object and a solid are not intersecting. If a ray from a tested object hits faces of a solid odd number of times ,the tested object is inside the solid. If the ray hits an edge or a vertex,repeat the ray test in other direction. David
  • What? No Menu?

    15
    0 Szavazatok
    15 Hozzászólások
    956 Megtekintések
    snicoloS
    @cjthompson said: That's because the code is executed all during one frame, which also explains why the one-liner works. My guess is that Sketchup creates a new menu , adds the items, and does the validation each frame, instead of just using one menu. This is exactly right. It depends on the context available when commands are executed. Another way to specify multi-line commands in Ruby is to use '' You could do: x = UI.menu('Plugins') \ x.add_item('Hello') { puts "World" } \ x.add_item('Hello2') { puts "World2" } and it would work and be all executed as a single command.
  • Create new layer with an RGB colour

    5
    0 Szavazatok
    5 Hozzászólások
    366 Megtekintések
    Dan RathbunD
    If you are starting with a fresh new model.. ie, Sketchup.active_model.modified? == false && Sketchup.active_model.title.empty? == true && Sketchup.active_model.path.empty? == true .. then you could open a new file from a template, that had the layers already set up. Otherwise... ... you can create a component definition, that has nothing but cpoints on your preset layers (names and colors and visibility,) and then save the component to your local component library. Then anytime you wish to use those layers, either manually open the component library and click on that component (you do not actually need to insert it into the model.) Here's a little SKP that has EIA colors assigned to Layer1 thru Layer9. (These are the colors you see on resistors or capacitors, that indicate their value. Sometimes also used by rainbow ribbon cables, to indicate pin number.) EIA_Color_Layers.skp Or.. via Ruby, you can load that component (say from a plugin sub-folder.) module Author module CustomLayers class << self def add_landscape_layers() plugs = Sketchup.find_support_file("Plugins") path = File.join(plugs,"Author/CustomLayers/LandscapeLayers.skp") mdl = Sketchup.active_model() defnset = mdl.definitions() landscape_layers_defn = defnset.load( path ) trans = Geom;;Transformation.new() # default identity transform inst = mdl.entities.add_instance(landscape_layers_defn,trans) inst.erase! end # def add_landscape_layers() end # proxy class end # submodule end # Author's toplevel module One drawback is that the color for the default layer ("Layer0",) must be set in the template files.
  • Length conversion problems

    3
    0 Szavazatok
    3 Hozzászólások
    207 Megtekintések
    T
    Thanks very much, TIG
  • Observers work differently depending on how Sketchup starts?

    9
    0 Szavazatok
    9 Hozzászólások
    2k Megtekintések
    P
    @dan rathbun said: The API docs say this won't work... because the file is already open (on PC,) by the time the AppObserver gets loaded. Dan, In my script: When double-click on SU file opening the model in SU execute PRODUCE.sceneobserver (automatically) A Appobserver is also created (which fires PRODUCE.sceneobserver again, but since there already is an observer there is no new one created) When a model is then opened from the file menu the Appobserver is called Logically and after testing this seems to work ok. My code here is not complete though, since in my code there is another check to see if the framobserver must be created or not (depending if the opened model has some specific settings)
  • Model.raytest broken in SU8!

    58
    0 Szavazatok
    58 Hozzászólások
    7k Megtekintések
    thomthomT
    hmm - would be nice with a C++ Hello world of a Ruby Extension.
  • Boolean: how do I 'outershell' multiple groups/components?

    12
    0 Szavazatok
    12 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @liquid98 said: good guess! that's the plan indeed. I did not guess ... I can read your mind (scary music: [Oooo ooOOooo ooooo]) No actually, I read your sample code in the post of 17 MAR ... the first two lines you are opening a skp file, within the code. In that post, you wrote: @liquid98 said: But the script I'm writing is for internal use. Is this to be used within a commercial setting (for commercial work.) ??
  • Create Texture via Ruby or/and win32-api

    3
    0 Szavazatok
    3 Hozzászólások
    349 Megtekintések
    A
    @dan rathbun said: FYI... SketchUp uses PaintLib internally. It's openSource... see: http://www.paintlib.de/paintlib/ and the source here: http://sourceforge.net/projects/paintlib/ Thanks, converting textures to the other formats, sounds good. Is there is a reference on how to create a bmp(a simple file mode) file, set the width/height of the image and set the color of the each pixel?
  • New URL for SketchUp's API documentation

    21
    0 Szavazatok
    21 Hozzászólások
    5k Megtekintések
    P
    For me it's simple: For registered users give the opportunity to comment on incorrect information/give more explanation and give possibility to add code examples. I always like the way PHP does it: http://php.net/manual/en/function.include.php If you give us the tools, we help you with the content...
  • Rubber Duck Debugging

    2
    0 Szavazatok
    2 Hozzászólások
    367 Megtekintések
    P
    'explains code to an inanimate object' I'd prefer this: [image: beer.jpg] Downside is that after a while you'll need to debug what you are saying
  • Material names changed by SketchUp

    4
    0 Szavazatok
    4 Hozzászólások
    643 Megtekintések
    TIGT
    Recent versions of the API allow you to change a material's name in code. If you have a tool that's using a file of data that is material-name specific then clearly you need to know which of the possible materials with similar names it is to be applied to. There are several possibilities. You manually add a material from a library with the name 'Stonewall', there is NO preexisting material with that name, and therefore the new material gets called 'Stonewall'. You have a material already in the model named 'Stonewall' and you manually add a material from a library with the same name, and therefore the new material gets called 'Stonewall1'. You have a material already in the model named 'Stonewall' and you manually add a material from a library with the same name, and therefore because there's also a material in the model named 'Stonewall1' the new material gets called 'Stonewall2' [this will go on until 'Stonewall999' and beyond!]. You have a material already in the model named 'Stonewall1' and you manually add one from a library with the name 'Stonewall', and because there's NO material in the model named exactly 'Stonewall' so the new material gets called 'Stonewall'. So how do you decide which is the real 'Stonewall' material you want? It's likely that the model.materials collection is in the order they are created [at least in a session]. Therefore to find the 'true' 'Stonewall' material try this: name='Stonewall' ### or any other material name to be found... mat=Sketchup.active_model.materials.to_a.find_all{|m|m.name=~/^#{name}/}[-1] Thus the last match in the matches list is the material last added, so logically is the one you want? To get that material's name use mat.name...
  • [observer issue] onEraseEntities not working?

    4
    0 Szavazatok
    4 Hozzászólások
    325 Megtekintések
    Dan RathbunD
    That's interesting.. I did not realize we could make code blocks have smaller text.
  • [Question]how to load a tool from an external .rb file

    4
    0 Szavazatok
    4 Hozzászólások
    193 Megtekintések
    R
    Thank you Dan. It worked I have started to go through the Ruby Resource as you suggested. And I also found the answer for my own question in there.
  • Combining 2 groups of entities?

    2
    0 Szavazatok
    2 Hozzászólások
    132 Megtekintések
    Dan RathbunD
    begin # model.start_operation('Add nested group') ### OPERATION # editents = model.active_entities() topgrp = editents.add_group() topents = topgrp.entities() group1 = topents.add_group() r_entities = group1.entities() #(add entities to group1 here) group2 = topents.add_group() rr_entities = group2.entities() #(add entities to group2 here) # ### model.commit_operation() # rescue Exception => e model.abort_operation() puts(e.message) puts(e.backtrace) end
  • Auto create an given item at a calculated location? See insi

    2
    0 Szavazatok
    2 Hozzászólások
    115 Megtekintések
    TIGT
    I suggest you read the API... https://developers.google.com/sketchup/docs/ The entities.add_...() methods do want you want... You'll also need to understand Transformations [simple will do!] used to locate some things like 'instances'... and how to create objects like Point3d and maybe Vector3d... There many freely available snippets and full-scripts, that already do what you seek, so there's no need to reinvent the wheel from scratch - just understand what you are doing... I might move this into the Developers' Forum... [EDIT: done.]
  • Component definition list from Ruby vs SU window

    5
    0 Szavazatok
    5 Hozzászólások
    550 Megtekintések
    P
    great, thank you both for the information!
  • Rotating a board into XY plane

    2
    0 Szavazatok
    2 Hozzászólások
    177 Megtekintések
    Dan RathbunD
    John.. I checked the [ Code Snippets ] Index ... ... and I did find this from TIG: [ Code ] Transformation_Extensions
  • Will NOT scramble ??

    44
    0 Szavazatok
    44 Hozzászólások
    3k Megtekintések
    K
    @dan rathbun said: OH wait !! I'll fix the example. Sheesh that was a dumb one. (I had actually tested it with the "load on start" parameter, set to false. So this error did not happen for me in testing.) DONE Now I see the contours of a TEMPLATE for future plugins made in THE RIGHT WAY in a HURRY - that's good practice I think ! Still I have some claims and I'll try figure it out myself before I seek you help
  • Download Plug-In

    7
    0 Szavazatok
    7 Hozzászólások
    307 Megtekintések
    Dan RathbunD
    Since he is using the extended Ruby libraries, with a full Ruby install... @tig said: Instead of trying to deflate the compressed file as it arrives ... why not download the compressed files into a temporary folder ... Net::FTP @tig said: ... then extract their contents ... Zlib @tig said: ... finally move the extracted files to their final destination, and tidy up by erasing the unneeded compressed files and their temporary folder... FileUtils
  • How toget a Settings Menu to communicate with a Main Menu?

    18
    0 Szavazatok
    18 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    @tomot said: ..., I realize that Goto can easily be satisfied using if. No it cannot. @tomot said: My current Ruby already contains some 20 if statements, which are goto's. No they are not branching statements, they are conditional statements. But you CAN make them branch off to some other part of your code, by making method calls, in response to the boolean evaluation of the conditional expressions. if condition_is_true then call_method_one() else call_method_two(); @tomot said: I should be able link via another if statement the sharing of the stored registry value of the @stylewidth in Dialog 1 and Dialog 2.. Again... in a procedural language, a method call (aka procedure call,) takes the place of the old goto from the old sequential linear languages like Fortran and GW-BASIC. Whenever you identify a particular place in your code, that you need to "goto" (usually repeatedly,)... then THAT is the spot where you need to begin a method.

Advertisement