ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Problem with script

    9
    0 Votes
    9 Posts
    404 Views
    P
    @unknownuser said: But can't this already be done in SU with the Generate Report function? The problem with the inbuilt report generator is the same as the script referred to above. It is not very flexible, even if you take the option to report on selected components ony, it still includes all the attributes of all the components, and it reports in imperial measurements even if the model is in metric. What I would prefer is a report which is more selective such as the example I detailed above. The problem I am having is finding someone who could modify the above script.
  • (Required) Point inference On Edge when Using rotate tool

    9
    0 Votes
    9 Posts
    1k Views
    TIGT
    Daniel I agree that a configuration as you provided won't inference snap though similar ones will ! There is a way to find the true intersection of the edge and the arc that would sweep through the rotated end hole's center itself centered on the middle hole... Use my Tangent Tools script. Draw a cline through the desired edge and two concentric arcs [same radius] centered on the middle hole passing through the end hole to be rotated. Select the cline and both arcs. Those arcs will be too segmented to give an accurate intersection with the cline BUT the Tangent Tool > True Intersections will place cpoints at the two possible intersections on the cline and two additional cline guides from the arcs' center to these cpoints. It will also beep and report an error in the Ruby Console since the arcs are concentric and can't intersect with themselves... It's probably best to place the cline and two arcs into group of their own for easy erasure later... Simply use one of the cpoints to rotate the shapes about its central hole's center and snap to... This is convoluted BUT does give an accurate snap cpoint on the edge.[image: NGvj_inferenceonrotate.png]inferenceonrotate.skp
  • WxWindows for SketchUp Dialogs

    45
    0 Votes
    45 Posts
    7k Views
    T
    @dan rathbun said: That is because in module definitions, the module statement is a block statement so the word module works the same as begin (after all, the module does need an end.) Thanks for the explanation.
  • Json name value pairs

    19
    0 Votes
    19 Posts
    1k Views
    J
    Right - eval gets passed String objects. So before the eval is called, json is a variable which references a String. After the eval, the variable foo refers to a Javascript Object. However, @unknownuser said: To convert a JSON text into an object, you can use the eval() function. eval() invokes the JavaScript compiler. Since JSON is a proper subset of JavaScript, the compiler will correctly parse the text and produce an object structure. The text must be wrapped in parens to avoid tripping on an ambiguity in JavaScript's syntax. var myObject = eval('(' + myJSONtext + ')'); and @unknownuser said: ..If the server is not rigorous in its JSON encoding, or if it does not scrupulously validate all of its inputs, then it could deliver invalid JSON text that could be carrying dangerous script. The eval function would execute the script, unleashing its malice. To defend against this, a JSON parser should be used. A JSON parser will recognize only JSON text, rejecting all scripts. In browsers that provide native JSON support, JSON parsers are also much faster than eval. It is expected that native JSON support will be included in the next ECMAScript standard. var myObject = JSON.parse(myJSONtext, reviver); I believe Chris is using json2.js on my recommendation, which is based on DC's recommendation because it is possible CG's data could come from an outside source. And I would also repeat what TBD said and watch the "Good Stuff" video - at least you will know what to avoid in Javascript to make your life easier.
  • Tooltips?

    3
    0 Votes
    3 Posts
    340 Views
    J
    Did I help, or just confuse you?
  • Missing ruby in su7

    5
    0 Votes
    5 Posts
    307 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
    804 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
    648 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
    412 Views
    R
    cool feature, thanks a lot
  • Fredo related plugins

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

    11
    0 Votes
    11 Posts
    583 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
    896 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
    286 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
    869 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
    608 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
    246 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.)

Advertisement