ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Where to find developers?

    7
    0 Votes
    7 Posts
    461 Views
    B
    Hello again. Just to let you guys know, I have posted a forum topic called "I wish to hire a developer" with a very brief description of my plugin. If any of you are interested, I can send you a more detailed description.
  • Check for existing material

    3
    0 Votes
    3 Posts
    298 Views
    PixeroP
    Thanks. Its working now.
  • [code] Win32 Moving/Showing/Hiding Toolbars and Dialogs

    91
    0 Votes
    91 Posts
    16k Views
    D
    @pcarret said: ...Is it possible to do hide minimize, maximize andclose buttonon Mac OS ? possibly, but not easily. I'm not entirely sure what your wanting to achieve... What exactly do you want to minimise/maximise? is it purely for yourself or do you want to use it in a Plugin? Some things can be done from Rudy, others by using AppleScript or by modifying the nib files... Outline what you want to do and I'll try and help... john
  • Plugin Developer Wanted ASAP

    5
    0 Votes
    5 Posts
    374 Views
    D
    hi jimmy, most people are enjoying xmas with family... you may snag someones interest on a visit if you supplied a working example... it wouldn't need to be your clients product, but a skp with representative scenes and a similar DC, either from scratch or from 3d Warehouse... I'm not one of the "great Ruby Developers in the forum" and work on mac, but I would have had a play with some ideas if it was easy to hide from the family... john
  • Sketchup Crash Webdialog

    17
    0 Votes
    17 Posts
    979 Views
    L
    the crash does exist. what is the solution?
  • File.writable? false for DOCUMENTS folder

    6
    0 Votes
    6 Posts
    415 Views
    thomthomT
    Ruby's file handling under Windows is frustratingly flaky. We have reported a number of issues to the Ruby developers and I'd encourage people to file whatever you find. I usually wrap file handling in a begin, rescue block instead of testing if a while is writable - simply because Windows file handling is unpredictable.
  • Arrange component names

    13
    0 Votes
    13 Posts
    776 Views
    M
    SDMitch (Mitch?), @sdmitch said: Tried your code and found two problems. if(reInc.match(cd)) needs to be if(reInc.match(cd.name)) Thanks for the catches. I edited & corrected the second post. I tested mine with a string array, not an array of cd's. Hence, no name prop. @sdmitch said: the prefix of the new name entered gets incremented as well. That's why you had the new cd name assign at the end of the loop. That's why I shouldn't change code after I've tested it... Thanks, Greg
  • Add column in SU file name

    8
    0 Votes
    8 Posts
    519 Views
    D
    @dan rathbun said: ...But how to do that for both OSX and Windows in the same format ? on a mac you can add tags to any file, but for the OP's request, why not just append the filename with a serial number? john
  • Reading out origins of nested components

    3
    0 Votes
    3 Posts
    358 Views
    X
    I was wondering if there was a way to do it without going through all parent origins as I feared that might become very complicated, I didn't think about doing it like that (recurse) though. Your solution is right on the spot! Also I didn't knew about the grep method yet, so thanks for that as well.
  • Extension rbz maker

    38
    0 Votes
    38 Posts
    4k Views
    TNTDAVIDT
    Problem solved thank you for your help
  • Glue a text to a face in ruby

    2
    0 Votes
    2 Posts
    396 Views
    TIGT
    You cannot 'associate' text with geometry at its insertion point, through the API. It has long been asked for... There are a couple of workarounds... Make it as 'flat' 3d-text [or normal Text] - make it inside a component definition, which has is2d gluing behavior, add_instance of it at the face.bounds.center point, then use instance.glued_to=face so it moves with the face...
  • Dynamic components double action

    16
    0 Votes
    16 Posts
    810 Views
    G
    I have now coded the dynamic attributes into my plugin for bifold doors. There was a gotcha that I wasn't expecting. It took me a lot longer to understand what was going on. I started out just calling the script over and over to create up to 4 doors which handles a double bifold. Three problems, code was starting to get messy, execution was starting to take more time and memory and storage was increasing too much. So I now create 1 door create a second instance then flip it. Then take the bifold (2 doors) and instance it and flip them. This caused havoc. As soon as I tried (in code) to change the axes of the second door the door no longer behaved as expected. Turns out that Rotz on the flipped door changed from 0 to -180 and all I did was flip the door. Of course if you flip the door in the editor the rotz stays at 0. flip the sibling tr = Geom::Transformation.scaling(sibling.bounds.center, -1, 1, 1) sibling.transform!(tr) If I change axes after flipping door then the door moved to an unexpected place. If I change the axes before flipping the door the axes gets flipped as well causing the door to move over. The solution I came up with was to create a parent container to hold the door. Flip the door. Since the parent's rotz stays at 0 I could reference the grand parents angle. Creating another level of nested containers effectively insulates the animate coding from the effects of flipping the door.
  • How should i use s and t scale factor from SUTexture ?

    2
    0 Votes
    2 Posts
    329 Views
    tt_suT
    For the record, ongoing conversation at: http://forums.sketchup.com/t/how-should-i-use-s-and-t-scale-factor-from-sutexture/4589/6
  • Material observer behaviour on OS X

    4
    0 Votes
    4 Posts
    334 Views
    tt_suT
    @eneroth3 said: <offtopic> There's a Materials.current method ?? For my latest project I created a materials observer listening to active material change just so it could be assigned to a variable so I later could know what material is active. How could I have missed this? cleaning up some code </offtopic> Beware that the material might not be in the model yet - in older version of SketchUp it can cause crashes if you try to apply the material to entities.
  • Remove layer doesn't work?!

    5
    0 Votes
    5 Posts
    491 Views
    TIGT
    Jim is correct. If, via Ruby, you give a layer a color with transparency it is ignored and it renders opaque. Sp currently you can only change a layer's color through the API - there is no alpha OR texture support within the API, although of course you can do both of those manually...
  • Unzipping archive from Ruby (Mac and Windows)

    55
    0 Votes
    55 Posts
    9k Views
    tt_suT
    @eneroth3 said: What do you think is the best implementation? What about showing a web dialog or UI.messagebox when the plugin loads and the gem isn't installed telling the user that the gem is required? The user can choose to do it later (next time plugin is loaded) and the extension wont load or choose to download it now and there's a message saying it may take some time. The user would also be informed that this only has to be done once (per user and computer). Of course the extension warehouse info page would say that the extension will ask the user to install the gem and then automatically do it. There is no need for user interaction. You simply call Gem.install("nameOfGem") and it's done automatically for you. Look at the Gem module in the StdLib: http://ruby-doc.org/stdlib-2.0.0/libdoc/rubygems/rdoc/Gem.html However, you might want to call that only right before you need to use the gem - otherwise, if you call that in the head of the RB file with all the other require's it'll lock up SketchUp until the gem has been downloaded and installed. Not a big deal perhaps in the normal cases - but imagine if a user copied a few extensions that did this, then there's be a potential large lag during startup. But only once.
  • Help requested for checking all nested instances

    11
    0 Votes
    11 Posts
    1k Views
    sdmitchS
    @bobvandevoort said: Ah I'll try to be a bit more specific. Let's say I have a model with 3 components, comp1, comp2 and comp3. comp1 has comp2 inside and comp3 is inside of comp2. This then means (if I am correct) that comp1 has a transformation, called trans1, comp2 has one called trans2 and comp3 has one called trans3. If I take comp3 and place it in the model with its own transformation, trans3, it will not be places at its original position in the model. To achieve that it needs to have its transformation multiplied by trans2 and trans1. So now I want to create a matrix "noembed" that only has components that have no other components nested inside them (like comp3 here). However these components should still retain there original location/position in the model meaning their own transformation should be multiplied by all their parent's transformations. In which case this code seem to do the trick cd.instances.each{|ci| > next unless ci.parent==mod > trans_matrix << ci.transformation > noembed << ci > } You are correct that the transformation of comp3 not embedded will be the product of its' and the components instances transformations above it. The code above only would only save comp3's transformtion if it is at the model level. It would be great if you could start at the instance and work up to the top but .parent returns a component definition which doesn't have a transformation associated with it. So you have to start at the top and drill down. This code does that for two levels. Adds a comp3 at model level and erases the instance that it replaces. mod = Sketchup.active_model ent = mod.active_entities sel = mod.selection rmv = [] ci0 = ent.grep(Sketchup;;ComponentInstance);#parent is mod ci0.each{|c0| next if c0.definition.name=="comp3" tr0 = c0.transformation ci1 = c0.definition.entities.grep(Sketchup;;ComponentInstance);#parent is definition ci1.each{|c1| tr1 = c1.transformation if c1.definition.name=="comp3" tr = tr0*tr1 ent.add_instance(c1.definition,tr) rmv << c1; break else ci2 = c1.definition.entities.grep(Sketchup;;ComponentInstance);#parent is definition ci2.each{|c2| tr2 =c2.transformation if c2.definition.name=="comp3" tr = tr0*tr1*tr2 ent.add_instance(c2.definition,tr) rmv << c2; break end } end } } rmv.each{|ci| ci.erase! if ci.valid?}
  • Running Sketchup as a service with sinatra

    9
    0 Votes
    9 Posts
    941 Views
    D
    SU used to modify set, since ruby 2 it dosen't john
  • Ruby api: reference point within a component

    3
    0 Votes
    3 Posts
    718 Views
    Dan RathbunD
    Yes you do not need to search among ALL the house's entities, IF you know the door's definition. IF you do, then simply look in the definition's instances() collection. If there are multiple door definition's, then you can iterate the model's DefinitionList collection, testing each definition for some identity (name value, or attribute in an attribute dictionary, etc.,) ignoring any definitions that have no instance, ie: !defn.instances.empty?
  • Material, Layer, Color, Alpha

    15
    0 Votes
    15 Posts
    956 Views
    M
    Dan, @dan rathbun said: Greg you have been "ignored" because you are a troll. You have a total of 23 posts here. I have near 5000! You are both incorrect and insignificant. As I stated, condescending. The fact that I choose to spend my free time away from computers doesn't really have any bearing on what I know or what I've said. I don't recall there being a relationship between quantity and quality regarding forum posts. Most forums always have a few people who feel their (often newfound) knowledge is so unique and authoritative that they post to almost every thread... Please enlighten me and post a link to anywhere on the Internet that says something similar to your statement 'there are no properties in Ruby.' Same thing goes for the statement 'Most methods return new objects.' By the way, you use the word 'new.' Since you've mixed it up before, are you referring to a new object like material.color, or a reference to a child object like Sketchup.active_model.entities? You've misused many programming terms that have relatively standard definitions, and, as I've stated previously, you conflate Ruby and the SU API. I'd suggest you do some reading and join some other programming forums/lists. BTW, my 'Design Patterns' book by the 'Gang of Four' is 2nd printing. I think it's currently at the 40th (or more) printing. Do you have a copy? Greg

Advertisement