⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Help with transformation

    14
    0 Votes
    14 Posts
    549 Views
    D
    Posted the first vertion of the importer at http://sketchucation.com/forums/viewtopic.php?f=323&t=50067
  • Exporting solids & reversed faces

    5
    0 Votes
    5 Posts
    187 Views
    N
    No, just lines and using methods like Geom::intersect_line_plane and then checking weather the intersection lies withing the face itself. It's complicated and error prone (When lines intersect edges instead of faces) but can be made to work.
  • Empty groups get deleted?!

    19
    0 Votes
    19 Posts
    780 Views
    Chris FullmerC
    @niccah said: The user would like to create a project => so, somewhere I have to save this information about the projects (name, options, etc, ..). And the user could create a project and close Sketchup => so, the information about the new project has to be saved somewhere "for ever". Use an attribute dictionary to attach information to the model. It will stay with it after the model is closed and opened. Single Dictionatires http://www.sketchup.com/intl/en/developer/docs/ourdoc/attributedictionary Collections of multiple dictionaries http://www.sketchup.com/intl/en/developer/docs/ourdoc/attributedictionaries This is a much more stable way to maintain data in the model from session to session. Chris
  • SKP write thumbnail. SIZE?

    7
    0 Votes
    7 Posts
    460 Views
    jolranJ
    Maybe not for this part. I already have a folder with components. But your code might be very useful for a different projekt I have. This code would have to run each time to see if the user has added new components, when launching the webdialog. And add thumbs to the list. I already had it working before with 128 px X 64 px, but it would be nice to be able to set the thumbs proportions. As of now I'm clipping the image in CSS with 2 divs. Never mind how I'm doing it BTW.. The main point is that I may not be able to support IE7 with several imagehacks. BTW a side question: Trying to stay "Sketchup like" with the dialog. Could there be any copyright issues, mimicing Sketchup GUI interface?
  • ( [ 0,0,0 ].vector_to( [ 0,0,0 ] ) ).length.mm < 0.01.mm

    6
    0 Votes
    6 Posts
    192 Views
    D
    Very informative site in did. Thank you. I am a hardware engineer by training - so I know this problem from the other side and still it is a little strange
  • Rounding numbers

    7
    0 Votes
    7 Posts
    466 Views
    thomthomT
    @genma saotome said: Seems like updating the version of ruby used for Sketchup would he most helpful. Any reason for Trimble to do that as a routine step or is this one of those don't fix it if it ain't broke situations? They've tried earlier, but it was troublesome. However, from the talks at Basecamp it did appear they are again looking to update the Ruby core.
  • My first script

    3
    0 Votes
    3 Posts
    370 Views
    thomthomT
    To get input data from the mouse you got either InputPoint class or PickHelper. It depends what you are looking for. InputPoint gives you inferences is is similar to what for instance the Line tool uses. PickHelper is more for being abel to select Entities. Either way, You want to oolk into the Tool class. As for units which jolran mentioned, I got an overview of how to deal with units in SU here: http://www.thomthom.net/thoughts/2012/08/dealing-with-units-in-sketchup/ You basically should not do so much work with it. Keep everything in inches, the internal units, preferable in the Length class and let SU do the work of converting back and forth between internal units and model units.
  • Add items to submenu later on

    11
    0 Votes
    11 Posts
    954 Views
    Dan RathbunD
    The two main problems we have: (1) Menu object references on the C++ side are garbage collected quite quickly, and the references on the Ruby-side become invalid. We can live with having to recall UI.menu() to get new valid references to the 9 top level menus, but ... (2) the menu#add_submenu method should return a new valid reference to the submenu IF IT ALREADY EXISTS, or create the submenu if it does not. Currently it just creates a duplicate submenu. I am sure that this issue has already been logged. I so much hope that SketchUp v2013 will fix this (if no more updates to v8 will be released.) So.. for now... once the startup cycle is complete, we cannot add items to ANY of the previously created submenus.
  • One Submenu for many plugins

    4
    0 Votes
    4 Posts
    672 Views
    Dan RathbunD
    Although this should work.. because of current API bugs. It will not. See thread: http://sketchucation.com/forums/viewtopic.php?f=180&t=49912&p=449979#p449362
  • Get Point3D from place_component

    6
    0 Votes
    6 Posts
    229 Views
    F
    @dan rathbun said: Now... model#place_component() (1) The API dictionary is incorrect, it does NOT return nil, it returns a reference to the active_model which is basically frivolous, but does allow call chaining. We have logged an API doc typo on this, as well as asking for something more useable to be returned (especially in the case of multiple insertions when the 2nd argument is true.) (2) When the 2nd argument is false, and only 1 instance is inserted, model#place_component() works the same as the native tool, ie: the selection is cleared, and the newly placed component instance's reference is pushed into the selection (as it's only member.) So you can get it's insertion point as discussed in the post above. FYI ... When the 2nd argument to model#place_component() is true, and multiple instances MIGHT HAVE BEEN inserted, the model's selection object IS NOT CHANGED. If something was previously selected, it still is. If the selection was empty, it will still be empty. Dan, thank you for you for your two posts which are very helpful. I would have ticked them both as 'resolve' but I had already done this for a previous post and 'the system' wouldn't allow me to tick more than one post as a 'resolved' post. I will be trying your ideas soon. Thanks again. Francis
  • Scale along custom axis

    10
    0 Votes
    10 Posts
    1k Views
    Dan RathbunD
    If that works (and likely it does 'cause it's Adam talking,) can it be moved to the first post, retitled as a snippet topic, and comments inserted explaining WHY it works ?
  • SketchUp Engine

    7
    0 Votes
    7 Posts
    896 Views
    AdamBA
    Yes. But on a Mac, use Activity Monitor and click "Sample" to see this.
  • Writing and reading Marshal data to attributes?

    9
    0 Votes
    9 Posts
    1k Views
    thomthomT
    That will be troublesome. Even if you create your own wrapper class that takes a Sketchup::Material into a class that does support marshalling you have the issue of the Ruby API not being able to set the Colourize property. And you'd have to figure out a way to handle the texture, as you say. You could write that Base64 encoded or something, but you cannot restore it to reference the original filename. Why do you need to store the whole Material object?
  • Ruby (eval):1: warning: Float out of range

    15
    0 Votes
    15 Posts
    2k Views
    D
    Dan, I made some progress making this importer a little more usable. Pleas see if you have more advice for me. P.S. I deleted all the old versions from this thread and updated the top thread's file. Thank you. David.
  • Make all selected unique script?

    7
    0 Votes
    7 Posts
    406 Views
    ApofisyA
    @tig said: ### Makes all selected instances unique and edits names... > ### Copy all of this text into a text-file called something like > ### makeallselectedunique.rb - in the Plugins folder... > ### type 'makeallselectedunique' in the Ruby console > ### it works on current selection > def makeallselectedunique() > ints=[];Sketchup.active_model.selection.each{|e| > if e.typename=="ComponentInstance" > e.make_unique ### make instance unique > ints.push(e) ### keep list of these instances > end#if > }#end each > ints.each{|e|name=e.definition.name > ### name with '#nn' on end, e.g. ABC#2 > prefix=(name.split("#")-[name.split("#").last]).to_s > prefix=name if prefix=="" > ### e.g. ABC > suffix=name.split("#").last.to_i ### e.g. 2 as integer > suffix=1 if suffix<1 > ### check all extg defs for possible new name > Sketchup.active_model.definitions.each{|d| > suffix=suffix+1 if d.name==prefix+suffix.to_s > ### e.g. ABC2 exists so try to make it ABC3 etc > } > newname=prefix+suffix.to_s > e.definition.name=newname ### renames definition > puts name+" >>> "+newname ### put a # in front of this line to stop console printout > }#end each > return nil > end#def Hello, i need a similar script but i don't know ruby i need to edit all names but not all definitions and just add a counter after the name like this: furniture.Floor.01,furniture.Floor.02,furniture.Floor.03,...,furniture.Floor.10,furniture.Floor.11,furniture.Floor.12,.... where name is the name of the object. Also if there are some object like furniture.Floor.01 and furniture.Floor.02 for example the script can start to add counter from 03. Can you edit your script with my requests please? I'm waiting for your reply, thank's.
  • No tabs possible in text?

    7
    0 Votes
    7 Posts
    229 Views
    liquid98L
    Thanks guys. It seems this is a PC only bug. So far no reason to buy a mac..
  • Find the position of a group in the active context

    6
    0 Votes
    6 Posts
    240 Views
    D
    I solved the problem, the key was to use "mod.edit_transform.origin" I leave the code in case anyone needs it one day mod = Sketchup.active_model sel = mod.selection parert_origin = mod.edit_transform.origin entity_origin = sel[0].transformation.origin distance = entity_origin-parert_origin tr = mod.edit_transform.inverse distance.transform tr
  • Web dialog and cookies on Mac

    7
    0 Votes
    7 Posts
    182 Views
    S
    @dan rathbun said: Would it easier to use the LocalStorage interface instead of cookies ? Dan, Thanks for the tip! I tried it, and it not only works more portably, it is cleaner code. Steve
  • [Code] Material.names to Webdialog.

    55
    0 Votes
    55 Posts
    1k Views
    jolranJ
    @unknownuser said: Isn't that just because the model in your screenshot are mainly thin edges? Yes, thats true. That the components that has faces and materials come out better. Increasing the contrast on those thumbs too much make things worse. So I have found an acceptable between value around + 45 contrast, that all thumbs can benifit from. How to apply it is a different story I can live with the bad aliasing... One can affect some color when saving the component, playing with styles. But havent found any settings that gives me what I want. At it only seems to affect face.materials. @unknownuser said: And is that thumbnail in 100% scale? Thumbs are 100% scale. They look the same in Photoshop. From PS: 80% increase in contrast look really good on edges. [image: eBKC_contrasts.jpg]
  • Rescue Exception

    15
    0 Votes
    15 Posts
    2k Views
    Dan RathbunD
    OK I understand ... Visual Basic: CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator

Advertisement