ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Two JavaScript Points

    2
    0 Votes
    2 Posts
    213 Views
    Dan RathbunD
    @martinrinehart said: Dan, if you know the answer, please be a little slow to post it. .. yuz callin' me Slow, cuz'n ??
  • Roller coaster animation - move TO and angle of edge

    2
    0 Votes
    2 Posts
    487 Views
    M
    My tutorial, Chapter 16 has library code to handle this. You may be able to go straight to Chapter 16 and get your work done. But as TIG points out (reincarnated as the wise old one at the fairytale SketchUCation tavern) that has its drawbacks.
  • How do I integrate a SketchUp model with a real Picture???

    4
    0 Votes
    4 Posts
    361 Views
    T
    Great!! Thanks my friend, this info is really improving my sketches! I appreciate your help
  • PC v MAC webdialog populate

    45
    0 Votes
    45 Posts
    7k Views
    thomthomT
    Updated the post. That should work. NOTE! the onChange event triggers in IE when the input looses focus - so I attached the same event handler to onClick and onKeyUp to force immediate update. But if you use the this snippet with the other example the two onClick events will override each other and only one will trigger. You'd need to attach the event instead to make both event handlers work.
  • Skp File Names

    3
    0 Votes
    3 Posts
    291 Views
    Dan RathbunD
    @brett mcallister said: I was wondering if it was possible using ruby, to get the name of the skp file that is currently open in sketchup. assume: model = Sketchup.active_model Instance method: model.path Returns the full pathname, if the model has been saved, or an empty String if not. Instance method: model.title Returns only the SKP name (filename only MINUS the extension,) if the model has been saved, or an empty String if not.* Equivalent to: File.basename(model.path).split('.')[0] File.basename(model.path) Will return the full filename (including extension,) if the model has been saved, or an empty String if not. See also: model.modified? if model.path.empty? # model is UNSAVED if model.modified? # model may need to be SAVED else # model is a NEW unmodified SKP end else # model WAS saved at some time if model.modified? # model may need to be SAVED else # model file is sync'd with that # which is currently loaded. end end %(#4000BF)[Edited for clarity: (04 AUG 2010, 4:22 GDT) Added model reference assumption, and use of: File.basename(model.path)]
  • Saving components so they "open" nicely?

    4
    0 Votes
    4 Posts
    278 Views
    RichMorinR
    Indeed, it turns out that calling refresh_thumbnail after the call to zoom_extents and before the call to save_as clears up the problem.
  • Problems with script

    4
    0 Votes
    4 Posts
    236 Views
    TIGT
    You should NOT change a collection of entities you are iterating through... NO-NO= Sketchup.active_model.entities.each{|e| e.erase! if e.layer.name=='_4D_Finish_Text' || e.layer.name=='_4D_Start_Text' } YES-YES= Sketchup.active_model.entities.to_a.each{|e| e.erase! if e.layer.name=='_4D_Finish_Text' || e.layer.name=='_4D_Start_Text' } Note how the entities is made into frozen array [.to_a] before processing... To remove such items from inside all definitions use Sketchup.active_model.definitions.each{|d|d.entities.to_a.each{|e| e.erase! if e.layer.name=='_4D_Finish_Text' || e.layer.name=='_4D_Start_Text' }) EDIT: typo corrected '.to_a' added to final example
  • [talk] Using Ruby Modules

    33
    0 Votes
    33 Posts
    29k Views
    J
    Discussion of Wiki purpose and motives moved here.
  • Class similar to Length class

    8
    0 Votes
    8 Posts
    400 Views
    Dan RathbunD
    @viskiz said: I'm interested how Length class is made? It is simply a subclass, which inherits methods from it's superclass. class Distance < Float # add custom methods here end P.S.: DO NOT make changes to the Length class and then publish this in a plugin or script !!
  • Can i draw the whole building structure with code?

    31
    0 Votes
    31 Posts
    3k Views
    chrisglasierC
    I see that you are progressing well with the "technology" side of csv data storage but I wonder (because I am interested in alternative methods) how you are coping with the complexity of the information itself. I have been always wary of csv because I associate it with spreadsheets and though I have tried very hard from the early days of Lotus 123 I have not found a way to use them to "turn" data to cope with its 3D nature. What I mean by turn is illustrated by the diagram to the left which suggests it is natural to use a cross section to review the number of floors in a building but plan section to review each floor's spaces. I think this is sufficient to demonstrate data is 3d in nature (or perhaps more accurately access to it). The animation I have demonstrated before allows me to cope with it in a 2D UI. Information that is often presented as schedules - rebar, door, sanitaryware, ironmongery(hardware) and so on - can be dealt with in the same way, but the properties of the real (as opposed to code) objects require a data or backup display so that you can see collections of key/value pairs for editting. So assuming you agree basically with what I describe, it would be would interesting to see both a UI design and the structure of the csv or hash solution to compare with the UI and Javascript object notation (json) that I currently use. Cheers!
  • Ruby Singleton Class

    4
    0 Votes
    4 Posts
    2k Views
    Dan RathbunD
    @kwalkerman said: I thought this was one of the Ruby native classes? There are 2 catagories of Ruby Base Classes: Standard Included These are loaded along with the Ruby Interpreter. (They are bundled inside the DLL.) Extended Library These must be loaded when needed by using the require('libfilename') method. @kwalkerman said: Any idea why SU can't find it? Because Windows Sketchup does not come with a full Ruby Installation. (Some platforms: Linux, Apple OSX, etc. come "out-of-the-box" with a full Ruby Installation, but this is the OS OEM's doing, and not Google's.) In either case Sketchup is not preset to find the Standard Ruby Library folders. You would need to run a script like my example: See: [code] Ruby LOAD PATHs script for (Win32) @kwalkerman said: Is there any way to restore the file and/or the source code so that I can reference it? On Windows you need to go get the Windows One-Click Installer to install Ruby on your system. See the section: Ruby on Windows on the RubyLang.org Downloads page: http://www.ruby-lang.org/en/downloads/ I have not tried v.1.8.7 with Sketchup yet, I usually recommend the latest v.1.8.6 After install... you'd need to backup the 'msvcrt-ruby18.dll' file in the Sketchup program folder (or rename it to: 'msvcrt-ruby180_p10.dll' as that is the actual version and patch level that ships with Win32 Sketchup.) Then COPY (not move,) the interpreter dll from your new install's bin folder (usually C:/ruby{ver}/bin/) to the Sketchup program folder, renaming the copy to: 'msvcrt-ruby18.dll' (The Ruby guys have started putting all 3 version numbers into the filenames, so you might see it named: 'msvcrt-ruby187.dll'. Just be sure to leave it named as is, in the real Ruby bin folder; But Sketchup is hard-coded to load an exact interpreter dll filename.) The purpose / idea here is to be using the same version Library files as the interpreter your running.
  • Adding Entities without modifying the undo stack

    4
    0 Votes
    4 Posts
    248 Views
    TIGT
    The model.start_operation() options are notoriously flaky... but might improve if the API ever gets updated...
  • Dynamically Associated Text

    6
    0 Votes
    6 Posts
    417 Views
    TIGT
    Search out my Height above Datum Text Tag code... http://forums.sketchucation.com/viewtopic.php?p=193238#p193238 This tool adds a piece of text at the picked point and later if that text is moved its observer reads its Z value and updates itself automatically. In your case instead of it checking its location have it check the area of a given face [don't use ids as these change session to session instead stamp each bit of text AND it associated face with a guid - perhaps based on the time * rand] and have the face update the text. I already have an 'AreaTag' tool on my 'to-do list' [but currently it's a far off number 9]
  • [code] loading from the Standard Ruby Libs

    2
    0 Votes
    2 Posts
    1k Views
    K
    Dan, Very helpful, as always. So... For future... this is where you can download the library files if you need to: http://www.ruby-lang.org/en/downloads/ Thanks again! -- Karen
  • Flip edge

    2
    0 Votes
    2 Posts
    264 Views
    K
    @kolem said: in a quadrangular that isn't co-planar you need an edge going across it so it will create the 'face', is there any way to flip the edge, i saw in Google's API, Sandbox you can but the file is *.rbs Can't you just get the endpoints and redraw the edge? You can actually flip an edge without redrawing it, but it's much more complicated. -Kwok
  • Observer and new components

    2
    0 Votes
    2 Posts
    192 Views
    L
    Sorry for bumping but here some update: The ToolsObserver helped me to find out, that the ComponentTool (21013 - Maybe something else on Mac it is called onentToo) is activated if a user click on a component in the library. If i would know, which definition or at least definitionname this component has, i could implement an own tool to place the component. Maybe $dc_observers.get_latest_class has a function to retrieve the name, or another variable? Because when i look in the active_model.entities, there are only the existing entities but not the one at the cursor.. i can't believe, that there is no variable or method to get this information. Perhaps i do it totally wrong and there is another simple solution letting the choosen component snaps to specified faces/components (no the snaping in SketchUp is not very useful) frustrating^^
  • Ruby to trigger DC onClick Function

    3
    0 Votes
    3 Posts
    1k Views
    M
    thanks for the info, Dan I have read that article and I think my problem was that I was looking for the easy way out. I was wishing for a simple way to run the "OnClick" attribute, in particular, without having to create the animation object myself. It's easy to change a simple attribute like material, or lenZ but the interactive nature of OnClick and the tweening of the ANIMATE function make it a little over my head. But I guess this is how I learn. Thanks, Mike
  • [Bug] NaN in a normal's value

    8
    0 Votes
    8 Posts
    295 Views
    T
    @tig said: Looking at the face itself you have managed to form a face with a double edged zero area inner 'loop' ??? I have separated this face from a big file received from an user. I don't know how he managed to achieve it. I will have to run a NaN check while exporting to prevent errors in an exported file. It would be much better if SU could fix the face using 'ModelInfo\Statistics\FixProblems'.
  • OnPlaceComponent: place the instance in a group

    6
    0 Votes
    6 Posts
    361 Views
    L
    Thanks everybody. Wasn't the solution i hoped for but instead i wrote a name organized system, which perfectly fits our needs. Now there are other problems, hope i can get a solution for them larrywayn
  • Painting a quadrangular

    10
    0 Votes
    10 Posts
    412 Views
    K
    thanks a lot!

Advertisement