⚠️ 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
  • Fresh active_view when click on menu item

    2
    0 Szavazatok
    2 Hozzászólások
    664 Megtekintések
    TIGT
    Try adding: Sketchup.active_model.active_view.invalidate ???
  • Delete a group in ruby

    2
    0 Szavazatok
    2 Hozzászólások
    850 Megtekintések
    TIGT
    Assuming you have no more need of the group or its contents use: wandgroep.erase! See here: http://ruby.sketchup.com/Sketchup/Drawingelement.html#erase%21-instance_method BUT if you want to explode it and put its contents into the group's previous context, use: wandgroep.explode See here: http://ruby.sketchup.com/Sketchup/Group.html#explode-instance_method
  • Plugin debugger workflow

    3
    0 Szavazatok
    3 Hozzászólások
    719 Megtekintések
    W
    I tried by change name of load_plugin.rb to z_load_plugin.rb but it seems not solve my problem
  • User ending a program

    6
    0 Szavazatok
    6 Hozzászólások
    2k Megtekintések
    K
    The program I used as a model when starting used that method. However as I added more functions it became almost impossible to find how to get out to the end of the mouse click down def. Keith
  • Count excel rows

    3
    0 Szavazatok
    3 Hozzászólások
    985 Megtekintések
    Dan RathbunD
    More Specifically: Would the Range.Find method help? Range.Find method
  • Trouble finding faces

    2
    0 Szavazatok
    2 Hozzászólások
    647 Megtekintések
    sdmitchS
    @davesexcel said: I am using an If else statement, I got it to work earlier in the code, but now I am having an issue grouping a new entity and finding it's face, it has to do with adding an arc and not adding an arc. It seems to me that you define 'edg' twice if l=="Yes" but don't define it at all if l=='No'. #ROUND Nose Yes/No<<<<<< if l=="Yes" puts "top hanger round nose" #add arc<<<<<< edg = ent5.add_line [0,b+3,b-c], [0,b+3-0.5,b-c] ;vrt1=edg.end ent5.add_arc [0,b+3-0.5,b-(c/2)],[0,0,b+3-1],[-1,0,0],-c/2.0,0,180.degrees,12 edg = ent5.add_line [0,b+3+h,b], [0,b+2.5,b];vrt2=edg.start #end Add Arc<<<<< else puts "top hanger square nose" edg=ent5.add_line [0,b+3,b-c], [0,b+3-1,b-c]#<<<< edg ent5.add_line [0,b+3-1,b-c], [0,b+3-1,b] ent5.add_line [0,b+3-1,b] , [0,b+3+h,b] end #add the face to the entities in the model edg.find_faces; face=edg.faces[0] face.pushpull wdth [image: Stairs.gif]
  • Geometric Calculation with ruby

    6
    0 Szavazatok
    6 Hozzászólások
    995 Megtekintések
    thomthomT
    Using the Geom methods, and the methods on Geom::Point3d, Geom::Vector3d as much as possible is beneficial for performance. The SketchUp API methods are implemented in C++ and will be faster than pure Ruby code.
  • Save and recall parameters of an object created with ruby

    3
    0 Szavazatok
    3 Hozzászólások
    763 Megtekintések
    Dan RathbunD
    You should have a look at the SketchUp Team's Shapes and Window Maker example extensions. They (and a few others) use a library class called Parametric that handles creating a inputbox of parameters and saves them into an attribute dictionary attached to the (group or component) object. Why reinvent the wheel?
  • Edge observer

    2
    0 Szavazatok
    2 Hozzászólások
    707 Megtekintések
    inteloideI
    Well, a start of explaination and solution, here : http://forums.sketchup.com/t/edge-change-observer/8184 : Put an observer on edge.start and edge.end Thanks TT !
  • Generating PDF and MS Excel Documents within SketchUp API

    2
    0 Szavazatok
    2 Hozzászólások
    1k Megtekintések
    thomthomT
    Not sure what is available in pure Ruby, but if you create Ruby C Extensions it open up a whole lot more - as you can make use of C/C++ libraries. It's often a lot more libraries available for C/C++ when you want to go beyond the standard Ruby API.
  • Is it follow_me or followme ?

    6
    0 Szavazatok
    6 Hozzászólások
    1k Megtekintések
    thomthomT
    As TIG said, add_line was a deviance from what the norm. I think it got named like that because in the UI you have the "Line Tool". But in the API this is an unfortunate inconsistency. And as Dan mentioned, please report documentation issues in the GitHub repo. I queued up some cleanup to the followme method: [image: 2016-12-21_13h57_14.png]
  • What are the most suitable tools for coding plugins for SU?

    2
    0 Szavazatok
    2 Hozzászólások
    717 Megtekintések
    thomthomT
    I use a mixture of Visual Studio Code/Sublime Text and RubyMine. I use VSCode/Sublime etc for quick scripts and edits. But for larger projects I use RubyMine as the IDE provide better code insight. It's Ruby debugger tools is also very nice - saving you from "puts debugging". We just uploaded some guide to setting up RubyMine: https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/RubyMine%20Overview
  • How do I correctly set the Length formulas in a DC via Ruby

    8
    0 Szavazatok
    8 Hozzászólások
    2k Megtekintések
    JHJ
    Whow! This seems to work, Now I just need to take care of the units. I will post a reply if I get the Script in a usable condition. It would be nice if You could take a look at it then. But I don't know when I'll get enough time for this. Maybe tomorrow, I got 2go and make Dinner, my Girlfriend already has the knife in her hand and I don't want her to use it on me. EDIT: I kept using the initial approach in setting the Lenx to _lenx_formula since the other way it left me with an unscalable Component, or at best with a scalable component which doesnt show the correct measurements as the corresponding values in the DC Dialog. But Hey, Thank You anyway, maybe someone else has use for the Code for another useful Plugin
  • Assigning "Wood OSB" to face with API

    12
    0 Szavazatok
    12 Hozzászólások
    7k Megtekintések
    TIGT
    If any file is missing at the moment that there is an attempt to 'use' it - e.g. a texture image, a SKM material, or a SKP component - then the process will fail. However, once a texture image is used for a material for a model's material, or a SKM material is loaded into a model [v2017], or a SKP component is loaded into a model, then that data is bound into the model and its connectivity to the external reference is no longer needed - so if the file is subsequently deleted nothing bad happens. Unless a user goes into your extension's subfolder and removes [or renames] images, or SKMs or components, before the load attempt, then it will always [re]load. If you rely on 'shipped Materials', then if they are there they could load [v2017], but of course if they are removed by the user beforehand, it will fail...
  • Dynamic components for folding table base

    6
    0 Szavazatok
    6 Hozzászólások
    1k Megtekintések
    E
    Thanks jim!!! Ill confess that I'm far from using math formulas like that but it gives me a good reference on how it works I dont know what you're talking about, it looks perfect to me! Thanks again! Ed
  • Find out if point is inside solid

    13
    0 Szavazatok
    13 Hozzászólások
    3k Megtekintések
    P
    @sdmitch said: It should if "point" is truly inside the solid. If it is a model point then it will need to be transformed by the inverse of the solid's transformation. Thanks Yes the point must be in the solid(group) coordinate space. I've changed the code a bit to allow shell (outer face) testing Here it is: Edited: After some testing still something was not OK. I realized that when the ray crosses an edge it hits 2 different planes and through a vertice it can hit an unknown number of faces. The solution I came is that the ray crosses the solid in only one point. So instead of keeping track of how many faces it hits, I register all points the ray hits the solid and then perform a uniq-like operation to the array to count the number of points/hits. I've updated the code. For the filtering uniq! doesn't work (guessing because it uses eql? and this is not implemented in Point3d) Also tried pts.uniq! {|pt| pt.to_a} but it didn't worked, but since the raycast is parallel to X axis comparing x coordinate does the trick def point_insidesolid?(point, solid, exclude_surface=false) vect = Geom;;Vector3d.new(1,0,0) pts = [] solid.entities.grep(Sketchup;;Face).each do |face| if(FaceTools.is_pointof_face?(point,face)) return true unless exclude_surface return false else pt = Geom.intersect_line_plane([point,vect], [face.vertices[0].position, face.normal]) if(!pt.nil?) if(FaceTools.is_pointof_face?(pt,face) && pt.x>point.x) pts.push pt end end end end ptsuniq = pts.uniq {|pt| pt.x} return ptsuniq.count%2!=0 end def point_insideface?(point,face) case(face.classify_point(point)) when Sketchup;;Face;;PointInside, Sketchup;;Face;;PointOnVertex, Sketchup;;Face;;PointOnEdge return true end return false end
  • Need Help adding predefined dynamic Attributes via Ruby

    5
    0 Szavazatok
    5 Hozzászólások
    1k Megtekintések
    JHJ
    Allright, Got it partly working, But I Cant get the Attribute-Inspectors to show the Values, I guess I dont really understand how to set the Formulas correctly to get the corresponding Values by now. The DC Browser shows the Values (Lengths of the Piece in X,Y and Z) but everything else does not, this means no reporting so far. Can anybody push me a little in the right Direction Where do I have to set the DC Attributes Instance or Definition? and how could I set it to both if needed? I tried to set it to the Definition and the second time I run the Script the created Geometry has no Attributes at all, or at least nothing important. The unfinished Script, still buggy
  • [REQ] Converter format asg

    3
    0 Szavazatok
    3 Hozzászólások
    950 Megtekintések
    pilouP
    Precision : you have just to rename the .asg in .zip unzip it for have a file .xlm
  • Pre Save Observer

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    J
    I'm glad it helped. What I said is true on Windows because there is ever only one Model. On a Mac you can have more than one model opened. But you still probably need to attach your observers when new models are created.
  • Drawing Nuts and Bolts

    2
    0 Szavazatok
    2 Hozzászólások
    755 Megtekintések
    gillesG
    http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=40172

Advertisement