🏒 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • How about a ruby to apply a 3D texture/component?

    27
    0 Votes
    27 Posts
    777 Views
    R
    @thomthom said: @rickw said: (which will be increasing by one in November) Congrats man! Thanks! It was quite unexpected, but also very welcome.
  • Sketchup cursor resources?

    8
    0 Votes
    8 Posts
    231 Views
    jeff hammondJ
    fwiw, on mac, the icons are in the app contents.. right click SketchUp.app/Show Package Contents/Contents/Resources
  • Javascript Namespaces?

    4
    0 Votes
    4 Posts
    109 Views
    AdamBA
    Well the DOM (document object model) of a HTML page is rooted from an instance of document and everything hangs off that. If you have multiple WebDialogs, you have multiple DOMs, each with their own parts hierarchy which have names which are 'within' the scope of just that document. So, Google "DOM" for more info, but its basically just a hierarchy of named & typed parts. Adam
  • Tangent Line?

    12
    0 Votes
    12 Posts
    1k Views
    Dave RD
    Thanks Bruce. Now we need someone to figure out how to do that automatically with a plugin.
  • KeyBoard observer?

    11
    0 Votes
    11 Posts
    379 Views
    Chris FullmerC
    I'm guessing you already have a tool observer set up or something? You've already figured out how to keep track of the previously used tools, right? If so, Lets say you have a global variable that holds an array of all the last used tools - $previous_tools Also, maybe you need a menu item for "Set Shortcut Key". This is for the user to tell your script what key they have assigned your script to (it might save the value to an external text file or a registry entry would be better). So perhaps they assign it to "t", your inputbox could create a global variable $previous_tools_shortcut = "t" Now make a tool with the onKeyUp method in it. It compares the onkey up to $previous_tools_shortcut. And it also implements its own timer feature. So you can watch the time between keystrokes. So if they press the dhortcut key 1 time, it just selects $previous_tools.last. If they press it twice within a specified time limit (.5 seonds or less) then it will select $previous_tools[length-1], press it three times within 1 second, it selects the $previous_tools[length-2] tool. That is how I think I would go about it. But that assumes you have an array of the previously used tools, and it also requires the user to input the shortcut key that they assigned to your tool. Chris
  • What does Entities.transform_by_vectors actually do?

    4
    0 Votes
    4 Posts
    232 Views
    PixeroP
    Thanks for the info. Might come handy for an update of my align script.
  • Shift WebDialog Focus to SU?

    11
    0 Votes
    11 Posts
    715 Views
    thomthomT
    @adamb said: But thats correct behavior if I unwind an operation to just before the Tool was used..No? Nah. Not IMO. I find it very annoying. I want to keep the focus on the viewport.
  • [HowTo?] Edit Components (or change "active level")

    6
    0 Votes
    6 Posts
    2k Views
    TIGT
    model.close_active ### will jump you up one 'level' out of the current edit session. You can only go in the direction of the base model... You can repeat x(model.active_path.length) to close the edit back to the base model 'level'. Alternatively... model.active_path[model.active_path.length-2] ### to get up 1 level, or use -3 for 2 levels etc... All of these physically close any current edit sessions... If you just want to do something with the entities found at a particular 'level' then just use... parent=model.active_path[model.active_path.length-2] i.e. the container of the current edit session's instance/group parent_entities=parent.definition.entities if parent.typename=="ComponentInstance" parent_entities=parent.entities if parent.typename=="Group" etc... there's no need to close edits etc, just specify the actual entities-set to work on...
  • Edge.split Point3d not working as expected?

    4
    0 Votes
    4 Posts
    261 Views
    thomthomT
    It does sound like it should fail if it's not on the edge. I would have expected a nil return like many of the other functions when they fail.
  • Please can someone check this plugin.NEW VERSION

    12
    0 Votes
    12 Posts
    466 Views
    TIGT
    Sujikai refers to something that's diagonal, oblique or bracing - e.g. in patterns - like on sword hilts - or perhaps in stud-wall bracing, as it appears here... Exactly what is this script trying to do ? If we knew that, then we could edit out the rogue 'Japanese characters' and see how it might work as hoped...
  • Calculate a curve that fits between two edge?

    14
    0 Votes
    14 Posts
    467 Views
    thomthomT
    Giving a radius to two edges is only one minor function. I ended up getting the linear_combination of the two edge's vectors, then use trigonometry to calculate the centre point on that vector. It'd be interesting to have a look at K_Tools.rb to see how it's done there. My trigonometry is very rusty so I'm not sure if I'm doing it the best way.
  • Beginning Ruby Tutorial

    16
    0 Votes
    16 Posts
    728 Views
    Al HartA
    Chris, Thanks for making a ruby tutorial. Its always inspiring to look at someone else's code. Here is a version which use a hash instead of arrays to count all entities types; def count_entities model = Sketchup.active_model entities = model.entities count = {} # start a new hash entities.each do |e| stype = e.typename # start new count, or add 1 to existing count count[stype] = count[stype] ? count[stype] + 1 ; 1 end#loop sorted_keys = count.keys.sort sorted_keys.each do |key| printf("Total %-12s; %5d\n", key, count[key]) end#loop return nil end#def The weird line: count[stype] = count[stype] ? count[stype] + 1 : 1 would be easier to read as if (count[stype]) count[stype] = count[stype] + 1 else count[stype] = 1 end#if Keep up the good work
  • Test if a point is between 2 points?

    7
    0 Votes
    7 Posts
    251 Views
    Chris FullmerC
    Very good to know. I've never tested anything like that, but I had a suspicion that it is true. Thanks for thiking of a method that uses SU native natives. Mine involved an algebraic formula being applied to each x,y,z coordinate, and if it got fed zero's would return NaN or Infinity, so I also had to teste everynumber before it passed through. In the end, it was quite long and I'm sure it was slow. I've got it set up where I could do a time test on it, Id be interested in seeing how much faster it is. Thanks Fredo! Chris
  • Lisp getpoint (not finished!)

    9
    0 Votes
    9 Posts
    612 Views
    M
    I thought about that work-around method... I will use it until something better... Thank you Chris!
  • Method library?

    3
    0 Votes
    3 Posts
    186 Views
    Chris FullmerC
    I was leanin towards something like that too at first, but then when I remembered the [code] tag, I started liking that idea. Maybe a sticky that has a link to all [code] threads so its easzy to sort through them. I'm thinking a single thread might tend to have a method, then some posts and discussions, then another method, and some discussion, and on an one. And it might make it tricky to dig through 20 pages, with only 1 method per page or something. That is my onoly concern with doing a single sticky thread. I have a bezier method I'd like to post. It requires as input: point1, handle1, point2, handle2, segment_count. Thats it, and it returns an arc object, or with a tweak it just returns an array of Point3d objects. So thats one method I'd like to post. Another is one that will take any series of connected edge segments and return them in an ordered array of points from the beginning to end. Chris
  • Using the Registry - Any Gotchas?

    5
    0 Votes
    5 Posts
    272 Views
    J
    Thanks Adam, I was actually using the following: str.gsub!(/\\/, '\\\\') But I think simply changing it to '/' is a better solution, and will modify inputbox.rb I suppose it's possible for someone to want to use \ for some other string, though. I'm also escaping double-quotes: str.gsub!(/"/, '\"') Thanks.
  • Swap between 2 lines

    12
    0 Votes
    12 Posts
    646 Views
    A
    No, but SWEEP 2 RAILS plugin will be very usefull for me!
  • Please install progressbar.rb

    11
    0 Votes
    11 Posts
    7k Views
    Chris FullmerC
    Hehe, yeah my scripts aren't nice enough to check if you have progressbar first. They just crash. Chris
  • Loft questions

    26
    0 Votes
    26 Posts
    4k Views
    pilouP
    @unknownuser said: in what program are you making those loft images? Moment of Inspiration (Moi) (just image colorisation is made in 2D prog for fun & variety I don't believe that SU can actually makes the same than Zbrush! There are 8 000 000 polys in normal way at level 7 of subdivision ! And it just one object! So when you will make many objects in the same time SU will freeze before
  • Checkerboard painting ? (or selection)

    18
    0 Votes
    18 Posts
    3k Views
    A
    @unknownuser said: Not yet released but you can try this one lol, come on, it was already said that Random Painter isnt able to create a checkbox pattern, since, of course, its randon

Advertisement