ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Entities Edge color apply

    7
    0 Votes
    7 Posts
    209 Views
    thomthomT
    @tig said: mat=e2.material > if mat > cname=mat.name ### OR .display_name ? > else ### NO MATERIAL > cname="<Default>" > end#if test for the existence of the material and then get it's name if it exists, if the material is ' nil'then there's no ' name' to get. #display_name should only be used to output the name of a material to the UI - not as an id. http://www.thomthom.net/thoughts/2012/03/the-secrets-of-sketchups-materials/#speaking-of-names8230
  • How to make a model follow with movetool

    3
    0 Votes
    3 Posts
    293 Views
    A
    @tig said: Let's assume model=Sketchup.active_model If you simply want to add an external SKP as a component use: defn = model.definitions.load(path_to_skp) where perhaps path_to_skp="C:/users/alecchyi/desktop/MyComponent.skp" This will ensure it's now loaded into the model. Then name=defn.name - just in case it's been given a different name from what you expected ? Then model.place_component(defn, repeat) If repeat=false then you get to add one instance of that component - just like the native tool, with 'move' built-in etc. If repeat=true then you get to place multiple instances... one after the other... If you want to place a component that's already loaded 'by name', then set name="MyComponentsName", then defn=model.definitions[name] before running the 'place_component' code... You can select an instance in code then run the Move tool on it, but that isn't what you asked?? i got it,谢谢
  • Exporting layers to Photoshop

    7
    0 Votes
    7 Posts
    419 Views
    I
    @brett mcallister said: I recommend you go read this PDF to get you started otherwise you will be tearing your hair out and nothing will make sense. http://www.autosketchup.com/ OK, I will. Thanks!
  • Keeping track of a face

    8
    0 Votes
    8 Posts
    225 Views
    TIGT
    When you pushpull a face the number of extra faces made in the model can be found - as discussed. Since the 'new face' [which from a user perspective is the 'original face' relocated along the face's normal] has the same normal as the original [which you can already have remembered in a reference] and none of the other new faces share this normal. It gets messy unless your new geometry is being kept inside a group [even temporarily] because the pushpulled result might coincide with one or more preexisting faces that have the same [or reversed] normal as the original face and thereby several new faceS made could have matching normals but the preexisting ones now subsumed into the pushpulled form will be missed in any before/after ents comparisons. Therefore making the new geometry in a group is highly recommended... you can pushpull, get the new face by matching normals, then intersect the face with the model's entities and re-get all faces inside the group with matching normals. Thus what's in the group mimics what would have happened without any grouping BUT lets you collect all of the newly made faces, should any be split by [potential] merging with existing geometry...
  • Sketchup 7 setting opacity with ruby?

    3
    0 Votes
    3 Posts
    246 Views
    thomthomT
    For materials it's Material.alpha. If you are drawing polygons to the viewport using View.draw then you need Color.alpha. The Secrets of SketchUp’s Materials - There is a section there "Material.alpha vs Color.alpha"
  • Reverse egde orientation

    15
    0 Votes
    15 Posts
    371 Views
    thomthomT
    Performance will suffer greatly if you add/remove/recreate geometry to organize your data instead of just sorting it. The more entities in a context the slower it will be. @tafkab76 said: And actually I just wanted to know how to reverse edges, Why do you want to reverse edges?
  • Observer triggers and validation methods

    8
    0 Votes
    8 Posts
    293 Views
    R
    Oops, pushed submit too fast. I got the 3dconnexionmouse working with their dll in VFP9 (Visual foxpro, don't ask me why except that i love that language) who in turn is sending - yes... via SKSocket - the values to Ruby-world, turning objects around. So yes, it is working. Now I like to learn how to set up COM events binding within ruby scripts. As I explained, ruby is new to me, but I start to love that language.... Cheers. R.
  • Get parent name and type of entity

    8
    0 Votes
    8 Posts
    1k Views
    K
    Thanks
  • Getting the status bar text

    3
    0 Votes
    3 Posts
    134 Views
    A
    Hmm... Thanks Tom! @thomthom said: No API. You might be able to use Win32 under Windows - but I have no idea for OSX.
  • Getting and iterating scene list?

    16
    0 Votes
    16 Posts
    316 Views
    Dan RathbunD
    @hpw said: Edit: Kernel.sleep does not work for that. Yes.. I guess we decided it would not, because the C++ engine cannot call observers, as the scene changes, etc.
  • Where to start?

    44
    0 Votes
    44 Posts
    780 Views
    thomthomT
    @rumcajs said: And where is definited UI? That's from the API - defined in C++. Look to the documentation: https://developers.google.com/sketchup/docs/ourdoc/ui
  • DOS paths

    6
    0 Votes
    6 Posts
    202 Views
    TIGT
    Most of the time I get also get 'full-paths' returned. Just occasionally they revert to the short DOS form. This can occur in the same model with the same 'other plugins' loading and the same paths used... It's not a big issue - often the short-path form works well anyway... and the posted code does return the full-path from the short-form if it's needed...
  • Uploading image file from Webdialog to php-script?

    6
    0 Votes
    6 Posts
    582 Views
    T
    I didn´t know about that possibility and it really seems to be just what I´m looking for. I will definitely give it try. Thanks!
  • XL parameters and dynamic components

    5
    0 Votes
    5 Posts
    190 Views
    X
    Many Thanks Dan, We'll give it a try!
  • Circle orientation other than Z_axis?

    5
    0 Votes
    5 Posts
    207 Views
    T
    It took a while for your medication to be absorbed vector = $pt2a - $pt1a edges1 = entities.add_edges($pt1a, $pt2a) circle = entities.add_circle($pt1a, vector, 1.inch, 16) base = entities.add_face(circle) base.back_material = Sketchup;;Color.new (255,200,100) #use RGB Color numbers base.followme(edges1) using my coded example: subtracting the 2 points creates a 3d vector which is normal to any circle.
  • Rosettacode.org down?

    6
    0 Votes
    6 Posts
    348 Views
    thomthomT
    @chris fullmer said: Could have been part of the godaddy.com hacking. http://it.slashdot.org/story/12/09/11/1747225/go-daddy-network-issues-not-hacks-or-ddos-caused-downtime
  • [Code] Open File Browser and Select File

    5
    0 Votes
    5 Posts
    281 Views
    D
    @jim said: This code opens a Windows Exlorer window with the given file selected. Is there a Mac equivalent? [image: dBQr_2012-09-1112.45.06pm.png] Tig's code does open the file in 'Finder' and highlights the file title > file=("/Some/Folder/MyFile.rb") UI.openURL('file:///' + File.dirname(file)) true Like this it 'opens' in the associated program for that type of file. i.e. TextWrangler opens ruby files on my system. > file=("/Some/Folder/MyFile.rb") UI.openURL('file:///' + (file)) true This will also open in 'Finder' > file = './Some/Folder/MyFile.rb' system("open -R #{file}") true note: returns true/false > file = './Some/Folder/MyFile.rb' system %(open -R #{file}) true note: also returns true/false shorthand works as well >open -R './Some/Folder/MyFile.rb'`` note: NO return of true/false Without the -R recursive flag it will 'open' in the associated app Again, it can be with or without the return, dependant on the call syntax. john
  • New to Ruby need some advice

    4
    0 Votes
    4 Posts
    103 Views
    TIGT
    OK FollowMeAndKeep [FAK]... makes a good basis...
  • Is this a ruby bug?

    5
    0 Votes
    5 Posts
    470 Views
    TIGT
    TT you are of course correct. Within '' only \' within a string and any final \\ are needed - for example \n doesn't apply as a newline. I've adjusted the original post to avoid further confusion
  • Adding Flipped Component Instance

    5
    0 Votes
    5 Posts
    177 Views
    TIGT
    He wanted to copy a selected component-instance [that happens to be mirrored] and was trying to get its definition and place an instance etc. Obviously he could reuse the original's transformation...*** I was trying to show him how he might copy "anything" that is selected, by grouping it. The code groups the selection, adds another instance of it and explodes the original. At that point if he knows the selection was the one component-instance then he has the option to explode its group, giving the same result as placing a second instance using the original's transformation, but if the selection is of something different - e.g. groups, geometry, mixed objects etc - he can choose to do other things with them within the safety of his group - e.g. non-merging geometry is preserved... ***For the avoidance of doubt here is how to duplicate an instance with the same matching transformation [i.e. position,rotation,scaling,mirroring etc]... Assuming that 'instance' is what's been selected/found and it has been tested and found to be a ComponentInstance... copy_of_instance = instance.parent.entities.add_instance(instance.definition, instance.transformation)

Advertisement