ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Face pointing towards the camera?

    25
    0 Votes
    25 Posts
    1k Views
    T
    @thomthom said: Any clues to how to determine that? Check my FrontFace. I just compare normals. The global transformation problem is solved by shooting a ray. That allows you to get an array of all parents of a face.
  • Mac Help Needed

    10
    0 Votes
    10 Posts
    227 Views
    T
    @martinrinehart said: I've looked harder and seen that there is NO Mac issue. It's a Windows-only problem. That's heartening to hear! The amount of times I've heard windows developers moan that there is a fault, and it is Apple's fault!
  • Tool Needed

    9
    0 Votes
    9 Posts
    1k Views
    M
    @dan rathbun said: Well I do something a bit weird. Care to share some code?
  • Ruby namespace?

    24
    0 Votes
    24 Posts
    4k Views
    J
    @dan rathbun said: (7) The methods within the 'sketchup.rb' script were intended (for the most part,) to extend developer's use of the classes Module and Class. BUT they were not wrapped within the proper namespace(s) in the script, and so get defined as methods of Object, and so become inherited by ALL classes, such as the Numeric classes, the Sketchup::Entity subclasses, the Geom::subclasses, etc. where they will NEVER be used. Very informative post Dan! But i disagree that the problem boils down to a lowly script. This problem is inherent in the design of the Ruby language itself! @dan rathbun said: Open a new model, draw something simple a cube, select a Sketchup::Face object. Switch to the console, type (all 1 command): **Sketchup.active_model.selection[0].private_methods(true).sort.join("\n")** Look at the list, you will see that the Face object has inherited as private methods (which you will never call from outside the object,) all those methods defined in 'sketchup.rb'! What kind of drain of memory will this have when you get to a model that has tens of thousands of Entities it it? Exactly! this is what most of the folks in this thread have missed! Ruby just blindly sucks in every method it can find! In Python we have a system of using single and double leading underscores to indicate private and public methods. It's not a forced convention but we all understand and use it like a forced convention. But even more importantly Python objects have a dir "special method" that will return the appropriate list of methods when using the introspection function dir(obj). Python also (as i have mentioned time and time again) uses every file as "module" automatically so none of the name clashing occurs unless you import the module in a certain manner.
  • Ruby Console hell... no more!

    8
    0 Votes
    8 Posts
    1k Views
    J
    @unknownuser said: Would now be a bad time to point out i actually quite enjoy scripting in SU? Great punch line remus . Your keen sense of comic relief no doubt qualifies you as a mod. I always seem to get a good giggle from your posts. But seriously folks we have an issue here. Some people will say that tring to improve SketchUp is a lost cause. Well that may be slightly true but we cannot give up already. I think a lot of newer scripters (some may never had experianced with scriping before) are now joining the fray but have found major workflow issues that quite frankly are just impossible to overcome alone... @unknownuser said: Wait a minute Jesse! uhhh, excuse me a moment, Yes Joe! @unknownuser said: Jesse, why in the world would some people feel that SketchUp scripting (the way it stands now) is a good system? We all know it sucks eggs! Thats a good question Joe and one has many complicated and reveiling answers. You ever hear the expression "more than meets the eye" Joe? I think for one people just get so accostomed to something that the "fear of change" simply (in their minds) out-weighs the hassles they currently endure. So they just choose to endure it. What about the "Helsinki Syndrome", have you ever heard of that one Joe? Well some correlations can be drawn between that state of mind and the current state of SketchUp scripters. If you where to ask them privately you'll find that they are just scared Joe, they feel helpless, and like little children they need guidance to free their minds from this hell-state. For example, lots of people use Microsoft OS even when far better (and free) choices are available. But what is most entertaining is when you ask them WHY? Why do you choose to use a proprietary OS when a number of free alternatives exists? It's like a deer caught in headlights Joe, don't even waste your time. But sadly there is also evil afoot in the form of FUD mongers and jolly green greedies. Some people have capital gains to be made from SketchUp scripting and they will do anything to keep their piece of the pie even if that means stepping on the little people (thats you and me Joe) to get to where they are going. Sometimes just by making a system uncomfortable you can keep the noobies out and therefore curtail competition. This system has been successfully employed by many major corporations! But we are not here to talk about M$'s evil world domination practices, we are here for the wonderful SketchUp. @unknownuser said: This is all very sad Jesse , i'm beginning to lose faith in my fellow SketchUp brothers and sisters. Yes i know, but i believe in growth Joe, and i believe in change. i believe we can cultivate these confused chaps into productive scripters that produce SketchUp scripts with much ease. No more shall they lament the torturous trappings of the Ruby Console. No more shall they endure 3rd party patch-ware and windowing multiplicity! Heck, they may even start to enjoy this!
  • [Bug]Win32api.so and Sketchup7

    12
    0 Votes
    12 Posts
    3k Views
    Dan RathbunD
    @cjthompson said: Do you know which version of Ruby you took the Win32api from? Just as a head's up, so you'll know... Win32API.so is not distributed with Ruby 1.9.x and up. It is replaced by Win32API.rb, which is a translator script, that 'fools' old calls to the Win32API.so, by translating those calls into DL library calls. It is supposed to work transparently, because most uses would load the so by simply: require 'Win32API' The require method looks for .rbfiles first, so it would load the new translator, instead of the .so, ... in a normal ruby install.
  • Planes

    23
    0 Votes
    23 Posts
    739 Views
    L
    Well I thought that was a long shot as it was defined and used in the same def, but I'd forgotten about the initialize def. Sure enough @tr has got it!!!! Thanks very much. So its rotating and displaying it just as you'd expect, off floating in space to the side. I'll have a go at the translation code and see how that goes. Thanks very much guys, really pleased this is coming together.
  • Escape characters between ruby and javascript

    8
    0 Votes
    8 Posts
    2k Views
    P
    Thx all. I managed to get it working
  • Bug - WebDialogs are caching and not refreshing images

    7
    0 Votes
    7 Posts
    837 Views
    T
    @dan rathbun said: I don't think it's an SU bug, it's probably a browser cache quirk. I'll agree to call it "behavior" until we get (if ever) a control to influence what the embedded browser is doing and as long as the hack works. @dan rathbun said: I wonder if the image table was enclosed inside a FORM block, would the Js method %(#BF00BF)[form.reset] cause the images to refresh? Good idea. Try it and let us know.
  • Float toolbar on creation?

    45
    0 Votes
    45 Posts
    1k Views
    thomthomT
    @jim said: The conclusion I keep coming to is that a WebDialog-based User Interface Manager is the solution. But I'm not sure what that would look like. One idea I've been playing with recently: a tool that launches other tools. Then you could hide all toolbars. When you want to switch tool, you hit a shortcut that activates the tool that brings up a set of toolbars drawn on the viewport - like Fredo's tools.
  • Connecting to SQLite3

    3
    0 Votes
    3 Posts
    321 Views
    D
    @jmjira said: Hello: I'd like to write a ruby script for a pipe flange and rather than input the dimensions of the flange (pipe size, thickness, outside diameter...) Thanks Joe Sorry can't help with the coding stuff, have you tried engineeringtoolbox.rb http://sketchup.engineeringtoolbox.com/ or the piping ruby at http://www.3skeng.com/ both work and are free john
  • SU minimum edge length

    5
    0 Votes
    5 Posts
    731 Views
    Chris FullmerC
    +1 Jim. Very interesting stuff there. Thanks for posting it, Chris
  • Export selection

    3
    0 Votes
    3 Posts
    200 Views
    TIGT
    @pixero said: Is there a plugin to export what's selected? I'm trying to make a plugin for a special purpose that would triangulate and export everything in a selection with a given prefix and fileformat(.dae) and then hide it, all at the click of a button. Also how do I make it iterate through all groups and components to triangulate? Can the triangulation be made at export time so it wouldnt affect the geometry in the scene? Any help appreciated. Use the ideas in my export_selection.rb for the export. As you have the selection you can iterate through its items and use e.hidden=true ? Your best bet for the triangulation would be to make a new group of the selection, copy the group, explode the original new group back where it was [and also 'hide' its contents] - now you have a copy of everything for export - simply group.erase! when you are done to get rid of the unwanted now triangulated stuff? To make the triangulations use my triangulateFace.rb ideas. Iterate through the group.entities and triangulate any faces, if it's a group iterate through its contents subgroup.entities.to_a and triangulate any faces in it [make a def to process these subgroups that can be recalled within itself to process groups in groups etc]... To triangulate faces inside any component instances will be more fraught since changing a definition could affect instances outside of the selection... So if having components in the exported set is unimportant then you can take each component-instance add it to a new subgroup [which is given the same name/description if required] and explode the instance - that way the contents are kept but can be changed independent of the definition... as it's now in a group process it as other groups to triangulate it - you need to trap for instances that are inside groups and inside instances and group/explode them the same...
  • Create a Toolbar of my menu

    4
    0 Votes
    4 Posts
    170 Views
    thomthomT
    @pauline01 said: Just one things, for add keyboard shortcuts, what's is the function? That's something the user sets up.
  • How to pass ISketchUpDocument from SU into c++

    5
    0 Votes
    5 Posts
    737 Views
    Z
    My fault, it is ISkpDocument*, not ISketchUpDocument*. Now it works! Thank you very much!
  • Idea for plugin: Bump Map From Geometry

    29
    0 Votes
    29 Posts
    8k Views
    Al HartA
    Upload a sample model, and I will see if I can find the utility to create a bump map. The model should be just the terrain, because I create the bump map by rendering the model from a top view, retaining the Z-values, and then using them to create the bump map.
  • Move point?

    6
    0 Votes
    6 Posts
    259 Views
    A
    Awesome -- all very helpful bits of info!
  • Get_element value for checkbox

    11
    0 Votes
    11 Posts
    806 Views
    Dan RathbunD
    You might just try and keep the state of the control in your own Js variable, and then use onclick or onchange events to toggle the variable ON/OFF value. I do it for 'toggle buttons' such as buttons that collapse / uncollapse a <DIV>.
  • Get height and width of an entity

    8
    0 Votes
    8 Posts
    284 Views
    TIGT
    @jim said: Just a note - Sketchup.format_area manages the conversion from sq. in. to model units. If the Model Units are mm; Sketchup.format_area(1.0).to_f > ==> 645.16 One of the more useless aspects of this 'method' [ .format_area] is that you will often draw in mmor cmbut want areas in sqm! Like drawing in inchesand wanting areas in sqft... SUp has many methods that are easily done another way but lacks so many methods it still really needs...
  • I want to be in a specific layer

    6
    0 Votes
    6 Posts
    171 Views
    TIGT
    It's almost always best to leave the active layer as Layer0 and simply assign other layers to things as you make them... You usually wan to leave 'raw geometry' [edges/faces] on Layer0 - you can then set other layers for Groups/Component_Instances/Text etc to control their visibility...

Advertisement