šŸ¢ PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Missing ruby in su7

    5
    0 Votes
    5 Posts
    306 Views
    G
    Thank you, That did the trickā€¦..hadnā€™t even crossed my mind. I figured it was something painfully obvious that I was missing. Thanks again, Glenn
  • Where's My Inference Dots?

    7
    0 Votes
    7 Posts
    797 Views
    thomthomT
    @chris fullmer said: I could be way off, but I was thinking it was an optimization thing. I think they are just checking to see if the inputpoint changed, and only if it changes do they refire the draw method. Chris But as the manual says: @unknownuser said: true if a valid InputPoint was picked and it is different than it was before. From that, it sounds like the InputPoint object is performing the check for you. It returns true only if it's different from the last time you called pick.] (Note: I haven't tested that the implementation actually works as the manual says it should. We have enough examples of deviance... )
  • SketchUp to ASE

    7
    0 Votes
    7 Posts
    646 Views
    thomthomT
    @martinrinehart said: I've found materials to be so dangerous that I no longer let them near Ruby. face.material = '[Wood_Cherry_Original]' Problem: the face looks like cherry, but model.materials has no cherry. Bug Splat coming soon. face.material = model.materials['[Wood_Cherry_Original]'] If there is no material '[Wood_Cherry_Original]' then model.materials['[Wood_Cherry_Original]'] will return nil, which indirectly means Default Material. I've not experienced any problems with materials using this method.
  • Ruby beginner

    2
    0 Votes
    2 Posts
    310 Views
    M
    Start here: http://www.MartinRinehart.com/models/tutorial/tutorial_11.html You'll need chapter 15, too, which I'm working on at the moment. 11 through 14 cover a lot of ground. Good luck. Pick a simpler project for your starting go.
  • Fredoscale

    3
    0 Votes
    3 Posts
    411 Views
    R
    cool feature, thanks a lot
  • Fredo related plugins

    8
    0 Votes
    8 Posts
    497 Views
    R
    thanks a lot
  • How to save a model SU 7 (cp1251)

    11
    0 Votes
    11 Posts
    579 Views
    TIGT
    Within a Tool's class have this def getExtents bbox=Sketchup.active_model.bounds bbox.add(@ip.position) if @ip and @ip.valid? bbox.add(@ip1.position)if @ip1 and @ip1.valid? bbox.add(@ip2.position)if @ip2 and @ip2.valid? bbox.add(@ip3.position)if @ip3 and @ip3.valid? ### etc return bbox end where the various @ip's are input points that are called from mouse moves etc, as you move/pick with the tool... The tool auto-runs getExtents() so you don't do anything else ? Works for me in my tools
  • HTML export with hotspots?

    2
    0 Votes
    2 Posts
    894 Views
    M
    Hello Fredrick, Check out Chris Fullmers Camera Recorder - http://forums.sketchucation.com/viewtopic.php?f=323&t=23517 Its quite close to what you asking. might require some leg work but should get the job done. I also have been working on a Museum plugin for a while, hope to find time to finish it already. Myne is definitely not what you are looking for but might be useful for a project like yours - check back in some time. Great initiative you have taken on this project Cheers
  • Context Menu Trimming ...

    4
    0 Votes
    4 Posts
    257 Views
    H
    ... thanks guys
  • I need a script

    4
    0 Votes
    4 Posts
    285 Views
    TIGT
    Without reworking it to draw just four edges rather than make a face_with_its_four_edges, you can recast it to make the face and then erase it immediately - its four edges should get left behind... lines 107 et al... def create_rectangle # check for zero height if( @pts[0] != @pts[3] ) face=Sketchup.active_model.active_entities.add_face @pts face.erase! if face.valid? ### edges will remain... end self.reset end EDIT: CF beat me to it !
  • Aliasing UI::messagebox ?

    4
    0 Votes
    4 Posts
    432 Views
    Dan RathbunD
    @unknownuser said: ... I tried various flavors of the alias and alias_method keywords, but those don't seem to work with modules. I'm certain there's a way to do it, but I thought I'd ask here before diving into my Ruby books. Yes.. it's weird that alias doesn't work with modules. But this is even weirder. To alias modules, you instead use the object= method. Example aliasing of Sketchup module: (At Ruby Console type the following, where ">>" is resulting output.) Sketchup.class >> Module Sketchup.object_id >> 43353420 # remember this id... # now alias the module SU = Sketchup >> Sketchup SU.class >> Module SU.object_id >> 43353420 # it's the SAME exact id # test it... SU.version >> 7.1.6087 I would think that we must be careful what namespace the alias constant is declared within. If the above statement "SU = Skecthup" was declared inside a module, or a class, it would only be accessible within that namespace, or must be qualified to be accessed. For example, say you used that alias assignment within a module named "Configurator", in order to access the alias from outside, you'd need to qualify it with: Configurator::SU.methodcall However.. if you wished the alias to have global public access, you'd need to declare it outside ALL modules, in the objectspace. (Similar to typing it at the console.) BUT... what if for control purposes (ie, conditional loading,) you needed to have the statement inside a class or module? I think in this case, remember the Kernel.eval() method, and the fact that module Kernel is included in every object. That means that the containing module has it's own copy of eval. So you cannot call just eval (unqualified,) because you'd be calling the local module's copy of eval. To do it from within a module (or class,) you must qualify the call: if situation then Kernel.eval("SU = Sketchup"); Then the alias constant is global.
  • Engineering toolbox - how does it work?

    3
    0 Votes
    3 Posts
    868 Views
    D
    It looks like it inserts components from data(length, width, etc.) that you specify...similar to a dynamic component. Looks useful! From your link... @unknownuser said: How to use the Engineering ToolBox After loading Sketchup and the Engineering ToolBox from the menu - navigate to the wanted component in the navigation menu above - and select "insert" to add the wanted component to your SketchUp model. Note! The SketchUp Engineering Toolbox is an online resource updated continuously. You need an internet connection to operate. For some components parameters like length, color, offset and more can be modified before insertion. Customized components can be inserted by changing parameters in the dialog boxes at the end of the component lists - and clicking "custom!" Selected objects in the model can be manipulated - rotated, moved, colors changed and more - from the Tools section. Assistant objects like lines, horizontal and vertical planes can be added.
  • Skp to off format... plugin

    6
    0 Votes
    6 Posts
    607 Views
    V
    can anyone write the plugin and give me... i am a newbie to both ruby and sketchup api... thanks..
  • How to draw rectangles on a cylinder

    3
    0 Votes
    3 Posts
    369 Views
    P
    @thomthom said: Tools on Surface: http://forums.sketchucation.com/viewtopic.php?f=323&t=11212 Thanks a lot. I don't understand why, but I lost it. Hans
  • Tool History Dialog/Recall?

    2
    0 Votes
    2 Posts
    245 Views
    Dan RathbunD
    @earthmover said: Would it be possible to create a dialog window that shows the a running tab of the last 10 or so tools or plugins used and allow you to recall them? The $" array holds a list of every ruby script that was loaded by the require command, but those scripts are usually ones we only wish to load once anyway. (Which is the purpose of the array in the first place, require checks the array so as not to reload scripts that have already been loaded.) I say this because, the feature you desire would need a similar array, but it must have all files loaded by the load command, except those that are in the $" array. (Tricky because require passes it's file argument to load if it decides a script needs to be loaded.) I hate to think about this, but one solution would be to override load; not desirable because it's already been overriden by Google to handle the .rbsfiles. It may be better to create a new run command, that mantains the 'history' array and then passes the filename argument on to load. So the 'rule' would be if you want a script in the history, use run, if not use load directly. A webdialog could be made easily once the maintenance of the history array was solved. Heck.. even a Inputbox with a dropdown list would work, but a webdialog would be better (single click and it could remain open, the list could be updated continuously. An Inputbox would be 3-click, open it choose script, click OK.)
  • Problems with Sketchup Classes

    4
    0 Votes
    4 Posts
    403 Views
    L
    Thanks for the replies guys! @unknownuser said: That is correct. Most methods of classes are instance methods. You should be able to call them from inside the class (ie another method of the same class,) using it as a private method. Yes it is an instance method, but it seems to have no effect on objects created in the sketchup ui, presumably because they have their own read-only/inaccessible templates/classe for creating objects? And yet I still fail to see why rewriting the instance variable declaration (if that's what it's called!) for x, y, z has an effect on yaml. Have they not already been declared? I just have a funny feeling that something weird is going on under the hood. I actually had no real purpose when extending those classes, except to try and get them to expose x, y, z values to yaml. It worked in that instnce, I have no Idea how, and was unable to do anything similar for other types. The workaround only partially worked (ie, it does not work on objects created in the sketchup ui). @unknownuser said: You can do anything you want FOR YOUR OWN USE. BUT Google OWNS the Sketchup, UI, and Geom Namespaces. The Terms of use prevent you from causing other people's installations of Sketchup to be degraded or broken or such. The license agreement is at: http://sketchup.google.com/intl/en/download/license.html At the very least, if you wanted to extend Sketchup classes (and release those extensions,) you'd need to have Google Sketchup Team consent AND Sketchup Developer Community approval. You might join the SKX project, or monitor the SKX forum. Normally I would have given up trying to get yaml to work and come up with my own alternative way of transmitting the object information via text through stdio, but I have thought of another interesting concept, the possibility of using other languages such as python or java with sketchup... with yaml. If there is no interest in that, and I can't find a quick fix to this problem I have with yaml, then I'll drop that Idea! I think I need to learn how yaml works (on the inside) in order to find out why it struggles with sketchup. I did have one Idea for a work around, and that was to deep copy the objects created in sketchup to what I have dubbed (if my theory is correct) a "True Ruby Object" and then use the .extend method to append the yaml methods on the objects. In order to do this I guess it would be easiest to make the change to the way yaml works (otherwise I may as well just copy all the attributes manually!). By having my own copy of the objects, and then using the .extend method will I still be voiding this license aggreement? A big problem I think I can see with that Idea is performance. Having a copy of every object doesn't seem like good, common sense to me!
  • Questrion for script developers on textures

    3
    0 Votes
    3 Posts
    242 Views
    TIGT
    I don't know of a script to do this, but if your tiles are faces or groups / component instances with an applied material, then there is a built-in way. Select one with that material. Right click and in the context-menu choose 'Select' and 'All with Same Material'. Right click again and in the context-menu choose 'Entity Info'. The dialog that opens will report the number of things now selected with that material. If the objects are faces it also reports their area in current units. If the things are 'instances' it will only report their number. If the tiles are instances of a component with the material applied 'internally', then you can count the number of them in the model this way... Open the Component Browser and click the Model-tab [small-house] and right-click over the tile component you want. In the context-menu choose 'Select Instances'. All instances of that component are now selected. 'Entity Info' will again give the count of those tiles now selected. [Of course this might all be different wording in your 'locale' version] I'm guessing you are Spanish? Don't worry, your English is quite good... Merry Christmas
  • Unit Testing, Test-Driven Development?

    7
    0 Votes
    7 Posts
    431 Views
    Dan RathbunD
    @jim said: ... but how to incorporate it into the development cycle without imposing a performance penalty in the release version? Definately, any Test or Debug module would be something we would ONLY load during testing. We should not expect someone (ie the average user,) to have those modules loaded when they are just running and using Sketchup and the plugin (once it passes tests and is released.) If you were testing a plugin on a model that was very big and had alot of textures, I'm sure performance would be reduced. That's only during testing tho. Another option, is to cut up a Test or Debug module into smaller modulettes so only that which a tester needs is loaded. Perhaps take advantage of the autoload method, to do it automatically.
  • How to detect duplicate edges?

    7
    0 Votes
    7 Posts
    364 Views
    TIGT
    @richmorin said: TIG- If you'll look at my code extract, you'll see that I'm already doing what you suggest. pph is a hash of "point pairs", indexed by the vertex positions (encoded as strings, to avoid object issues). However, my code isn't detecting any clashes, even though SU does (later) when it tries to save the model. That's why I suggested instead of inspecting the points you inspect the edges already made...
  • Can we improve ExtrudeEdgebyRails? (add options)

    21
    0 Votes
    21 Posts
    2k Views
    D
    hi Tig, just a thought, I and it seems quite a few people use fredo's polyline segmentor before using eebyrails, loft, blend, etc.. so, would it be possible to simply call up that tool from within EER2 if a potential problem is found? john

Advertisement