⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

Subcategories

  • No decscription available

    20 Topics
    462 Posts
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • One Submenu for many plugins

    4
    0 Votes
    4 Posts
    817 Views
    Dan RathbunD
    Although this should work.. because of current API bugs. It will not. See thread: http://sketchucation.com/forums/viewtopic.php?f=180&t=49912&p=449979#p449362
  • Get Point3D from place_component

    6
    0 Votes
    6 Posts
    428 Views
    F
    @dan rathbun said: Now... model#place_component() (1) The API dictionary is incorrect, it does NOT return nil, it returns a reference to the active_model which is basically frivolous, but does allow call chaining. We have logged an API doc typo on this, as well as asking for something more useable to be returned (especially in the case of multiple insertions when the 2nd argument is true.) (2) When the 2nd argument is false, and only 1 instance is inserted, model#place_component() works the same as the native tool, ie: the selection is cleared, and the newly placed component instance's reference is pushed into the selection (as it's only member.) So you can get it's insertion point as discussed in the post above. FYI ... When the 2nd argument to model#place_component() is true, and multiple instances MIGHT HAVE BEEN inserted, the model's selection object IS NOT CHANGED. If something was previously selected, it still is. If the selection was empty, it will still be empty. Dan, thank you for you for your two posts which are very helpful. I would have ticked them both as 'resolve' but I had already done this for a previous post and 'the system' wouldn't allow me to tick more than one post as a 'resolved' post. I will be trying your ideas soon. Thanks again. Francis
  • Scale along custom axis

    10
    0 Votes
    10 Posts
    2k Views
    Dan RathbunD
    If that works (and likely it does 'cause it's Adam talking,) can it be moved to the first post, retitled as a snippet topic, and comments inserted explaining WHY it works ?
  • SketchUp Engine

    7
    0 Votes
    7 Posts
    1k Views
    AdamBA
    Yes. But on a Mac, use Activity Monitor and click "Sample" to see this.
  • Writing and reading Marshal data to attributes?

    9
    0 Votes
    9 Posts
    2k Views
    thomthomT
    That will be troublesome. Even if you create your own wrapper class that takes a Sketchup::Material into a class that does support marshalling you have the issue of the Ruby API not being able to set the Colourize property. And you'd have to figure out a way to handle the texture, as you say. You could write that Base64 encoded or something, but you cannot restore it to reference the original filename. Why do you need to store the whole Material object?
  • Ruby (eval):1: warning: Float out of range

    15
    0 Votes
    15 Posts
    3k Views
    D
    Dan, I made some progress making this importer a little more usable. Pleas see if you have more advice for me. P.S. I deleted all the old versions from this thread and updated the top thread's file. Thank you. David.
  • Make all selected unique script?

    7
    0 Votes
    7 Posts
    643 Views
    ApofisyA
    @tig said: ### Makes all selected instances unique and edits names... > ### Copy all of this text into a text-file called something like > ### makeallselectedunique.rb - in the Plugins folder... > ### type 'makeallselectedunique' in the Ruby console > ### it works on current selection > def makeallselectedunique() > ints=[];Sketchup.active_model.selection.each{|e| > if e.typename=="ComponentInstance" > e.make_unique ### make instance unique > ints.push(e) ### keep list of these instances > end#if > }#end each > ints.each{|e|name=e.definition.name > ### name with '#nn' on end, e.g. ABC#2 > prefix=(name.split("#")-[name.split("#").last]).to_s > prefix=name if prefix=="" > ### e.g. ABC > suffix=name.split("#").last.to_i ### e.g. 2 as integer > suffix=1 if suffix<1 > ### check all extg defs for possible new name > Sketchup.active_model.definitions.each{|d| > suffix=suffix+1 if d.name==prefix+suffix.to_s > ### e.g. ABC2 exists so try to make it ABC3 etc > } > newname=prefix+suffix.to_s > e.definition.name=newname ### renames definition > puts name+" >>> "+newname ### put a # in front of this line to stop console printout > }#end each > return nil > end#def Hello, i need a similar script but i don't know ruby i need to edit all names but not all definitions and just add a counter after the name like this: furniture.Floor.01,furniture.Floor.02,furniture.Floor.03,...,furniture.Floor.10,furniture.Floor.11,furniture.Floor.12,.... where name is the name of the object. Also if there are some object like furniture.Floor.01 and furniture.Floor.02 for example the script can start to add counter from 03. Can you edit your script with my requests please? I'm waiting for your reply, thank's.
  • No tabs possible in text?

    7
    0 Votes
    7 Posts
    453 Views
    liquid98L
    Thanks guys. It seems this is a PC only bug. So far no reason to buy a mac..
  • Find the position of a group in the active context

    6
    0 Votes
    6 Posts
    446 Views
    D
    I solved the problem, the key was to use "mod.edit_transform.origin" I leave the code in case anyone needs it one day mod = Sketchup.active_model sel = mod.selection parert_origin = mod.edit_transform.origin entity_origin = sel[0].transformation.origin distance = entity_origin-parert_origin tr = mod.edit_transform.inverse distance.transform tr
  • Web dialog and cookies on Mac

    7
    0 Votes
    7 Posts
    395 Views
    S
    @dan rathbun said: Would it easier to use the LocalStorage interface instead of cookies ? Dan, Thanks for the tip! I tried it, and it not only works more portably, it is cleaner code. Steve
  • [Code] Material.names to Webdialog.

    55
    0 Votes
    55 Posts
    4k Views
    jolranJ
    @unknownuser said: Isn't that just because the model in your screenshot are mainly thin edges? Yes, thats true. That the components that has faces and materials come out better. Increasing the contrast on those thumbs too much make things worse. So I have found an acceptable between value around + 45 contrast, that all thumbs can benifit from. How to apply it is a different story I can live with the bad aliasing... One can affect some color when saving the component, playing with styles. But havent found any settings that gives me what I want. At it only seems to affect face.materials. @unknownuser said: And is that thumbnail in 100% scale? Thumbs are 100% scale. They look the same in Photoshop. From PS: 80% increase in contrast look really good on edges. [image: contrasts.jpg]
  • Rescue Exception

    15
    0 Votes
    15 Posts
    3k Views
    Dan RathbunD
    OK I understand ... Visual Basic: CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator
  • Will this work on Mac OS?

    4
    0 Votes
    4 Posts
    297 Views
    D
    hi, you may need a java version test, as mac no longer ships with it pre-installed, it does however recomend installing as part of the start-up sequence. so, from ruby console java_version=(`java -version 2>&1`).split("\n")[0].to_s.split[-1] "1.6.0_37" john
  • How to save dxf file with embedded thumbnail image?

    9
    0 Votes
    9 Posts
    4k Views
    Dan RathbunD
    Could be a job for ImageMajik ?? Embedding encoded thumbnails INTO the file, will bloat the filesize.
  • API Methods by SU Version - 2012 year end edition

    5
    0 Votes
    5 Posts
    313 Views
    Dan RathbunD
    FYI: two other threads on send_action() Sketchup.send_action() : Arguments to Sketchup.send_action arguments: Mac vs PC I have begun a reference spreadsheet (in ods format) on the many actions (many not documented elsewhere,) but it is not fully complete.
  • Easy way for offset of a face

    5
    0 Votes
    5 Posts
    374 Views
    N
    Thanks a lot Chris! Okay, no problem, then I start with my ideas! In my case, I have always faces with z = 0. So, I think, it should reduce the complexity of my project I will public my solution for other people...
  • Two identical faces, but show just one

    10
    0 Votes
    10 Posts
    1k Views
    N
    At first at all, thank you very much for all your help! I will try it at weekend. @thomthom said: But... why do you even have two faces overlapping anyway? It's generally something to avoid in any 3d modelling. Following situation in my plugin: you have a model you choose a part of this model, which you like to get milled (for example a pocket) after you have choosen it and add it to the "milling list", my plugin will copy this choosen faces into a hidden group when you click on the list, the "to be milled" faces (I collored it green) will be shown with the help of the hidden faces, the plugin is independent of the real model => so, before calculating the GCode, the user is allowed to change the model itself I hoped, I could explained my situation understandably
  • Refer to entities from code

    19
    0 Votes
    19 Posts
    1k Views
    D
    wow thanks Dan, I will take some time to study this code, worth but me several questions arise, I will try to solve the most I can on my own, thank you very much (google translator)
  • [Question] Manually Setting Instructor Content

    3
    0 Votes
    3 Posts
    215 Views
    Dan RathbunD
    Yes.. be more clear. Is this YOUR tool, any author's tool, or the native tools ? If it is YOUR tool, then no problem.
  • Ruby Version for Sketchup 8.0 M1 on Mac ??

    41
    0 Votes
    41 Posts
    7k Views
    S
    WARNING Make sure to restore SketchUp to its distribution Ruby (1.8.5) before installing a version update to SketchUp! Otherwise the SU install will overwrite parts of your system-installed 1.8.7 Ruby and make it unusable (DAMHIKT)! Steve

Advertisement