sketchucation logo sketchucation
    • Login
    1. Home
    2. Michaelv
    3. Posts
    ⚠️ Attention | Having issues with Sketchucation Tools 5? Report Here
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 15
    • Posts 95
    • Groups 1

    Posts

    Recent Best Controversial
    • [Plugin] Loader for Rotated Rect, Circle and Box [6/14/12]

      This plugin creates a single menu entry and a single toolbar for all three tools:

      • Rotated rectangle (rectangle from 3 points)
      • Rotated Box, the very recent and great plugin from sdmitch:
        http://forums.sketchucation.com/viewtopic.php?f=323&t=45806
      • Rotated Circle-cylinder, the very recent and great plugin from sdmitch:
        http://forums.sketchucation.com/viewtopic.php?f=323&t=45909

      V1.1.1 (current) with Rbox V 1.2 and RCylinder V1.2

      All three plugins have also been modified to work on Mac (the last two only switched the ctrl key for the Alt key for grouping on/off). They should work on PC however with no problem (not tested though), just some keys may have changed.
      The loader has not been tested on PC but there I don't anticipate any issue either.
      V1.1.x: All should work perfect on both platforms (Alt for Mac, and Ctrl for PC for box and Cylinder). Rectangles is a different script, so not sure this version works perfect on PC, it does on Macs.
      Waiting for feedback on the loader/toolbars as well, but it should work on PC.

      The icons are crude, and even frankly suck, but I'm not a graphic artist, so help is welcome. Here they just serve the purpose.

      This zip includes all three modified tools (and they are stored in a subdirectory). Even though for simplicity it is probably better if you take the original tools out of the plugin folder,you can also keep them, all it would do is give you another access point (single menu entry for the original tools, and toolbar/submenu entry for the grouped one). Both are independent so you can have either, or or both, your choice.

      Much thanks to all the original tool creators.

      To install:
      Unzip the enclosed file into some directory, then:
      Copy or move the following content of the extracted folder (3Points Tool) into your plugins folder:

      • 3Pts_loader.rb file
      • "3Pts_Tools" folder with its content ("Points" not spelled out)
        The "3 Points Tool" folder ("points" spelled out) is just a container, it can then be discarded with whatever other files that may remain in it.
        More details on installing here: http://forums.sketchucation.com/viewtopic.php?f=323&t=35746

      For cleaner install on PC or for the rbz file see here:
      http://forums.sketchucation.com/viewtopic.php?f=323&t=45923#p410850


      3Points_Tools 1.1.1.zip

      posted in Plugins
      M
      Michaelv
    • RE: A new home for SketchUp

      @edson said:

      very rash decision. how can they do that if nothing has changed?

      Because in the absolute a lot has changed and that is what creates the worry for some and the reaction in others.
      Trimble much like Google is a business, so in that sense it's the same.
      Google did what they did, so there is no more unreasonable expectancy as to what they would have been doing, we know what it is and what it was. Trimble "will do" so it's always less real in the future than in the past, besides they haven't been really very forthcoming as to what they will really do so far.
      And I think most of all is the business model. Google has time and time again shown that their business model is to make something available to the community (maps, search, email, earth, etc..) and then find a way to capitalize upon it, that is their model, and so was the model with SU as well. So implicitly, we placed a certain value in that.
      Trimble so far is an unknown and certainly has not proven anything in these terms. They have a very traditional business model it seems, develop their company and their brand on a "sell products" model. That doesn't mean they won't do it, and they said they would, but for them it's a bit of a paradigm shift. So we have to hope and believe in the mean time. The quicker we see concrete action and confirmation, the better.
      Google is rich and a well known name, that has impact as well. Trimble as known as they may be is much less known in general, especially worldwide.

      All that plays a role, most particularly in any business decision, whether it should or not.

      There will be an impact as we see here. We should just hope that Trimble will react strongly and show that it is progress indeed, and that we will lose no people and gain a few.
      At this point they are either fine with that as they had an entirely different objective all along and are just trying to lose as little as they can in this maneuver.
      Or they are genuinely motivated to move along the direction that it was, and that the team wants. Then the quicker they show it, the least we'll lose, but time is of the essence, and very quickly so I'm afraid. Worse of all, it's a vicious circle (the more we lose, the more people will move away).
      Please, please react quickly and make people feel comfortable with commitments.

      posted in SketchUp Discussions
      M
      Michaelv
    • Toolbar; entity info; layers

      This is the weirdest behavior. I wonder if anyone noticed before.

      On a Mac SU 8M3 but I don't know if it did before this version or not.

      I have all my toolbars that load at startup.

      If BOTH windows "Entity Info" and "Layers" are also opening at Startup, it takes my toolbars away (not all of them, only the one on tb.restore I think, but most of them).
      If EITHER window is open during restart, but ONLY ONE, it all works fine.
      If the "layers" window is open or close, makes no difference. But if Layers is open and then entity info is open, next startup, toolbars are gone again.

      So toolbars become unchecked upon restart when "entity info" is open AND "layers" is open too. And that is the only condition.

      Now if i open the toolbar again with both windows open, everything is fine and if I relaunch still with both windows open, then I don't loose any toolbar.
      However if I close and reopen one of the window, I loose the toolbars again (bby loosing I mean they become unchecked)

      So if the toolbars are checked and both windows are open as a normal state, it only becomes true once "entity info" is closed and reopened.

      I didn't try with any other windows.

      posted in SketchUp Bug Reporting sketchup
      M
      Michaelv
    • RE: Getting the "circle steps" ???

      @tig said:

      My "ArcCurve-set_segments" tool lets you change the segments of selected Arcs, just as you could using Enity Info on each one... you are also bound by the same limitations - e.g. you can't change the segments if the Arc is part of a 3d object...

      Argh, that's exactly what I was envisioning to do (a 3D object application). Well it makes sense that it cannot be done on the volume by changing the segments of the generating geometry. I didn't think of that.

      Thanks for the answers.

      posted in Developers' Forum
      M
      Michaelv
    • RE: Getting the "circle steps" ???

      Is there a way to batch change in a script?

      I.e. I run a script and the first action is to change all arcs and circle to a number of segment such that each segment is smaller than xxx.

      posted in Developers' Forum
      M
      Michaelv
    • RE: What is topology????

      @iichiversii said:

      Just another taught, or should I say question, if you were to create the same Model twice at the same scale, 1 made with tris and the other with quads would the number of polygons in the model created with tris be greater than the 1 made of quads, or would I be completely wrong? πŸ˜•

      I don't know but here what I think:
      1- It depends on the program, and the rules for creating the polygons
      2- It depends on what is important (level of resolution, where) for each type
      3- Why is the "greater" important? If it's to assess speed, it also will depend on speed of treatment, if you have less quads but they take longer to be treated, then no gain in speed right, so what is really the worry about the number?

      posted in SketchUp Discussions
      M
      Michaelv
    • RE: What is topology????

      As previously answered topology is the mathematical science that relates to shapes.
      Its benefit is that the development as a mathematical tool allows it to be applied systematically to what essentially we do in the 3D world of design, regardless of particulars (a sphere and a cube are topologically identical).

      Now the tri/quad issue comes from somewhere else I believe.
      First pure geometry: a plane can be defined with a minimum of three points: three are sufficient and necessary. Thus the trigons of meshes, as every elemental plane is defined by three points.
      A fourth point would have to be precisely aligned with the other three to be "in the plane"
      And that is why historically we had tris. Also when computer started to become powerful calculating machines a lot of complex interaction and calcualtion was easier in terms of three (Finite Elements, non linear functions, etc..)

      I am not sure why quads were introduced, and what benefits they offer over tris, so I will let other speak of that. My assumption is for simplification of calculation (time mostly) but there may be other reasons.

      In any case any quad element can always be decomposed into two tri elements. Not sure if the reverse is true (odd number of triangles ) but I presume that is the way to convert from one to the other.
      As far as I can tell, SU uses quads for cylinders, and converts them to tri as soon as you attempt to modify. (Draw a cylinder, show hidden, apply rotate tool to top face)

      posted in SketchUp Discussions
      M
      Michaelv
    • RE: [Plugin] WireTool (Catenary) (1.4.1) – updated 06.03.2013

      Thanks!

      A nice option (but I can do it when I get a minute) would be for the start to start either like you did (wire) or horizontal )like a cable that's more rigid, yet supported by posts.
      Toggle with alt/option

      I think all it takes is force the angle at point of attachment to be horizontal, and the equation would take care of the rest. But maybe not. πŸ˜„
      Never mind, I looked at it and the equation as it stands is for tension always parallel to the tangent of the curve, thus deflection equations (with rigidity, etc..) at the boundary would have to be used until that is the case. too complicated for the time being.

      Danke Shoen!

      posted in Plugins
      M
      Michaelv
    • RE: [Plugin] WireTool (Catenary) (1.4.1) – updated 06.03.2013

      Great Thanks.

      There was another catenary tool (and other geometric curves too) here:
      http://forums.sketchucation.com/viewtopic.php?t=41310

      I needed to make them like this though.

      See below however, the first segment is much longer and they become smaller as they go on the curve:


      Cats.jpg

      posted in Plugins
      M
      Michaelv
    • RE: Plugin beachballs seemingly randomly on first load

      @stuarth said:

      Hi
      I'm seeing a strange issue with a plugin I built in OS X. The first time it's run after loading SketchUp it will occasionally beachball. Not every time, and there's no special action taken on the first run that would explain its behavior. If it runs successfully the first time, it will run without problem again in the same session. Has anyone seen a similar problem? Where would you start to debug it?

      Mac "beachballs" differently regardless of your plugin.
      I have a lot of plugins and the time to load is "variable". Sometimes it beachballs for a while, sometimes not.
      It's almost like there is a cache somewhere, that is emptied after a while. It seems the first time I load SU in a while it takes more time, then it goes faster. Not as clear cut but kind of.

      So the correlation may not be with YOUR plugin.

      That said however, careful for loose ends as that will greatly lengthened the beachballing in general (make the short one long and the long one longer)

      posted in Developers' Forum
      M
      Michaelv
    • RE: Determine User Operating System

      I looked at that for a while as the ideal is to make scripts that work on both.

      However as of now I think there are enough differences, and quirks that at some point another choice has to be made:

      • Either one doesn't use any problematic known differences and the scripts can be "universal". Very possible with simple scripts with a bit of precautions.
      • Or just write a script and there will be a PC and a Mac version, at this point my preferred solution. It's not that big of a deal. If you use a lot of keyboard inputs, boxes, etc.., It's just easier IMO than writing the tests and all the exceptions.

      I'm not sure there is an explicit list somewhere of differences but to the best of my knowledge:

      • Keyboard input control AND HABITS
      • Input box labels (see my other post)
      • toolbar management
      • file management on Mac cannot have , it must be / (which I think works on both platforms)
      • web dialogs not sure if it's all fine
      • Some PC plugins guys do stuff with window 32 something (like external control or programming or something), etc..of course no such thing on Mac (Used for ruby console management for example, and some other plugins I've seen it in)
      • I'd be very careful about open GL stuff (not encountered yet, so not sure)
      • Cursor management also seems to be different (I think I've seen plugins where PC people use cursor and don't report problems, yet on Mac there is just no cursor (it still works, and one wouldn't know until you dig into the rb and see that Oh there was a cursor management for this plugin)
      • color and texture selection window.

      I may have forgotten a couple. But these are the one I look for systematically in making sure plugins work as intended on Macs (and change accordingly).
      And that list is not one direction. Sometimes the Mac is better or friendlier (toolbars), sometimes the other way as far as I can tell.

      posted in Developers' Forum
      M
      Michaelv
    • The Utter Mystery of the input box on Mac

      As some may have observed, the input box labels (in front of input fields) on Macs were often truncated.
      People writing plugins for PC with a nice input box, usually gave us half labels or similar symptoms.

      While I never looked into it deeply, I always assumed that the length of the labels were kind of fixed to a certain number, and usually by creatively abbreviating the labels I managed to fit enough info into it that it worked. Not great but it worked.

      Then this morning I realized that some plugins were able to challenge what I though was the hard limit (12 characters).

      So I went on a fishing expedition to try to figure it out.

      Let's say that so far the mystery deepens and the plot thickens.

      I can fit 33 characters. Yet the label is still truncated.

      So I tried different hypothesis (total number of characters for all labels, first field determines the possible width, spaces and other characters (:) play a role, numbers versus letters, size of selection plus size of label, uppercase versus lowercase) and I absolutely cannot make any logical sense of it.

      Every time I think I have reached a limit, it's not a hard one, yet there is always one of which rule completely escape reasoning (at least mine, and so far)

      So so far the best I can come up with is to write every label in the following manner:

      "Label for the field of value to be chosen --"

      You'll notice the block of two dashes at the end. The sole purpose of it is for it to be truncated on purpose, so that the rest of the text is accepted. That seems to be a key, to give something for the beast to feed upon.
      It seems to work pretty good with a reasonable length (but now 33 instead of 12, not bad)
      Sometimes it is truncated, sometimes not, sometimes it is truncated and leaving me with 33 characters, sometimes it is with less.
      There just doesn't seem to be any logic to it, but so far it helps. More to investigate.

      It's like someone that loved scrabble played a joke on us, and affected different weight to different letters and combination thereof, and that would be the limit, the total weight that we know nothing about. Maybe I should try all Q an Zs labels πŸ˜„

      posted in Developers' Forum
      M
      Michaelv
    • RE: [Plugin] 2.5D CAM Plugin 20121202

      @crash5050 said:

      I keep getting this error:

      Safety height is lower than top of part. Please correct.

      Are you working in mm? This version is inches by default, and the default safety height is 1 inch.
      So unless you enter a safety higher than your part it won't work. If working in mm and the part is let's say 40mm high, it requires a 41 inches default.

      posted in Plugins
      M
      Michaelv
    • RE: [Plugin] 2.5D CAM Plugin 20121202

      Awesome!

      I've been wanting to do a CAM plugin for a long time, just never got to it.
      I tried it on Mac, didn't work, but I'm fixing it.
      It was looking for my default text file, which of course doesn't exist since I never ran it, so it's stuck. Like I said I will debug on Mac and keep you posted.

      Michael

      posted in Plugins
      M
      Michaelv
    • RE: Here's another mystery to me

      @thomthom said:

      Matbe add_group returned false because it failed? not sure, but does it happen when you at donΒ΄t call initialize manually like you did before?

      Empty groups can dissappaer if some other operation is commited.

      The puts after the add_group call (in initialize or activate), recognizes it as Sketchup::Group but in the other method where I use it, it becomes a FalseClass object.

      Yes the empty group disappeared essentially, since it became a FalseClass object.
      It happens when I call initialize "manually" (which I take you mean within the activate method), when I set the group in the activate method, or whether initialize is called automatically.

      I suspect it is what you said: "empty group disappear when some other operation is committed", that seems to be the illogical logic of what is happening. πŸ˜†

      posted in Developers' Forum
      M
      Michaelv
    • RE: Here's another mystery to me

      Great. Thank you guys.
      I had a feeling it was a ruby method and that is why it was called first, I just couldn't find the info when I searched all my reference material and the web.
      Dan I will work on that, thee is more here that I currently understand but I will work at it until I get it. Thanks for the links.
      I got the part about initialize getting arguments passed by new, I already used that in some plugins. I also use a reset method when I need it.

      Now what about the group that becomes a false class when created in initialize or activate (which was my original question), and that only works if I create it just before I put something into it (in the same method).
      Any reason why it is so? Something else I didn't get?

      posted in Developers' Forum
      M
      Michaelv
    • RE: Here's another mystery to me

      Yes I did the reverse and it worked.
      So the initialize method is called first no matter what.
      (I declared @test in there)
      Then the activate method is called.
      (I only incremented @test, and now it didn't tell me it was a nil class).

      posted in Developers' Forum
      M
      Michaelv
    • RE: Here's another mystery to me

      OK I found out why I get two puts in the first instance.
      I was calling the initialize method in my activate method.
      As it turns out when the tool activates it calls both, so it was calling activate twice essentially. I confirmed with a incremental test, initialize was called twice, once automatically when the tool activates, and once when the tool "activate" method called it (itself automatically called when the tool activates).

      I never saw mention of this anywhere. And a search here returned nothing apparently.

      An interesting quirk however.
      If I declared my test variable (@test = 0) in the activate method, and then increment in the initialize method, it would tell me that @test was nil and it couldn't increment the nil class (+= 1 operator).
      Only when I placed it into the initialize method did it work (and then skipped for the second call of course).
      So declaring an instance variable in the activate method and the initialize method have different results, and a variable declared in activate, is overridden (even canceled if absent) in the initialize method. Did I miss something again?

      posted in Developers' Forum
      M
      Michaelv
    • Here's another mystery to me
      <span class="syntaxdefault">def&nbsp;initialize<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">mod&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">ents&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">mod</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">sel&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">mod</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">group&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">ents</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group<br />puts&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">.class<br /></span><span class="syntaxdefault">end<br /><br />def&nbsp;operation<br />puts&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">.class<br />@</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_curve&nbsp;</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">set&nbsp;of&nbsp;points</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end</span>
      

      Doesn't work and tells me:
      First puts tells me twice (yes twice, yet there is only one puts) that it's a "Sketchup::Group" and I only call the initialize method once.
      then the second puts tells me that @group is a "FalseClass" object
      but (just moved the @group declaration)

      <span class="syntaxdefault">def&nbsp;initialize<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">mod&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_model<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">ents&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">mod</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">sel&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">mod</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">selection<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />end<br /><br />def&nbsp;operation<br /></span><span class="syntaxkeyword">@</span><span class="syntaxdefault">group&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">ents</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group<br />puts&nbsp;</span><span class="syntaxkeyword">@</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">.class<br />@</span><span class="syntaxdefault">group</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_curve&nbsp;</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">set&nbsp;of&nbsp;points</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault">end</span>
      

      Works just fine, and confirms that @group is a "Sketchup::Group"

      I'm working around it,but anybody knows why or what I missed?

      posted in Developers' Forum
      M
      Michaelv
    • RE: Tricky Behavior project_to_line method

      @dan rathbun said:

      @michaelv said:

      No surprise. Have you read how the API modified the base Ruby Array class ??

      Yes I did and it says:
      Therefore, you can use the Array class in place of a Point3d or Vector3d as a way to pass coordinate values.

      @dan rathbun said:

      @michaelv said:

      OK.. put yourself in the shoes of the API programmer.
      If you pass a 2nd arg that is neither a Geom::Point3d nor a Geom::Vector3d, what is the method supposed to do ??
      It cannot read your mind.
      The API writers had to make a choice, and believed that most people will use a vector.
      The only other choice, would be to do typechecking on the 2nd argument, and raise a TypeError exception unless it was a Geom::Point3d or a Geom::Vector3d (even IF it was an valid Array that could be used to construct either one of the former.)

      I perfectly understand the conundrum, and I perfectly understand the mindset of the API programmer. Neither are in question here, nor am I asking anything to "read my mind".
      When it says an array can be used to create a point and that it works, and an argument can be a point3d or a vector (which incidentally I perfectly understand can also be a three values array), it's not my mind that has to be read but rather to conform on a logical level with its declaration.
      Now whether it doesn't do as well as first thought, i.e. in case of possible confusion it doesn't sort out which is which (of a vector or a point made of a three values array) is even fine too in the end.
      What merits to be pointed out, I thought, but maybe naively so, is that it precisely doesn't do that. That when faced with a choice, despite expectation, it always defers to one until it is entirely unambiguous that it is a point.
      Note however that for the first argument it works, just not the second.
      Me still being in the shoes of an API programmer, overlooking the fact that it would be way pretentious for me to do so, I can imagine that it could sort it out, or if not it could be mentioned as a caution. And that is all what is in question here.

      So all in all the issue is not with the fact that it does, which after all is understandable as you pointed out, but with the caution note about the exception to the rule.
      Either the rule has no exception in print and thus it works, or it does have exception and then it would be nice to be pointed out. Which again I thought I did.

      I apologize if it is obvious to most seasoned programmers, and is in fact is a result of my novice status. Nevertheless some other green plugin programmers might benefit from this mention or at least so I thought. Thanks for your comments in any case.

      posted in Developers' Forum
      M
      Michaelv
    • 1
    • 2
    • 3
    • 4
    • 5
    • 2 / 5