Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

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
  • 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
    553 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
    370 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
    366 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
    322 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
    3k 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: eBKC_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
    250 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
    3k 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
    264 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
    273 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
    927 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
    969 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
    169 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
    6k 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
  • Group in a group in a group... - transform point to outside?

    25
    0 Votes
    25 Posts
    3k Views
    N
    I think, I solved the problem - but I don't know exactly, what WAS wrong... I saw, by copiing the selected faces into a new group, not every face has the original direction. So, I changed my Face.copy function (I know, its not good to change the Face.class, but I will solve THIS problem later) in that way: outer_face = ents.add_face ov outer_face.material = "green" if outer_face.normal != self.normal outer_face.reverse! end Now, all the faces have the right direction and now the problem with the offset of the points is gone. But, to be honest, I have realy no idea, how these two problems correlate! And it doesn't help, to change the direction of these faces by hand - the problem stays! Just by copiing all the faces again, the problem of the offset is gone! Do you have ANY idea what's going on? I thank you sohhhhh much for all your support!!! You helped my realy a lot!
  • Problem with Tool.getInstructorContentDirectory

    2
    0 Votes
    2 Posts
    254 Views
    thomthomT
    For reference: http://sketchucation.com/forums/viewtopic.php?f=323&t=47399&start=15#p426668
  • Add_group slow on mac

    48
    0 Votes
    48 Posts
    20k Views
    D
    @gwd said: You can find the code on page 3 Hi, after a lot of digging, it appears that your test code will run in 0.8[1..3] seconds on both Snow Leopard and Mountain Lion with free or pro SU v6, v7 or v8, UNLESS you have either of these in your preference list %(#FF00BF)[<string>OutlinerController</string> <string>ComponentGBrowserController</string>] these have no ill effect, but add either of the others and you beach-ball... %(#00BF00)[<key>OpenInspectors</key> <array> <string>PagePanelController</string> <string>LayerPanelController</string> <string>StyleBrowserController</string> <string>SoftenPanelController</string> <string>EntityInfoController</string> </array>] They actually fork the main Thread into a timer loop to make the thumbnails and will do that even if the ruby has run before you open the Inspector. i.e run test code without, then zoom, orbit, make new geometry, etc... turn on 'Components' or 'Outliner' and you'll get a beach-ball. If 'Components' is run first 'Outliner' opens straight away. john
  • Retrieving parent definition

    13
    0 Votes
    13 Posts
    2k Views
    F
    @chris fullmer said: Frankn, just to clarify for myself, but you really want only components that have sub-components in them? or is it that you want a list of definitions whose instances are NOT sub-components? Hey Chris, I wanted to be able to find the parent definition of components with subcomponets that aren't in the model but still in the definition list. Hope that makes sense... but if it doesn't, basically the 2nd code that Tig shared is what I wanted to accomplish.

Advertisement