⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Observers !

    20
    0 Szavazatok
    20 Hozzászólások
    4k Megtekintések
    H
    @unknownuser said: At least if you have AutoLisp experience exporting the xdata in a usable format for Ruby would be relatively straightforward... Thanks for your thoughts about extending such interface. I had thought about this for myself, but I have to make steps one after another. So first I want to get the structure in place again and then I can thought about adding/transporting more Info. The AutoLisp experience is not the problem, since I am a nearly full-time autolisp-developer and I am really used to do anything with ExtendedEntityData. We have logical propertys and geometric propertys stored in EED and even small chunks of Lisp-code stored there, which gets fired under certain events. So I can imagine I could do similar things in the future with ruby.
  • Fixing Camera Aspect Ratio

    9
    0 Szavazatok
    9 Hozzászólások
    675 Megtekintések
    Dave RD
    I think I got them with Skindigo.
  • Quirky draw method activity

    10
    0 Szavazatok
    10 Hozzászólások
    518 Megtekintések
    Chris FullmerC
    EDIT: Issue resolved in the 2 posts below this. Skip this post unless you're really interested in boring yourself to death. OK, its morning and I'm back! @line_positions is an array of points on the x axis. Each point acts as the base starting point for each vertical grid line. So first the method checks to see if @line_positions has been populated yet. If it has, then it takes each value from that array and calls it p1 and then adds an amount to the y of 100 and calls that p1, then draws the line from p1 (the base) to p2, the top of the vertical line. The 5.times do portion is drawing the horizontal lines by taking the first and last points on the horizontal boundaries. Then adds 20 to each and draws a line. Does that 5 times, and those are the horizontal grid lines. To explain better, @line_positions is defined once when the user hits enter. Its values do not change at all normally. To test this, I added a puts @line_positions[0] statement in my onKeyUp method. So everytime I press a key, it puts the first @line_positions position. And sure enough, when I disable the draw method, that value stays the same. But once I enable the draw method, that value changes everytime the screen is redrawn. So it appears that somehow something that I have in the draw method is changing the @line_positions, not just getting values from it. More specifically, when I comment out the 5.times portion (which is the part that draws the horizontal grids), then the method works as expected and does not change my @line_positions values. So I think it is something with how I have that written, but I can't see anything in there that should affect the @line_positions values. def draw( view ) if !@line_positions.empty? @line_positions.each do |e| p1 = e p2 = p1.clone p2[1] += 100 view.draw GL_LINES, p1, p2 end np1 = @line_positions[0] np2 = @line_positions.last puts "from draw " + @line_positions[0].y.to_f.to_s #5.times do # np1[1] = np1[1] + 20 # np2[1] = np2[1] + 20 # view.draw GL_LINES, np1, np2 #end end end All I can think is that is it possible that it thinks that since np1 points to @line_positions[0] when I change np1 it thinks I want the original @line_positions[0] value changed too and somehow sends the change back to that array? I'm a bit stumped with this one.... Chris
  • Store a hash as an value in an attribute dictionary

    6
    0 Szavazatok
    6 Hozzászólások
    919 Megtekintések
    T
    @pout said: Todd, when i store the hash it does not give me an error. But when i return it it is always nil My point exactly! @pout said: If it was stored wouldn't it return me an error telling that it can not be displayed insteda of returning nil? In a perfect world, yes.
  • Window Proportions Question

    18
    0 Szavazatok
    18 Hozzászólások
    2k Megtekintések
    M
    +1 for this cool program!
  • [code] ComponentDefinition-delete

    9
    0 Szavazatok
    9 Hozzászólások
    2k Megtekintések
    TIGT
    AlexM has found the basis of doing this without a new method at all... model.start_operation("Delete Definition") definition.entities.erase_entities(definition.entities.to_a) model.commit_operation I'm removing my 'code' and rewriting ComponentInstance-add_entites.rb to suit...
  • All-new API with full access to all internal functions?

    6
    0 Szavazatok
    6 Hozzászólások
    415 Megtekintések
    P
    i'VE BEEN PUNKED...
  • Position of a point

    4
    0 Szavazatok
    4 Hozzászólások
    242 Megtekintések
    Chris FullmerC
    Excellent, glad it helped (and worked). I also just edited a minor typo in the example, but I'm sure you figured it out even with the typo, Chris
  • Need an example to munipulate a dynamic component with ruby

    9
    0 Szavazatok
    9 Hozzászólások
    2k Megtekintések
    scottliningerS
    When you saved redsang.skp, did you File > Save As, or did you Right click > Save as? The File > Save As method is probably what happened. This isn't the same as saving sang as a standalone SKP. Try right clicking on red sang and "Save as" and then try the import. See if that works.
  • Film & Stage plugin

    23
    0 Szavazatok
    23 Hozzászólások
    4k Megtekintések
    thomthomT
    Just found this thread: http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=9321&p=145393 If you open the Ruby Console and type in Sketchup.send_action 10624 it opens a window which allows you to change SU's behaviour so it sets the AOV horizontally instead of vertically.
  • GL_TRIANGLES and COLOR

    2
    0 Szavazatok
    2 Hozzászólások
    400 Megtekintések
    fredo6F
    Don't worry. This looks like a bug (or a feature?) of the API in SU6 and SU7. I never found any workaround. Why do you think the divider in Stretch happens to be black!? However, in 2D mode (view.draw2d), you can control the color. Fredo
  • Transforming multiple vertices simultaneously?

    15
    0 Szavazatok
    15 Hozzászólások
    610 Megtekintések
    J
    Normally yes, but he wants to apply a different transformation to each vertex.
  • Cant find fredolib or freescale

    6
    0 Szavazatok
    6 Hozzászólások
    2k Megtekintések
    Chris FullmerC
    Excellent, glad it worked. And thanks for the monitor solution. I fixed it by moving and pawning that old monitor situation off to a coleague who now has to deal with it. Chris
  • Why Not?

    5
    0 Szavazatok
    5 Hozzászólások
    651 Megtekintések
    jeff hammondJ
    well, automator isn't a user action recorder.. (although it has that as one of it's options).. i guess what you guys are talking about is similar to creating an action in photoshop where i push record/do some things/stop recording then when i play the action, it will repeat what i did.. the basic interface that i'm talking about looks like this: [image: auto.jpg] i can select which type of file etc i would like to control and then a list of options for that appear (the screenshot shows the options for file/folders.. a new set of options shows up if i select say 'sort finder items' (by date,type,size,name,etc) ) and there's a list of varibles as well.. basically, it's letting me write a script without actually writing.. the same idea as a mouse with windows/icons etc compared to a command line...
  • Producing an error message for a run-time ruby error

    6
    0 Szavazatok
    6 Hozzászólások
    756 Megtekintések
    D
    def test_error1 begin test_error2 # code which may contain an error rescue Exception => e do_rescue(e, "Test Error") end#begin end#def can be even reduced to def test_error1 test_error2 # code which may contain an error rescue Exception => e do_rescue(e, "Test Error") end But what really bothers me is that there is no option to make Ruby console pop up when there are new messages and stay hidden otherwise. As for now I guess I would just keep a file with Sketchup.send_action("showRubyPanel;") in the Plugins folders while doing active development.
  • SketchUp SDK Scrambler - Problem with paths?

    4
    0 Szavazatok
    4 Hozzászólások
    363 Megtekintések
    T
    Scott, You're a lifesaver! Worked like a charm. Just needed to get the plugins folder. Got it. Thanks! Tali
  • Replacing Selected Component Instances as New Component?

    3
    0 Szavazatok
    3 Hozzászólások
    220 Megtekintések
    A
    @daiku said: I think I understand what you are asking for. If you select multiple instances, and then choose "make unique", all of the selected instances will now share a new component definition. CB. Thanks! It was too obvious for needing a plugin for that... but then, there are some obvious things that needed to be implemented via plugins... you saved my day pal (literally, since I would spend hours doing it manually!)
  • Surveyor's plan plugin

    4
    0 Szavazatok
    4 Hozzászólások
    303 Megtekintések
    thomthomT
    @unknownuser said: What would be very useful would be to have a method that, given an EntityID, returns the entity object. I second this. My reasons is that I can easier communicate with webdialogs.
  • Camera.aspect_ratio=

    2
    0 Szavazatok
    2 Hozzászólások
    217 Megtekintések
    thomthomT
    I experienced that when I made my V-Ray Toy plugin. Due to the zooming, V-Ray would not match the SU viewport. Not until I took the ratio of the viewport's width/height and entered that as V-Ray's Zoom property. And it has bothered me that it zooms in like that as I can't just simply convert existing views to have an aspect ratio. Though, I haven't looked further into the matter. I'm very interested in what comes out of this thread. Btw, you have noticed that SU uses vertical Angle of View instead of horizontal?
  • How to orient component in space using ruby?

    11
    0 Szavazatok
    11 Hozzászólások
    529 Megtekintések
    Chris FullmerC
    Also, in case you know nothing about axes, like me, Fredo showed me that if you multiply 2 axes together, you get a perpendicular axis. This is helpful if you can find 2 axes, say the x and y, you can just multiply them together to get the z axis. Then you have all 3 axes needed for the transformation. It would look like this: xaxis = Geom::Vector3d.new(10,-23,110) yaxis = Geom::Vector3d.new(23,52,9) zaxis = xaxis * yaxis Gives the result of: (-5927.0, 2440.0, 1049.0) for the zaxis. Chris

Advertisement