ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • How get the Group object contains the particular entity

    2
    0 Votes
    2 Posts
    874 Views
    TIGT
    @wikii said: Hi all,I want to get the Group object that contains the selected objects. such as: > First I select a Group > Sketchup.active_model.selection[0] => <Sketchup;;Group;0xb79eb20> > I open it ,and ,select an edge > Sketchup.active_model.selection[0] => <Sketchup;;Edge;0xb79ea48> > Now I want to get the Group object contains '<Sketchup;;Edge;0xb79ea48>' ,that should be '<Sketchup;;Group;0xb79eb20>'.Using 'parent' methods,it can't work at all. > Sketchup.active_model.selection[0].parent => #<Sketchup;;ComponentDefinition;0xb79e958> > Please help me. So far so good, you have the ComponentDefinintion. Let's say you set it to 'cdef', then cdef.instances[0] will return the group you want - there's only one instance of a group's component-definition - I know it's convoluted !!! NOW you have the parent of the edge... = the group ?
  • Xray ruby component?

    7
    0 Votes
    7 Posts
    1k Views
    fredo6F
    Wireframe is even simpler, as you just hide / show the faces The big problem for Xray, is that I don't find any way to create a material from an existing one, or to assign the new one the same texture as the old one, especially with SU v6, as the JPG are now embedded in SKM files. So the macro works without texture at the moment. Does anyone see a solution?
  • Extension .RBS..What?

    3
    0 Votes
    3 Posts
    670 Views
    Dave RD
    RBS files work as RB files. They are Secured or Scrambled by the author but SketchUp can still read them. There should be no reason to change the extension. Which plugins did you download? Knowing that will help us get you going with them.
  • How to save a component definition

    6
    0 Votes
    6 Posts
    1k Views
    Al HartA
    Yes. @tig said: Or put another way - you want a method something like: ComponentDefinition.export or ComponentDefinition.save_as ...
  • Export with ruby to jpg

    3
    0 Votes
    3 Posts
    1k Views
    T
    View.write_image. Todd
  • Make3D - could it be done with ruby

    8
    0 Votes
    8 Posts
    1k Views
    N
    Why automate? It can save time, if it works reasonable well. I would not expect that automated mapping can do all what you can do with manual photo match, but I am fairly confident that if make3D would be made as plugin it would find users. Anyhow... code is there.
  • Password protect locked component / group

    11
    0 Votes
    11 Posts
    3k Views
    Al HartA
    Also, some "search engines" aggregate content by trying to provide a better way to serach it and find it, and, of course, perhaps adding their own advertising to the search pages instead of the Google Ads which you have to suspect will appear someday.
  • Webdialog: html and rb example

    6
    0 Votes
    6 Posts
    1k Views
    T
    Try this search argument: http://groups.google.com/group/Ruby-API/search?group=Ruby-API&q=webdialog&qt_g=Search+this+category Todd
  • Webdialog and active_model

    6
    0 Votes
    6 Posts
    1k Views
    C
    Hello Koos, I understand your concern about publishing your code. I'm sure you can help me in my other post. http://www.sketchucation.com/forums/scf/viewtopic.php?f=57&t=6543&p=41849#p41849 Maybe you could have a look there and put me on the rails? I'v solved some of my problems nut still have no idea how to put more text boxes in my form and retrieve each single variable into sketchup. I feel this : dlg.add_action_callback("ValueChanged") {|d,p| $avariable = p } is to short to do so because i can retrieve just one varaiable. Isn't it? Do not hesitate to reply in the other post so that I can end this one. Thank you Koos.
  • BOOKMARK YOUR TOPICS

    3
    0 Votes
    3 Posts
    784 Views
    GaieusG
    You are right, Al, the Ruby section has been all transferred for long (credits go mainly to Eric/Boo...)
  • Adding dimensions from Ruby

    5
    0 Votes
    5 Posts
    804 Views
    Al HartA
    (I think that was the thread I was thinking of...) It doesn't qualify as a Ruby script because it depends on two pre-made components - one for horizontal dimensioning and one for vertical (you could rotate for the vertical, but I chose to place the vertical dimensioning outside the lines.) Also, the .rb files assume another routine to locate components. ($component_folder) But I will share the code if any other ruby developers want to use it. def hdim(ploc, len) model = Sketchup.active_model entities = model.active_entities sname = "CS_hdim-240" clen = 240 # size of component in inches # see if we have already loaded the component definition = model.definitions[sname] if (definition == nil) skp_name = sprintf("%s\\%s.skp",$component_folder,sname) definition = model.definitions.load(skp_name) end#def instance = entities.add_instance(definition, ploc) transformation = Geom;;Transformation.scaling(ploc, len/clen, 1, 1) instance.transform!(transformation) end#def def vdim(ploc, len) model = Sketchup.active_model entities = model.active_entities sname = "CS_vdim-240" clen = 240 # size of component in inches # see if we have already loaded the component definition = model.definitions[sname] if (definition == nil) skp_name = sprintf("%s\\%s.skp",$component_folder,sname) definition = model.definitions.load(skp_name) end#def instance = entities.add_instance(definition, ploc) transformation = Geom;;Transformation.scaling(ploc, 1, len/clen, 1) instance.transform!(transformation) end#def Let me know if you want to components as well. They both have the dimension lines pointing to 0,0.
  • Cutlist.rb writes to wrong direcctory

    2
    0 Votes
    2 Posts
    544 Views
    TIGT
    @tim said: Although the cutlistandmaterials.rb creates an amazingly useful spreadsheet it writes it to a realyl dumb place; not by design but because the filename is constructed by namecsv = mpath + "/" + mname + "-CutList.csv" and 'mpath' is found with mpath = Dir::pwd Sadly on my Mac this appears to prodcue an empty string since the .csv file is always written to the root directory and not to somewhere useful like, say, the same directory that the model came from. Is the Dir::pwd method simply wrong on a Mac? Is the plugin using the wrong way to find the path? Change the line... mpath=Dir;;pwd to... mpath=model.path.split("\\")[0..-2].join("\\")if model.path That will save the list in the same folder with the model, using it's name+suffix - if you haven't saved the model then it's 'root' again...
  • Camera space question

    18
    0 Votes
    18 Posts
    1k Views
    PixeroP
    See this thread: http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=1528&p=41330#p41330 And once more, thanks for helping!
  • Ruby causes crash

    4
    0 Votes
    4 Posts
    732 Views
    TIGT
    It's an infrequent and usually non-repeatable bug in SUp that Mirror.rb seems to encounter now and again. Some set ups and systems seem more prone than others. I developed this version of Mirror and the BugSplat comes when you mirror collections of certain types of geometry that aren't grouped - can't see a common denominator AND I've never had one***. You can try grouping before mirroring and exploding afterwards and see it that helps. It seems to be something to do with the way/order that SUp processes grouped objects - Mirror.rb temporarily groups your selection, makes the copy and mirrors it and then if desired deletes the original - it's often this deletion can lead to these rare splats. There is a recent discovered clash between the Demeter.rb script and Mirror.rb (and Grow.rb) because Demeter has an aider-plugin called blankslate.rb and that seems to rewrite a bit of the way SUp+Ruby processes groups. This causes a crash every mirror+delete-original so it's unlikely to be your cause since it's intermittent ? ***I HAVE experienced that ! Until someone in SUp+Ruby fixes the flaky interpreter and group manipulation coding then occasional splats might randomly occur. So save beforehand and try pre-grouping what you are about to mirror - please let me know if you get any joy...
  • Idea: View Cropper?

    7
    0 Votes
    7 Posts
    626 Views
    GaieusG
    @cadfather said: ...btw Fletch, thanks for all the KT help you have been giving - i have been a silent recipient of your wisdom for some time. Me too...
  • Question about &quot;open&quot; groups.

    22
    0 Votes
    22 Posts
    2k Views
    T
    I did check with Google on this topic yesterday, and they see it as a flaw. Todd
  • North angle and GS6 free version

    2
    0 Votes
    2 Posts
    619 Views
    W
    It's very useful! And,it works good in SU 6 PRO!
  • Moving an object by center point to an object.bounds.center

    4
    0 Votes
    4 Posts
    710 Views
    J
    Hi TIG and Fredo Thanks for your input. I'm thinking about to try and use 3dtext instead. But until further I'll have a workaround where I modify the position by x,y, z axis. This is not perfect, because the texts don't have the same width. Thanks Jorgensen
  • Sketchup drawing lock

    6
    0 Votes
    6 Posts
    843 Views
    GaieusG
    I used to play with the trial version (you should try the trial for sure). Some positioned materials didn't come through but they may have been too deeply nested (Al told me later that I should explode groups/components prior to exporting).
  • Sketchup.active_model.set_attribute

    12
    0 Votes
    12 Posts
    923 Views
    J
    That should not be a problem, because I'm adding my own attribute: entity.set_attribute ("TM_area", "TM_ID", "TM_ID " + target.entityID.to_s) that I use to keep track of objects. Thanks Jorgensen

Advertisement