🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download
  • YouTube Ruby

    14
    0 Votes
    14 Posts
    1k Views
    G
    [image: XV2M_su.png] That helps me inject "Help" codes into each script i do not remember how it is operated. just changed a few codes on youtube embed. m.add_item('HELP..clean3..') { link_value='<object style="height; 390px; width; 640px"><param name="movie" value="http://www.youtube.com/v/seJYub0LCmQ?version=3&feature=player_profilepage"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/seJYub0LCmQ?version=3&feature=player_profilepage" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></object> ' @dlg = UI;;WebDialog.new "CleanUp³ YouTube Help " html_string = "<html><body leftmargin=1 topmargin=1 bottommargin=0 marginwidth=0 marginheight=0>" + link_value + " </body></html>" @dlg.set_html html_string @dlg.set_size 680, 410 @dlg.show p html_string }
  • *.rbz installer

    4
    0 Votes
    4 Posts
    1k Views
    Q
    Hmm thanks TIG, i'm going to look into that. Quintus
  • Drawing a parallel line

    3
    0 Votes
    3 Posts
    721 Views
    TIGT
    If you are drawing these double lines on a 'surface' then picked-point at point1 can be used to return the best face below it - get the axis=face.normal... If it's not on any face or you want it flat then axis=Z_AXIS Then next picked_point point2 needs to be on that face, so get it's initial value and then use point2=point2.project_to_plane(face.plane) or if it's to be 'flat' use point2.z=point1.z instead so it's level with point1... This gives you the first edge edge12=entities.add_line(point1,point2) To make it's offset 'clone'... Assuming ' width' is the offset required. point3=point1.offset(edge12.line[1],width) rotate it into place... tr=Geom::Transformation.rotation(point1,axis,90.degrees) point3.transform!(tr) get the other end point point4=point3.offset(edge12.line[1],edge12.length) and then draw the offset edge edge34=entities.add_line(point3,point4)
  • Extension manager hooks?

    8
    0 Votes
    8 Posts
    411 Views
    Dan RathbunD
    @jim said: My understanding is that at least some of the SketchupExtension instance methods are meant to be called by SketchUp rather than by plugins. Yep. If interested, just read comments in the new extensions.rb file in the Tools dir.
  • Set/Get Attribute

    7
    0 Votes
    7 Posts
    348 Views
    A
    @dan rathbun said: Not in the global Objectspace, no... ... all your code should be inside your unique toplevel module, and all your classes should be inside that as well. Okay, that's what I thought. It was just the wrong use of variables, and people who were learning ruby from sketchy physcics scripts did the same thing, so now I know, Thanks
  • Webdialog

    6
    0 Votes
    6 Posts
    453 Views
    M
    Hello, Thank you very much, I am going to look at that.
  • [Code] Parsing arithmetic formulas

    6
    0 Votes
    6 Posts
    2k Views
    K
    I used this code in my joint tools and found it very useful as the user could enter equation if they do not know the actual value. However I could not make it work if the user entered the " for inches as sketch-up does. Keith
  • Problem with Joint Pushpull

    4
    0 Votes
    4 Posts
    537 Views
    fredo6F
    @hrland said: I have the same problem and when I made the change it won't let me save, tells me "access denied". Any way to get this fixed? Thanks. The problem derives from a wrong installation: i.e. For whatever reasons, the image files JPP_....png icon files cannot be found in the JPP_Dir_xx directory. I suggest you check if the files are present. Fredo
  • Moving object in steps

    6
    0 Votes
    6 Posts
    274 Views
    P
    i got it, will post solution later
  • Get form data from webdialogs?

    27
    0 Votes
    27 Posts
    2k Views
    P
    I always do as chris does: collect in one string, send to SU, split there if needed
  • Section Plane

    14
    0 Votes
    14 Posts
    1k Views
    P
    ThomThom, thx for the answers! With auto-creation I mean this: The creation through ruby of a section plane in each of the 20 groups that are in the model.
  • (Windows) Plugins Locations

    5
    0 Votes
    5 Posts
    405 Views
    Dan RathbunD
    @thomthom said: @jim said: @dan rathbun said: User acces to the AppData folder heirarchy on Win 6+ is problematic. Reference? [Citation Needed] .. what for ? Just try it. I'm not saying there is not a solution. But you first need to recreate the situation. 1) Create a new (temporary,) user account on your Win7 machine called "JoeUser" or whatever. Do not give this new user account admin privileges. Just a standard user like in a work or school setting. 2) Now try and access the %APPDATA% path in Windows Explorer. (Heck.. even try it as an Admin,, it's still a PITB !)
  • Linux and Mac Virtual Key Codes

    2
    0 Votes
    2 Posts
    1k Views
    Dan RathbunD
    See these threads: My Apple Keyboard VK_KEYS onKeyDown repeat parameter problem Keyboard translation PC / Mac
  • Ruby rbconfig.rb

    2
    0 Votes
    2 Posts
    466 Views
    Dan RathbunD
    Should be the same, BUT the values of the Config::CONFIG hash attributes WILL DIFFER. The problem with the above statement is that rbconfig.rb is written by mkconfig.rb, (when the Ruby was built,) which may have itself changed over the various versions. Also, on Windows, some users install a one-click installer edition, that was not built on their own computer, and they may install it in a custom path, which may invalidate some of the values in the rbconfig.rb file. AND, only machines with a full Ruby install will have the rbconfig.rb file (in the platform subdir, of the Ruby lib dir.)
  • Model's save method, about chinese filename and path

    6
    0 Votes
    6 Posts
    587 Views
    O
    I would like to support chinese path as Sketchup's open_file method, model's save method why not support it?
  • Make A Component Using only Ruby code

    2
    0 Votes
    2 Posts
    330 Views
    J
    Hi Steve, You seem to have a grip on it for the most part. Instead of creating the geometry before creating the ComponentDefinition, you should create the Definition and then add entities to its Entities collection. You can use ComponentDefinition#save_as to save it out to disk. new_def = Sketchup.active_model.definitions.add("My Component") new_def.entities.add_face(...) new_def.save_as("C;/My Component.skp") model.entities.add_instance(new_def, [0,0,0])
  • Where to Store User Settings?

    29
    0 Votes
    29 Posts
    2k Views
    K
    @thomthom said: That would then not be User data - but Model data. Two very different things. Looks like I interpreted thread subject in a context of my own thoughts I mean, I was going to suggest to use template for storing user settings data. [image: EVA0_template.png] It is less elegant than just click "OK" button in "Settings" dialog of the plugin, of course But the user can save his own presets in template file, add description to it, then it will be possible to revert back to any previously saved configuration. UPD. The point is that I was thinking about abstract "application user" not the operating system user. Application means plugin here. So I thought that application (plugin) usually runs "system wide" (not in "per user mode") and the problem is what is the best way to persist application settings (i.e. user preferences *application user here again). Storing plugin settings right in document allows user preferences persistence across different machines and even across operating systems in theory (when I say "user" I mean plugin user). So user can take his *.skp file anywhere and continue working with it on any device that has SU and plugin and he does not have to care about configuring plugin again on each device.
  • How to do a crossing box select by ruby?

    6
    0 Votes
    6 Posts
    380 Views
    thomthomT
    You could perhaps do a simplified version and map the boundingbox of the groups to a cached array, then use Geom.point_in_polygon_2D to see if any of the points are within the selectionbox of your custom tool. It will miss the cases where a selectionbox crosses the group's boundingbox but the corner points are outside, but if you start to do intersection on all that you might very well end up with a sluggish tool. Might be good enough?
  • Undo stack question

    6
    0 Votes
    6 Posts
    365 Views
    Dan RathbunD
    You are correct ... ... a Layer is a subclass of Entity, so perhaps the EntityObserver might fire the onChangeEntity() callback. You'd have to try it. I do not know if it will work.
  • Unique identifier for model?

    9
    0 Votes
    9 Posts
    556 Views
    D
    Yes the problem comes when you have multiple SU processes running (I'm guessing users do this more on OSX because of the way windows are managed). So when the plugin starts and tries to delete tempfiles, there could be another SU using it. Hence the file lock.

Advertisement