ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Duplicate "edit component" with api methods.

    11
    0 Votes
    11 Posts
    435 Views
    honoluludesktopH
    Thanks, fellows. Sometimes it's not as simple as I think, then after I'm done, its simpler then I think:-) Tig, That's neat, didn't know I could do that. The reverse face application requires the faces to be in Sketchup.active_model.entities. The faces are picked in terms of it's pixel location on the monitor. Maybe I first have to group the loose entities, then process all the groups, and components one at a time. Sometimes I write this stuff, just to see if I can. It doesn't take that much more work to open each component manually, and run the plugin Reverse_Backfaces each time.
  • Intercept UI::Command.new ?

    7
    0 Votes
    7 Posts
    304 Views
    PixeroP
    Very interesting. Awaiting your TT_toolbarTool...
  • ComponentInstance.explode

    5
    0 Votes
    5 Posts
    246 Views
    honoluludesktopH
    Thanks, gotit. Hope I don't forget!-)
  • Best way to get all Face's in model?

    25
    0 Votes
    25 Posts
    2k Views
    S
    @thomthom said: ............ 2. Exploding is very slow in SU. ( and if your script should fail at some point and halt - you're left with a broken model. ) ok! I changed my way and it seems work alot faster! (for my plugin converter 2 POV-Ray script). note: At this time I get only the color of the parent object(s) and not texture... def pov_find_faces(entities,tform,layername) entities.each do |entity| if entity.is_a?(Sketchup;;Face) pov_write_face(entity, tform) elsif entity.is_a?(Sketchup;;Group) if entity.material if entity.material.color $levelcolor[$level]=entity.material.color else $levelcolor[$level]=$levelcolor[$level-1] end if entity.material.alpha $levelalpha[$level]=entity.material.alpha.to_s else $levelalpha[$level]=$levelalpha[$level-1] end else $levelcolor[$level]=$levelcolor[$level-1] $levelalpha[$level]=$levelalpha[$level-1] end $level+=1 pov_find_faces(entity.entities,tform * entity.transformation,entity.name) elsif entity.is_a?(Sketchup;;ComponentInstance) if entity.material if entity.material.color $levelcolor[$level]=entity.material.color else $levelcolor[$level]=$levelcolor[$level-1] end if entity.material.alpha $levelalpha[$level]=entity.material.alpha.to_s else $levelalpha[$level]=$levelalpha[$level-1] end else $levelcolor[$level]=$levelcolor[$level-1] $levelalpha[$level]=$levelalpha[$level-1] end $level+=1 pov_find_faces(entity.definition.entities,tform * entity.transformation,entity.name) end end $level=$level-1 #UI.messagebox($level.to_s) end
  • Recursive print_group_tree() help

    12
    0 Votes
    12 Posts
    494 Views
    honoluludesktopH
    tt, This recursive stuff really works! Below drills down into component instances. Now, on to add groups. def get_ci(ci_array) entities = Sketchup.active_model.entities entities.each do |ent| if ent.is_a? Sketchup;;ComponentInstance ci_array.push ent end end return ci_array end def explode_ci_array(ci_array) ci_sub_array=[] ci_array.each do |ci| if ci.is_a? Sketchup;;ComponentInstance ci_sub_array=ci.explode end end return ci_sub_array end ci_array=[] found = false while found == false ci_array=get_ci(ci_array) ci_array=explode_ci_array(ci_array) if ci_array[0] == nil found = true end end
  • File access speed

    9
    0 Votes
    9 Posts
    376 Views
    honoluludesktopH
    All this time I labored under the belief that only old programs up to Win98 ran in the command window, and didn't ever try.
  • Get_datfile_info

    2
    0 Votes
    2 Posts
    182 Views
    thomthomT
    The file seem to be a config file of SU. @unknownuser said: // NOTE TO USERS: Making modifications to this file is not recommended as it will be overwritten // each time an upgrade is installed. I don't see much useful info in it for us... Possibly it could be used to brand SU - but as the file warns - it'll be overwritten upon SU updates...
  • Small face fails

    5
    0 Votes
    5 Posts
    335 Views
    S
    @jim said: You may be able to use a PolygonMesh instead of adding each Face. The mesh will also be faster to create than individual faces; but which is better depends on your goal. See also: http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#add_faces_from_mesh http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#fill_from_mesh Yes I thank you, but I am working about some interfaces between SketchUp and other CAD system. At this moment I am unable to find the unique criterion that SkUp uses to dispense the order of the ponts in the mesh. Especially about faces edited by subtraction of other faces or with holes. The mesh is really difficult to decode because the vertexes seem to hop and to return using a lot of different combinations. This is really laborious and so I use to split triangular faces, that in CAD is a 4 vertexs faces with a duplicated vertex, or, where it'i possible, a couple of SkUp triangles that are a unique (cad) 3DFACE. Anyway I thank you very much, because I'll to import also textures, and I will need of the meshes also, I fear... Excuse my bad english..
  • Manipulate a ruby from command line?

    11
    0 Votes
    11 Posts
    493 Views
    M
    ah, OK cheers Jim. It looks like it will be possible one way or another! now I know its possible, time to hunt down someone with the capabilities Thanks a lot for the help, Tom
  • Groups to components plugin ploblem

    8
    0 Votes
    8 Posts
    329 Views
    thomthomT
    hmm... that can be a problem with symmetrical objects like this - there are several possible ways to orient them...
  • Help with ruby

    4
    0 Votes
    4 Posts
    2k Views
    A
    My previous ruby file didn't even have the ./ to delete.in that script... tried for days to make it work. Cleared up now with this one ..Many Thanks :O)
  • Get objects at specified poitn

    11
    0 Votes
    11 Posts
    477 Views
    Chris FullmerC
    Good question, hopefully soon. Now we'll have to add a version check to make sure people are not running SU 8, original release. But that's ok, the fix will be well recieved.
  • A clone of an active_view.camera

    9
    0 Votes
    9 Posts
    309 Views
    TIGT
    But it is a transient setting! If you click in the view it evaporates... It would be good if it were accessible but it is pretty transient...
  • Close webdialogs on File-New/Open

    14
    0 Votes
    14 Posts
    590 Views
    Dan RathbunD
    Agreed. I logged several Feature Requests for MDI support (new methods) in the API, including a Models collection.
  • Face Me

    9
    0 Votes
    9 Posts
    371 Views
    thomthomT
    What makes it more troublesome is that the documentation doesn't mention bugs that appeared in the various methods in the various SU versions.
  • Vector transformation ... whut?

    3
    0 Votes
    3 Posts
    255 Views
    thomthomT
    Never - my brain was being silly.
  • Problems saving user preferences

    8
    0 Votes
    8 Posts
    381 Views
    honoluludesktopH
    Wow, Sketchup.read_default and Sketchup.write_default were easy to implement. Attaching the defaults to individual models can also be advantageous, and I will have to think about the best way to save user defaults. Thanks guys. a_values=[] s_value="" s_value = Sketchup.read_default "honoluludesktop","values","None:Inches:Model:to Faces:by Number" a_values = s_value.split(":") . . results = inputbox prompts,a_values,enums,my_file_name+" Options" . . a_values = ["None",scale_sel,origin_sel,dface_sel,material_sel] s_value = a_values.join(":") result = Sketchup.write_default "honoluludesktop","values",s_value
  • Face loop vertex order?

    15
    0 Votes
    15 Posts
    2k Views
    honoluludesktopH
    TIG, As you suggest, I will work on this and post what I find. Thanks.
  • Transformation in scale

    6
    0 Votes
    6 Posts
    313 Views
    honoluludesktopH
    tt, and cf, Thanks. Got it to work as follows: my_definition.entities.transform_entities(t,my_definition.entities.to_a) Off and on for 4 days, this has got to be the longest time I've spent getting a single line of code right. Hopefully I'm getting better.
  • Launching Google Sketchup from external application

    2
    0 Votes
    2 Posts
    380 Views
    thomthomT
    http://forums.sketchucation.com/viewtopic.php?f=180&t=30000

Advertisement