⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Group moves far away when i want to scale

    4
    0 Votes
    4 Posts
    464 Views
    tt_suT
    @youngosg said: t = Geom::Transformation.scaling 2 There is an issue with this method - it doesn't produce the same transformation as Geom::Transformation.scaling(2, 2, 2) The former change the 16th value in the matrix - instead of scaling the components. I'm not sure why it was implemented as such, but several render engines have had issues with that. I think even SU have issues in some cases. Think we have an issue filed to change it.
  • Executing one call_back executes another.

    12
    0 Votes
    12 Posts
    798 Views
    thomthomT
    That would do the same thing - the <form> element usually have the URL to which to submit to. Without a parent <form> the submit button had no default action.
  • Using add_line to automatically create a new face

    6
    0 Votes
    6 Posts
    675 Views
    Z
    Thanks I've missed that edge.find_faces, it works great. I think the naming put me off as I wasn't expecting that it will also add faces, I just thought it was going to find potential faces, I think it should may be renamed: find_and_add_faces just for clarity.
  • Correction of codes

    4
    0 Votes
    4 Posts
    425 Views
    K
    Thanks, sdmitch and slbaumgartner. Now It works well However, I'm planning to create some shapes more with this way and actually made few shapes. I'm worrying about increase of icons in Sketchup, and am making ideas how to simplify tools. Making dialog box I saw some free tools which 'inputbox' is added together. If the shapes can be individually selected in inputbox, I need not add icons anymore, but don't know how to make it. I know basic codes for creating inputbox, and would like to apply the basic code to what I want(choosing each shapes individually in inputbox). Additionally, Is it possible to add shapes which are saved in .skp file(I know how to load shapes saved in .skp file by using 'Class' method and how to place it on Sketchup space clicking) into inputbox too? Using webdialog If i create webdialog box and add all icons into the webdialog by making tables(categorization), This way may look good as well. I'm trying to use dlg.add_action_callback("") {|d, p|Sketchup.send_action ""} Can i utilize this command for making icons in webdialog? I mean, the command looked like only basic tools(Undo, Redo, New, Cut, PushPull) can be used with the command. For example dlg.add_action_callback("Undo") {|d, p|Sketchup.send_action "editUndo:"} dlg.add_action_callback("Redo") {|d, p|Sketchup.send_action "editRedo:"} dlg.add_action_callback("New") {|d, p|Sketchup.send_action 57600} dlg.add_action_callback("Open") {|d, p|Sketchup.send_action 57601} dlg.add_action_callback("Save") {|d, p|Sketchup.send_action 57603} As you know, these actions are used in HTML and '<scrip> </script>' connects between ruby codes and HTML codes for indicating icons in webdialog. How can I make my own Sketchup.send_action? If it is possible, I will add the icons into webdialog.
  • To Convert Sketchup Points to CNC G-Code

    2
    0 Votes
    2 Posts
    2k Views
    Dan RathbunD
    Someone started a project but needs someone else to finish it: Model2GCode - who would like to continue? Other projects: [PlugIn] 3D Printers G-Code importer/Exporter Ver0.0.9 [Plugin] 2.5D CAM Plugin 20121202 [Plugin] Another g-code export
  • RBeautify - Ruby Code Beautifier

    8
    0 Votes
    8 Posts
    2k Views
    Al HartA
    I found a different problem. I was using this code to set a string: (This loads all text up to the word HERE into a string with new lines, etc.) ` smess = <<HERE This face will not render in the material you have created, since it is on placed the reverse side of a face. Use "Setup Options/Special/Process 2 Sided Faces" to allow materials on reverse faces to be rendered. HERE` and the beautifier indented the last line (HERE) which cause the ruby to fail
  • Edge.all_connected to curve

    2
    0 Votes
    2 Posts
    317 Views
    D
    have a look at TIG_weld.rb, you can even run it from your own script using require...
  • Auto show plugin window at startup

    9
    0 Votes
    9 Posts
    2k Views
    Dan RathbunD
    @sawdust_online said: Tell me, can we deal with sketchup API and another language than Ruby? ... is there any other way ? You can write extensions in C & C++. @sawdust_online said: I use it for about a week but I'm not sure to go deeper. At first it looks as a strongly typed language easy to use for developers but this doesn't turn real. How a language could be easy if it requires two keys for commenting a single line? it's the first time I meet such odd thing! It would be better to start a new topic about the Ruby language. Or repost your thoughts to one of the old topics... Should we / could we learn Ruby? Where to Start with Ruby?
  • Questions on Styles and Rendering options

    12
    0 Votes
    12 Posts
    953 Views
    CadFatherC
    api definitely needs some development here, you cannot even do a style.erase command. (just purge) i looked inside a *.style file (aka zip), hoping to find some hints. some obscure numbers which surely must be pointing to the settings like face colours etc, but too cryptic. not to mention watermarks.
  • Transformation.x/y/zaxis and transformation.axes

    4
    0 Votes
    4 Posts
    445 Views
    Dan RathbunD
    @oajfh said: Perhaps there's an implicit point to vector conversion or vice-versa, but in that case the API makes no mention of it. In mathematics, both are represented as arrays. @unknownuser said: ** class](http://www.sketchup.com/intl/en/developer/docs/ourdoc/array.php)":1hykbm7x] Introduction The SketchUp Array class adds additional methods to the standard Ruby Array class. Specifically, it contains methods allowing an array to behave just as a Vector3d or Point3d object (which can be thought of as arrays of 3 coordinate values.) Therefore, you can use the Array class in place of a Point3d or Vector3d as a way to pass coordinate values. The opposite is also often true, as well. The API docs need updating in regard to allowable parameter types. P.S. - The docs are misleading when it says "The SketchUp Array class ..." There is only one Array class. The SketchUp API just modifies the Ruby Array base class.
  • Make SketchUp API to recognize System PATH

    3
    0 Votes
    3 Posts
    511 Views
    G
    Thanks, Dan! Your answer does give A LOT of food for thought. I will try someof these and let you know. Regards
  • Get the coordinates of the corners of the viewport

    31
    0 Votes
    31 Posts
    3k Views
    A
    I'm not sure if I used any C++ 11 syntax in that C++ extension, but Ruby C++ extensions as a whole give so much opportunities to writing great plugins in SU. I'm amazed that SU team chose Ruby over all available programming languages. Back then, when SU was first released, Ruby wasn't even popular, but SU team bypassed popularity and chose Ruby because Ruby was both simple and powerful due to a feature in supporting C extensions. Today, Ruby is becoming popular and is improving in performance and in features. Something tells me that SU had and still has really great minds behind it because choosing Ruby was the best path SU team could ever take. Imagine if they chose python or any other high level, limited programming language. SU would have been a totally different story from what it is today. Huge thanks goes to SU team for making SU a very great software for writing powerful plugins.
  • Transformation

    4
    0 Votes
    4 Posts
    417 Views
    tt_suT
    You might find it useful to use the Transformation Inspector to visualize the matrix: http://extensions.sketchup.com/en/content/transformation-inspector
  • HoloLens and SketchUp

    2
    0 Votes
    2 Posts
    2k Views
    Dan RathbunD
    Corrected link: http://www.engineering.com/DesignerEdge/DesignerEdgeArticles/ArticleID/10051/Microsoft-to-bring-Immersive-3D-to-AEC-Models-with-HoloLens-and-SketchUp.aspx
  • MySQL connexion

    3
    0 Votes
    3 Posts
    384 Views
    Dan RathbunD
    @inteloide said: Is there any way to link Sketchup to a MySQL database in pure ruby ? (1) I believe, You or whomever runs the Server still need to install MySQL: http://dev.mysql.com/downloads/windows/installer/ From Ruby Console: (2) Gem::install "ruby-mysql" (Pure-Ruby edition - C edition is "mysql" gem.) source: https://github.com/tmtm/ruby-mysql gem: https://rubygems.org/gems/ruby-mysql doc: http://www.rubydoc.info/gems/mysql/ (3) Gem::install "dbi" gem: https://rubygems.org/gems/dbi doc: http://www.rubydoc.info/gems/dbi (4) Gem::install "ruby-odbc" gem: https://rubygems.org/gems/ruby-odbc doc: http://www.rubydoc.info/gems/ruby-odbc
  • ID - Definition Name

    2
    0 Votes
    2 Posts
    317 Views
    TIGT
    You are asking about several different things... model = Sketchup.active_model defns = model.definitions ### the definitions in the model - components/groups/images p defns[0].methods.sort ### for list of a definition's available methods - also see API guide http://www.sketchup.com/intl/en/developer/docs/classes.php defns.each{|d| p d.name ### name of defn p d.instances[0].name if d.group? ### name if it's a group p d.get_attribute("dynamic_attributes", "_name", "???") ### if DC 'name' or '???' if not. p d.guid ### the unique GUID for the definition - Note: this only enduring across sessions in newer SketchUp version. }
  • Are any of you guys interested in programming work?

    9
    0 Votes
    9 Posts
    3k Views
    KrisidiousK
    And this post is from 3 years ago soooo... I think we could prolly just ditch it all together.
  • Import image (in padded cell..!)

    16
    0 Votes
    16 Posts
    897 Views
    Dan RathbunD
    @tig said: I assumed that if you stop a timer it's the same as ' break' in a block, so then it'd never get to image.erase!, but having tested it I see that it complete the entire iteration after the timer is stopped ! Of course it does. A timer just loops and calls the block on the set interval. (The setInterval timers in Javascript work the same way.) This why you should always stop the timer immediately when the condition is met. Otherwise the block gets queued up to be executed again, perhaps even before the first time is done doing it's work. @tig said: I don't immediately see the advantage of using @tid over tid - the block of code executed by the timer is referring back to itself, ... Sometimes it works. But I have experienced that in some situations, the ID reference becomes invalid (perhaps gets garbage collected.) And then the call to stop the timer does not work. [I remember having a discussion with Jim Foltz about timer IDs being invalid, or garbage collected.] The Ruby docs say a proc is supposed to have access to it's environment (like a snapshot,) when it is defined. But the API UI timer is implemented on the C++ side. @tig said: ... it's not like we are stopping it in another def method ? I always assume code samples are going to run in a method. It is rare that code is something that runs once at startup, (although we sometimes do post code like that.) THIS feature we are discussing, is something that will be used "on demand" (by a end user,) in a Tool class or a UI::Command, which means it'll likely be wrapped in a method. Bottom line, ... the above is my best advice on best practice. Believe or not, as you will. It is not arbitrary. I have had timer use fail in the past when using local var for the id. Perhaps under Ruby 2.0, things have changed with regard to the timer IDs, .. but I still always use a persistent reference for timer IDs on the Ruby side, until I know it is no longer needed. As far as using rescue in modifier position goes, that is a no brainer. (And is not a best practice rule I made up. I got it from one of the Style Guides or maybe the "Pick-Axe" book.) begin; statement; rescue; end is just plain uglier, and doesn't read as nice as: statement rescue nil
  • 2D Export &gt; Export All Scenes?

    20
    0 Votes
    20 Posts
    12k Views
    J
    Thanks for all the replies even though it sounds as though what I want isn't easily obtainable! Yes, I was talking about Didier's ADO plugin. I'll remove the files from my plugins folder as suggested though they didn't get loaded by SU 2015 at all that I could see. Jon
  • PLUGIN - some help please

    4
    0 Votes
    4 Posts
    432 Views
    xombie1912X
    @tig said: So, what I see is a parametric 'box', which is an effective 'wall'. What is it you are trying to do in a SketchUp Plugin ? There are already some examples of parametric forms - e.g. su_shapes available from the EW... THANKS TIG i want to do a block workflow this is a older research i made with autocad and sketchup http://www.youtube.com/watch?v=Q4hqt_aNuog sorry its in spanish language because its an older research i made its like revit or archicad the problem i have in this research its the time for export and the materials and my new research i want to do its make a plugin can swap 1 component and other instances for other component with no exactly the same name example in autocad i use component bed-A if i export to sketchup i want to select and replace for bed-B or bed-C bed-A its a line block in autocad bed-B its model for sketchyp in the same folder the bed-A is and the bed-C its proxy the final result you can swap or replace every autocad blocks you work for sketchup 3d models or proxys with a few clicks in sketchup

Advertisement