Sketchucation Tools 5.0.7 | Licensing improvements and bug fixes Learn More

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
  • [Code] Ruby Extension for Sketchup color integers

    7
    0 Szavazatok
    7 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    Added to the original post (root of thread,): Clarification: As discussed in the thread below... these methods really belong within the class to which they provide benefit and functionality. This class or classes, would be any Color object class that is defined in ruby, for whatever purpose. The example code can be rewritten slightly, so as to make it a generic mix-in module, for including in any Color class definition. In this way any Color class could inherit the conversion methods in the mixin module. Such a module would have as it's first line "module ColorIntegerConversion" instead of "class ::Integer", and this will be the way that it would be submitted for Standard Ruby, NOT as an extension to the ruby base Integer class.
  • How to tell when a material is not really a material (Image)

    5
    0 Szavazatok
    5 Hozzászólások
    339 Megtekintések
    thomthomT
    This is something that the manual should mention. I'll add it to the list.
  • Evaluate a dynamic attribute in Ruby?

    2
    0 Szavazatok
    2 Hozzászólások
    280 Megtekintések
    Chris FullmerC
    Yes. Dynamic components store their dynamic attributes in attribute dictionaries on the compopnent (or the definition mayeb). So dig through the attribute dicts to find one from the dynamic comp, and it will have all the values in there. Chris
  • Ending a tool

    9
    0 Szavazatok
    9 Hozzászólások
    863 Megtekintések
    thomthomT
    @adamb said: I've always used Sketchup.active_model.tools.pop_tool so it returns to whatever you had before rather than forcing the use of SelectionTool. Adam Do yo have to use Sketchup.active_model.tools.push_tool to activate the tool then? Because I tried Sketchup.active_model.tools.pop_tool when I had activated the tool using Sketchup.active_model.tools.select_tool - and that did not seem to do anything.
  • Cutlist plugin in reverse?

    9
    0 Szavazatok
    9 Hozzászólások
    1k Megtekintések
    TIGT
    For each piece you really need several extra columns in the worksheet, giving the x/y/z location in the world, the x/y/z rotation in the world and the x/y/z scaling in the world - ideally it should be a 16 item transformation matrix so you can easily set the piece's transformation from it... tr=object.transformation trans=tr.to_a scalex=Math.sqrt(trans[0]**2+trans[1]**2+trans[2]**2) scaley=Math.sqrt(trans[4]**2+trans[5]**2+trans[6]**2) scalez=Math.sqrt(trans[8]**2+trans[9]**2+trans[10]**2) scale=scalex scale=scaley if scaley>scale scale=scalez if scalez>scale puts " <pos>#{trans[12]} #{trans[13]} #{trans[14]}</pos>\n" puts " <scale>#{scale}</scale>\n" puts " <rotation>\n" puts " <matrix>\n" puts " #{trans[0]/scalex} #{trans[4]/scaley} #{trans[8]/scalez} #{trans[1]/scalex} #{trans[5]/scaley} #{trans[9]/scalez} #{trans[2]/scalex} #{trans[6]/scaley} #{trans[10]/scalez}\n" puts " </matrix>\n" puts " </rotation>\n" The rotation/scaling are inexorability linked using sines/cosines of the rotation angles in x/y/z etc in a complex but predictable way...
  • How to apply attributes through code? and how do they work?

    21
    0 Szavazatok
    21 Hozzászólások
    2k Megtekintések
    TIGT
    Things [each called an Entity] that are 'visible' in a model are typically geometry [lines, faces etc], and groups and components [what is commonly called a component is actually a 'component-instance']. These groups and instances contain geometry - they can also contain sub-groups and other instances. This is a simplified picture since there's also Images, Text, Dimensions etc etc but lets keep it simple ! Within the model's 'database' there are other things you can't see but that you can use - inside 'collections' called Materials, Layers, Styles and ComponentDefinitions. Each of these will have entries like Material, Layer, Style and ComponentDefinition. So far so good ? When you look at the Components in the Browser you are looking into the model's database and seeing the Component-definitions available for use. When you select [highlight] something in a model you can get its 'class' [typename etc] so with the initial examples above you have Sketchup::Edge, Sketchup::Face, Sketchup::Group and Sketchup::ComponentInstance. Let's assume you have somehow set a variable instance=ss[i] which is a Sketchup::ComponentInstance. You can find its definition thus definition=instance.definition Now you can find an instance.definition but conversely you can find a definition.instances [i.e. all of that definition's instances] Any particular definition's instance doesn't contain anything at all - it is a marker for the definition itself, so instance.definition.entities gives you a list of entities inside the definition that that instance is using... You can even 'swap' an instance's definition for another one: instance.definition=another_definition ...
  • Ideas for 2 simple but usefull plugins.

    5
    0 Szavazatok
    5 Hozzászólások
    597 Megtekintések
    MALAISEM
    Thankx for tricks.. MALAISE
  • What is this?

    2
    0 Szavazatok
    2 Hozzászólások
    232 Megtekintések
    R
    Looks like an example of using a DLL to get sketchup to talk to another program. Perhaps something similar is included with the SDK? othrwise it'll just be something somebody else has put together to try it out/demonstrate it.
  • Adding observers to a group of entities

    3
    0 Szavazatok
    3 Hozzászólások
    268 Megtekintések
    C
    Here is an abridged version: class EntityObserver def onChangeEntity(entity) puts entity.to_s + " changed" end end $entityObserver = EntityObserver.new def addObserver Sketchup.active_model.selection.each{|entity| entity.add_observer($entityObserver)} end def removeObserver Sketchup.active_model.selection.each{|entity| entity.remove_observer($entityObserver)} end If you have one entity selected, it adds and removes fine, but if you have more than one entity selected, it only removes the first entity in the selection.
  • Can I &quot;store&quot; a material as object in a variable?

    16
    0 Szavazatok
    16 Hozzászólások
    822 Megtekintések
    N
    Yes, I just noticed that is no use to have bitmap data as binary in ruby. Because when asigning texture image to a created material m = materials.add "mat1" m.texture = "C;/texure.jpg" We don't really add that texture, but pass the path to SketchUp and there, inside that evil thing some magic happens and it grabs the texture with the claws. So, yes... we need the bitmap as file on disk before any attempt to do anything.
  • Components

    12
    0 Szavazatok
    12 Hozzászólások
    994 Megtekintések
    honoluludesktopH
    TIG, Got it, thanks: model = Sketchup.active_model selection = model.selection selection.each do |i| puts "Component(s)" if i.is_a? Sketchup;;ComponentInstance puts i.definition.name i.definition.entities.each do|j| if j.is_a? Sketchup;;ComponentInstance puts j.definition.name j.definition.entities.each do|k| if k.is_a? Sketchup;;ComponentInstance puts k.definition.name end end end end end end Now, to organize as a proceedure to accomplish the above (3 levels) to the nth level:-}
  • Componentreporter.rb

    6
    0 Szavazatok
    6 Hozzászólások
    926 Megtekintések
    M
    I went through the cutlist.rb instructions again on my project and it works great. I had to move a number of component axis. Thanks.
  • Good introductory books on 3D programming?

    13
    0 Szavazatok
    13 Hozzászólások
    719 Megtekintések
    thomthomT
    I think I have to get a few of these books. Computational geometry: algorithms and applications let me calculate a 2D convex hull. (I had no idea what it was before.) http://books.google.no/books?id=tkyG8W2163YC&dq=Computational+Geometry:+Algorithms+and+Applications&printsec=frontcover&source=bn&hl=no&ei=bLYFS9r_DcP3-AbKiozWDQ&sa=X&oi=book_result&ct=result&resnum=4&ved=0CBkQ6AEwAw#v=onepage&q=&f=false
  • Removing 2D entities from skp using script

    15
    0 Szavazatok
    15 Hozzászólások
    1k Megtekintések
    RunnerPackR
    I think the defacto standard in this forum is that the original poster (e.g. you) edits his/her first post and adds [Solved] to the beginning of the title, to let people know there is a solution in the thread. I could be wrong, though, since I'm also quite new here...
  • Help downloading and installing Fredoscale

    2
    0 Szavazatok
    2 Hozzászólások
    1k Megtekintések
    numbthumbN
    Hi there! Take a look at the http://forums.sketchucation.com/viewtopic.php?f=180&t=17948&st=0&sk=t&sd=a, scroll down, find and download FredoScale 2.0h.zip. A brief explanation should also be there. Let us know if this helps. Oh, and FredoScale 2.0 requires LibFredo6 3.1 http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=17947#p144178
  • Looking for a plugin to dispaly cordinate

    5
    0 Szavazatok
    5 Hozzászólások
    310 Megtekintések
    honoluludesktopH
    Thanks, Chris.
  • Asking For Help Points are not planar (resolved)

    9
    0 Szavazatok
    9 Hozzászólások
    1k Megtekintések
    M
    @thomthom said: @mcdull said: i have solved the problem ,thank u And what was it? when i generate 3d wall,some points are not planar.i have changed the function.
  • Setting a certain unit as standard

    13
    0 Szavazatok
    13 Hozzászólások
    1k Megtekintések
    M
    Thank you Thom and Martin.. I understand better now :
  • Reading the SU API

    17
    0 Szavazatok
    17 Hozzászólások
    1k Megtekintések
    M
    @honoluludesktop said: ... If so is it efficient? Twentieth century issue.
  • Ruby methods in dynamic component attributes?

    3
    0 Szavazatok
    3 Hozzászólások
    334 Megtekintések
    RichMorinR
    Thanks! That is exactly what I was looking for! I've updated my blog entry (http://www.cfcl.com/rdm/weblog/archives/001716.html) with some speculation on how this capability might be used.

Advertisement