⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

Alkategóriák

  • No decscription available

    20 Témakörök
    462 Hozzászólások
    HornOxxH
    @pilou said: More appetizing in chocolate! Eggs are good as well - but only very fragile when falling down in SketchyPhysics
  • Generating Texture Atlas for Gaming Performance?

    3
    0 Szavazatok
    3 Hozzászólások
    1k Megtekintések
    V
    Thanks for the reply! I am absolutely amazed that the "only" sollution for this most fundamental function is a 300 euro plug-in. That's... very sad for a software as user-friendly as SketchUp. Well, I guess it will be wiser to man up and switch to Blender after all and get all I need for free. But still! Thank you for information.
  • Ruby Plugin - Inserted Component Wrong Scale

    6
    0 Szavazatok
    6 Hozzászólások
    786 Megtekintések
    placidfuryP
    TIG, you rock. Thanks for the help (including all the other countless posts of yours I've read on other threads that have taught me so much so far). I think that got it after having it load once (with the exception of one situation where I need it to load separately each time - I have a 'container' component that other sub-components get inserted into, and if it's not reloaded, then the previous sub-component instances are in the new container instance as well, which I don't want). I also changed the path \, and float, and yes 0 length is getting trapped. I still have so much to learn...
  • Delete all layers via ruby

    6
    0 Szavazatok
    6 Hozzászólások
    986 Megtekintések
    TIGT
    Yes everything. All entities in all entities-collections.
  • Testing Ruby VALUES in C-extension.

    69
    0 Szavazatok
    69 Hozzászólások
    8k Megtekintések
    G
    Turns out it's a stdcall which has no mangling. I can debug the c extension in CBuilder. Very fast. Now I need to experiment with arguments etc. That will be the acid test for stdcall If anyone is interested I can post the files and the steps. Once I get a real good handle on this I'll try it out with XE7 which is a compiler that compiles Win32, Win64 and OSX. I will also test this on my lap top where Borland memory manager (a dll) doesn't exist. It will tell me if I need to include any of these files or not.
  • Multiple flip in component red axis

    5
    0 Szavazatok
    5 Hozzászólások
    614 Megtekintések
    alexandre skA
    fantastic as always. Thank you slbaumgartner and sdmitch. The flip all x works perfectly! The sdmitch code already was great. This forum is always great. I will make a simple free plug-in to help road build, and share here when it is ready.
  • Drawing with GL

    24
    0 Szavazatok
    24 Hozzászólások
    2k Megtekintések
    CadFatherC
    thanks John, already did that though (screenshot above is a watermark). the problem with this system is that you are forcing a new style on the user: if the user has a sketchy style on, you cannot have the bars and keep the sketchy style. (in other words we cannot load watermarks without loading a style as well). that's why i mentioned about another route: find user current style > save it as variable > load the 'grid' style > restore user style from variable when finished. alas, no way to get the previous style back in. whether from the 'in model' style, or trying to save it to a temp directory and loading it back from there. (at least i found no info at all anywhere). PS least of all the api docs!
  • Ruby c extension and Sketchup Objects

    8
    0 Szavazatok
    8 Hozzászólások
    1k Megtekintések
    A
    Thank you Thom.
  • C++ using swig

    18
    0 Szavazatok
    18 Hozzászólások
    3k Megtekintések
    thomthomT
    For my own extensions that I write now I usually drop support for anything older than SU2014 - due to Ruby 2.0 and other improvements since then.
  • Get MAC Address

    55
    0 Szavazatok
    55 Hozzászólások
    8k Megtekintések
    G
    I've run into issues with taking the fist or second Mac Address out of ifconfig or ipconfig /all. I've changed the code to look at the entire file and then to step through it line by line and treat it as a bit of a state machine. Thanks to pgarmyn and Driven I think I've got some code that will work. They both helped with files as have a handful of other people. With windows I've tested files in English, French, Russian and some with VMWare set up. With OSX I've just tested in English. Mac Address
  • Retrieving bounding box corners Point3d

    6
    0 Szavazatok
    6 Hozzászólások
    751 Megtekintések
    F
    @thomthom said: The BoundingBox object you get when you query the instance will always be oriented to world space. To get the bounding box as drawn in the UI you need to get the bounds of the definition - fetch all the points from its corners and transform them using the current edit_transform and the selected instance transform. That extension I linked to does all that. Ah! Thanks for the explaination ThomThom! I didn't realise that's what happened with instances' bounding boxes...very confusing for a novice! I did take the time to check out your extension and was able to understand what you're doing and apply that to my own code... thanks again sir!
  • Distance between two points / optimization

    14
    0 Szavazatok
    14 Hozzászólások
    2k Megtekintések
    thomthomT
    @jolran said: As a continuation of Thomthoms advice. Should you ever want to create a C-extension easily for distance between Points the code is already written and available https://bitbucket.org/thomthom/sketchup-ruby-c-extension/src/e2fe0f2e43e43ebae568535b6d7a98e160b4624c/src/Example%20-%20Basics/SXBasics.c?at=default Note: That example is OLD! You can refer to it for how I resolve the distance calculation, but had I done that today I would have done it in C++ using Visual Studio and Xcode: https://github.com/SketchUp/ruby-c-extension-examples
  • SU2015 gives NoMethodError for Length class #abs method

    6
    0 Szavazatok
    6 Hozzászólások
    729 Megtekintések
    tt_suT
    @archidave said: but in SU 2015; > 2.m.abs gives the NoMethodError This is pretty bad (it has broken my plugin for SU 2015) and means I now need to go hunting through the code for all occurrences of <Length>.abs replacing them with <Length>.to_f.abs and building-in extra validation where the class is not intrinsically known, just in case there could be a Length instead of a Float. The Length class used to be a subclass of Float. However this isn't really possible in Ruby, but from the Ruby C API this was hacked together a way to do so. When we added 64bit support in SU2015 this broke because the data structures where different. So we had to re-implement Length by forwarding the methods to Float. Initially this used the Ruby Standard Library, but due to another bug in Ruby where the StdLib would not always load if there was unicode characters in the user's username the StdLib would fail and the Length class would not properly initialize. There was also a bug in SU at some point where the StdLib would fail to load if the user started SketchUp by double clicking an SKP file. We later corrected the new Length implementation to not use StdLib so it would not fail if the StdLib failed to load. And we also fixed the bug regarding starting SU via SKP files. But those fixes should be in SU2015M2 - so I don't understand why you'd experience such problems. I am not able to reproduce your error. Can you try without any extensions enabled - just so we can eliminate that possibility?
  • Sketchup 8 faster than sketchup 13?

    29
    0 Szavazatok
    29 Hozzászólások
    5k Megtekintések
    R
    @unknownuser said: There is no "external" ruby pipeline. Phew, I was worried for a moment.
  • Ruby Group Swap

    12
    0 Szavazatok
    12 Hozzászólások
    2k Megtekintések
    S
    If anyone is interested, I finally solved my imported group's origin problem fairly simply with this... ga = entities.grep(Sketchup::Group) ga.each { |e| n=e.name; e.model.entities.add_group(e); e.parent.instances[0].name=n} Basically it just takes all the groups after import, adds them into a new group and names the new group the same name. This resets the origin, and allows the swap code to work properly.
  • 3d text box through Sketchup.send_action(21023)

    3
    0 Szavazatok
    3 Hozzászólások
    485 Megtekintések
    G
    @driven said: well, they have always said not to rely on them... but this works on my mac, but isn't in the list... Sketchup.send_action "select3dTextTool;" john it works also in windows 7 it was not documented thank you
  • Escaping out of editing a component

    4
    0 Szavazatok
    4 Hozzászólások
    529 Megtekintések
    tt_suT
    Note that if only close the currently open instance. If you are deeply nested you need to loop until you are back in the root - (if that's what you desire). And before SU2014 the method was bugged and could mess up geometry if the close was undone. (The method actually creates an undo item)
  • How to judge whether a 3D point is visible or not

    6
    0 Szavazatok
    6 Hozzászólások
    670 Megtekintések
    lbsswuL
    @sdmitch said: @lbsswu said: Hi everyone, Suppose I have opened the Sketchup software, I want to know whether a 3D point is visible or not in current view. For example, the 3D point may locate on the back of a person, thus we can't see it when the person facing to us. This should be done by Sketchup ruby code.Could anyone help me? I placed a construction point, the little black dot just below the horizon, and "Nancy" in the model. I then used the following code to test if the point was visible. mod = Sketchup.active_model > ent = mod.active_entities > sel = mod.selection > vue = mod.active_view > eye = vue.camera.eye > cp = ent.grep(Sketchup;;ConstructionPoint)[0] > pt = cp.position > vec = pt.vector_to(eye) > hit = mod.raytest([pt,vec]) > if hit > puts "pt is not visible" > else > puts "pt is visible" > end > Hi, sdmitch. Thank you very much. It works!
  • How to get the projected coordinate of a 3D point?

    5
    0 Szavazatok
    5 Hozzászólások
    629 Megtekintések
    lbsswuL
    @tig said: view.screen_coords returns the point in the Model as X,Y coords - screen value. But you must ensure that the exported image used the same size as the window, otherwise there is no direct relationship between the point and the image's pixels... Got it! Thanks for your help!
  • Component axis problem

    18
    0 Szavazatok
    18 Hozzászólások
    2k Megtekintések
    PixeroP
    I just thought I'd post this snippet in case it will help someone with a similar problem. def set_origin(compdef, compinst, pt0, pt1, pt3) tr1 = compinst.transformation rotvector = pt1-pt0 originvector = Geom;;Vector3d.new(1,0,0) org = pt3 angle = rotvector.angle_between originvector if angle < 90.degrees angle2 = -angle elsif angle > 90.degrees angle2 = angle end #if if angle == Math;;PI/2 angle2 = -90.degrees end if pt0.y > pt1.y && angle == Math;;PI/2 #Check if it's drawn at 90 degrees but in opposite direction angle2 = 90.degrees end compinst.transform! tr1.inverse tr2 = Geom;;Transformation.rotation(org, Z_AXIS, angle2) tr3 = Geom;;Transformation.new(org) compdef.entities.transform_entities(tr2, compdef.entities.to_a) compdef.entities.transform_entities(tr3.inverse, compdef.entities.to_a) compinst.transformation = compinst.transformation * tr3 compinst.transform! tr1 * tr2.inverse compdef.invalidate_bounds end #def
  • Replace component and set dynamic attributes?

    3
    0 Szavazatok
    3 Hozzászólások
    978 Megtekintések
    G
    There are a few things that I had to deal with. I found it easier to put the dynamic attributes in a nested group as opposed to the outside group. This way you can rotate the entire door and jamb to fit it into the door opening and you don't have to keep changing the dynamic rotz. These doors can be copied, flipped and or rotated while preserving the desired angles of rotation. 4 doors.skp [image: 4 doors.PNG]

Advertisement