sketchucation logo sketchucation
    • Login
    1. Home
    2. sdmitch
    3. Topics
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 3
    • Topics 54
    • Posts 1,483
    • Groups 2

    Topics

    • sdmitchS

      Component that can not be made unique

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      766 Views
      S
      If you want each copy to be unique, why not use Groups? The Group#copy method automatically clones the associated ComponentDefinition and hooks the new copy to the new clone. That is, each copy is "unique" right from the start.
    • sdmitchS

      Coping with SU2017 entity handling changes

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      747 Views
      Dan RathbunD
      @sdmitch said: I have tried using .clone and .dup but neither remedy the problem. Any guidance will be greatly appreciated. These two methods are Ruby Core functions that rely upon specific Ruby housekeeping methods to do the copying. The SketchUp API has not set up these "housekeeping" methods, so doing this will not work. They have only in a few places "mimicked" a clone method (mostly in the Geom classes,) and a partial cloning in Group#copy. (It does not copy over attributes and other parameters.)
    • sdmitchS

      Fails succeeds fails......

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      377 Views
      sdmitchS
      @tig said: I don't have time to dissect your code in detail... But it seems to me you are replicating my Latticeizer plugin ? Look at that... http://sketchucation.com/pluginstore?pln=Latticeizer You need to offset the perimeters of the edges' faces [which sometimes fails, just like native-offset - so it perhaps needs my Smart_Offset?] It's NOT easy... Don't waste your time dissecting it since this is a just for fun exercise. I have found a number of bugs but have a few more to go. I have no intention of publishing it since, as you say, there is Latticeizer and others already out there.
    • sdmitchS

      Executing one call_back executes another.

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      598 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.
    • sdmitchS

      Ruby, rotate a component from its own axes

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      1
      0 Votes
      1 Posts
      580 Views
      No one has replied
    • sdmitchS

      Odd results from add_circle/add_face combo

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      594 Views
      thomthomT
      [image: 0Fbs_2015-04-06_21h44_53.png] For for me as well - SU2015 Win8.1. Have you tried with extension disabled?
    • sdmitchS

      Odd behavior of Draw

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      17
      0 Votes
      17 Posts
      661 Views
      S
      @sdmitch said: Well I have tried all the suggested combinations and nothing seems to solve the "problem". Perhaps it is just my 7 year old laptop!!!!! Since these draw operations go directly to OpenGL, this explanation seems quite possible! There could be a bug in either your laptop's OpenGL drivers or an incompatibility in how SketchUp uses OpenGL.
    • sdmitchS

      &lt;canvas&gt;

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      19
      0 Votes
      19 Posts
      776 Views
      D
      @Greg updated script runs from the top... @TT please right up the debug info... The biggest hassle I find is injecting Web Inspector on jQ UI's [especially from .rbs files]... john
    • sdmitchS

      WebDialog parameters passed to callback cause .to_l error

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      29
      0 Votes
      29 Posts
      937 Views
      TIGT
      But that Ruby float as a string is ALWAYS going to return "1.0", so it always sets as "." even when the user's day-to-day decimal-separator is "," The issue is how the user input of "1,0" is correctly read as a float or a length. In the UI 'input' the default input type pretty much sorts that out. Since 1.0.m displays as 1.000m or 1,000m depending on the user's locale [and of course the model's unit settings] In a webdialog it's more awkward, because all input is a string that needs 'interpreting'. So the earlier posts' trickery using lengths etc to get the real separator would help... Certainly when initially populating the webdialog with decimal values... Like sep = (begin;'1.0'.to_l;'.';rescue;',';end) So if sep==',' we present decimal numbers differently using something like tr('.',',')? But surely some leeway could be used... What if a user first inputs x = 1.0 then x = 2,3 ? Should BOTH be acceptable ? So assuming they are expected as floats... if sep=='.' x.tr!(',','.') else #',' x.tr!('.',',') end For the display-side this makes either typed in separator suit the the 'locale', but on the Ruby-side, it's always x_float = x.tr(',','.').to_f For inputted 'lengths' it is different, because the Ruby-side expects it to be in the locale separator format... The first sep==...tr... still applies to ensure it's locale friendly... BUT then the x_length = x.to_l must be used Ruby-side...
    • sdmitchS

      SKETCHUP_CONSOLE.clear

      Watching Ignoring Scheduled Pinned Locked Moved SketchUp Feature Requests sketchup
      4
      0 Votes
      4 Posts
      3k Views
      J
      It is in the release notes, but it still does seem somewhat obscure.
    • sdmitchS

      WebDialog input text and the single quote.

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      464 Views
      sdmitchS
      @tt_su said: @sdmitch said: Early on I had problems using .get_element_value so I never thought about it again opting to get the values from the "p" string. What problem was that? I also utilize get_element_value for callbacks from JS to Ruby. I use a bridge that convert basic Ruby and JS objects back and forth with synchronous callback on both platform. Using an input element as data transfer is my standard technique. It was very early in my plugin career and involved radio buttons. As soon as I found something else that worked, I never tried using it again. I'm sure it was mostly, if not all, operator error.
    • sdmitchS

      [Plugin] Deck Builder (Updated 23-Jun-2015)

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      56
      0 Votes
      56 Posts
      51k Views
      pilouP
      Your new version is excellent and very elegant! And surprise Spindles are components! So mad replacement or modifications are now easily possible! (trick: explode circle or polygon if they are "alone") [image: W7xt_Deckv6.jpg]
    • sdmitchS

      Is there a &lt;select equivalent for &lt;input onClick?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      591 Views
      sdmitchS
      Thanks much Dan for the info. Looking back at by previous posts, I see that I never made it clear that the question is relative to a WebDialog associated with a plugin. Don't know if that matters but just so you know. Eureka I have found it. It was all a matter of where the onChange was. Because the onClick was part of each radio button statement, I assumed it was the same with the select list. Instead it just needed to be in the <select> statement itself. Thanks again to one and all for the links that put me on the right path to find the answer. def showme() @dlg=UI;;WebDialog.new("VerySimple", true,"Test",500,300,10,10,true) @dlg.set_html( "<html> <body> <form> <select onChange='tellSketchup(value)'> <option value='option1' >Option 1</option> <option value='option2' >Option 2</option> </select> ; Head Type<br><br> </form> <script type='text/javascript'> function tellSketchup(value) { window.location='skp;OptionChanged@'+value; } </script> </body> </html>" ) @dlg.show {} #show it @dlg.add_action_callback("OptionChanged") {|d,p| puts "OptionChanged value=#{p}" } end
    • sdmitchS

      [Plugin] FloorGenerator ( Updated 6-Apr-2017)

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      331
      0 Votes
      331 Posts
      342k Views
      F
      ciao, questo è un ottimo plugin
    • sdmitchS

      Help me solve a mystery

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      11
      0 Votes
      11 Posts
      529 Views
      D
      Is this editor will have the same behavior? http://www.alexschreyer.net/projects/sketchup-ruby-code-editor/ the author said it was based on the Ruby Web Console
    • sdmitchS

      [Plugin] Image2Model Update 21-Mar-2014

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      7
      0 Votes
      7 Posts
      4k Views
      TIGT
      Even if a PNG Image is transparent the shadow is ALWAYS a rectangle ! To have a cutout shadow you need to make a cutout Component made from an Image. See my ImageTrimmer tool [comes with SKMtools] OR do it longhand by editing the outline... ImageTrimmer works on PNG Images with a transparent background... It then offers the chance to convert it into a JPG texture, because that will receive shadows unlike a PNG based textured material
    • sdmitchS

      [Plugin] Face2Frame - Updated 27-Mar-2014

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      66
      0 Votes
      66 Posts
      56k Views
      sdmitchS
      @billmorr said: Hi Is it just me or has this plug in stopped working in Sketchup Pro 2017??? Face to Frame updated for SU2017 compatibility. Download new version for PluginStore or blog.
    • sdmitchS

      Adding groups to an existing group

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      149 Views
      sdmitchS
      Thanks TIG. I sure there is a logical explination as to why you have to add an instance to the container group and delete the original but seems strange to me. Anyway, using your suggestions, this is the modified code and it works just like I wanted. mod = Sketchup.active_model ent = mod.active_entities sel = mod.selection grpA = ent.add_group; grpA.name="container" tr=Geom;;Transformation.new() for f in ent.grep(Sketchup;;Face) grpB=ent.add_group f; tr=grpB.transformation grpB.name="#{f.bounds.width} X #{f.bounds.height}" grpC=grpA.entities.add_instance(grpB.entities.parent,tr) grpC.name=grpB.name grpB.erase! end puts "grpA contains #{grpA.entities.length} entities"
    • sdmitchS

      Adding items to an existing sub menu

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      200 Views
      J
      @sdmitch said: So even though the global variable retains lts value, the entity it references doesn't exist? I don't know the internals. But as yoou noticed, even when the global variable appears to reference a valid menu object, new items are not added after some short amount of time.
    • sdmitchS

      Linking to a Google Drive video

      Watching Ignoring Scheduled Pinned Locked Moved Newbie Forum sketchup
      1
      0 Votes
      1 Posts
      47 Views
      No one has replied
    • 1 / 1