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
  • [Plugin] ToolbarBuilderDemo

    13
    0 Szavazatok
    13 Hozzászólások
    779 Megtekintések
    BoxB
    I think a three or four button save in the free version will get you many more Pro buyers.
  • Ruby script to detect OS

    5
    0 Szavazatok
    5 Hozzászólások
    2k Megtekintések
    A
    That (edit: scott's) is already almost ruby code. This should do it: module TDxSkp WIN = ( (Object;;RUBY_PLATFORM =~ /mswin/i || Object;;RUBY_PLATFORM =~ /mingw/i) unless defined?(WIN) OSX = ( Object;;RUBY_PLATFORM =~ /(darwin)/i ? true ; false ) unless defined?(OSX) if WIN require 'sketchup.rb' require '3DxSketchUp/3DxSketchUp.dll' file_loaded("3DxSketchUp.rb") elsif OSX require 'sketchup.rb' require '3DxSketchUp.bundle.plugin/Contents/MacOS/3DxSketchUp.bundle' file_loaded("3DxSketchUp.rb") end end # module http://sketchucation.com/forums/viewtopic.php?f=180&t=34631&p=305368 We use proper operating system names because we are not detecting hardware. I'm not sure if that's the namespace ( TDxSkp) that they use, but our constants should better not float in top level namespace. However note that 3DConnexion is a binary plugin and adds content to the Ruby environment that we can not check for errors (or we can find but not fix them).
  • How to get transformation.origin of a internal component

    2
    0 Szavazatok
    2 Hozzászólások
    534 Megtekintések
    TIGT
    First find the insertion point of the Redbox instance in its current context. Next find the transformation of the Bigbox container instance. You need to get a handle on the 'Redbox'. Let's assume there is only one instance and that's inside Bigbox. redbox = model.definitions['Redbox'].instances[0] Now get its insertion point pt = redbox.transformation.origin Now let's assume there's only one instance of 'Bigbox'. bigbox = model.definitions['Bigbox'].instances[0] Get its transformation tr = bigbox.transformation Apply that to the point 'pt' pt.transform!(tr) The point 'pt' is now relative to the model's origin, NOT the Bigbox's internal origin...
  • File Path with backslashes

    6
    0 Szavazatok
    6 Hozzászólások
    491 Megtekintések
    TIGT
    @dan rathbun said: TIG's example: .tr("\"","/") means replace all double quotes with a slash. It probably should be: **.tr("\\","/")** Dan thanks for spotting my typo. I've corrected the original... By coincidence I was doing some changes between double and single quotes and it got stuck in my muscle memory !
  • Reference to entities(id)

    7
    0 Szavazatok
    7 Hozzászólások
    716 Megtekintések
    jolranJ
    Yep, solid tip. Thank you Dan.
  • How to unhide single entity in a hidden hirarchy of entities

    3
    0 Szavazatok
    3 Hozzászólások
    900 Megtekintések
    B
    Thanks for a quick reply! @tig said: If you use nested objects [groups or component-instances] and give them different layers, you can use layer-visibility to control what you see... My target plugin requires to use nested objects 'inside each other' to identify entity parents and their IDs in a complex scene Is there a way to 'unnest' an object?
  • Bat print skp files

    5
    0 Szavazatok
    5 Hozzászólások
    428 Megtekintések
    TIGT
    This idea is not new... http://sketchucation.com/forums/viewtopic.php?f=15&t=37510 https://groups.google.com/forum/?fromgroups=#!topic/sketchupruby/XCW2zuW_lY8 etc Without considerable effort and extreme programming skills, you will almost certainly have to open each SKP in turn and export it as a jpg or png, then print that using a 'bat' file ? This is readily programmable in ruby...
  • Action callback - Duh!

    4
    0 Szavazatok
    4 Hozzászólások
    313 Megtekintések
    jolranJ
    I see. Clever solution, anyway. Save's some code.
  • How to store slected file directory name on a variable?

    6
    0 Szavazatok
    6 Hozzászólások
    459 Megtekintések
    Dan RathbunD
    @Rafael: The API UI module does not have a folderpicker, YET. We have filed Feature Requests for one, and fontpicker, and colorpicker, and etc., etc. For now users must pick a file within the target folder. (We are out of luck if the folder is empty.) @thomthom said: @dan rathbun said: @sound = filepath.gsub("\\",'/') Since / as path separator isn't hard coded I tend to use: @sound = File.expand_path(filepath) One could also do: @sound = filepath.gsub("\\", File::SEPARATOR) But I prefer the first. Your second one is safer. Yes I got lazy, but my purpose here is going from the OS to Ruby. I imagine that after tha statement the path will be used by Ruby's Dir and File methods. Later on... to go back to the OS I'd use filepath.gsub("\/", File::SEPARATOR) if it is even necessary. Be careful with expand_path() because it is DUMB! Your example will work only because the UI.openpanel method returns an absolute path. When the path is a relative path,... the method simply concatenates the current working directory path and the argument path, regardless if the result is really a valid path.
  • Can Plugin Script Run while using other tools?

    5
    0 Szavazatok
    5 Hozzászólások
    289 Megtekintések
    renderizaR
    Thank you both for help I think I will not work on that plugin idea for the time being. Cheers!
  • Nested groups

    6
    0 Szavazatok
    6 Hozzászólások
    372 Megtekintések
    bomastudioB
    THANXXXXXXXXX!!!! it works!!!!!!
  • Ditto mac unix command

    2
    0 Szavazatok
    2 Hozzászólások
    650 Megtekintések
    D
    I'll start answering my own question... plugs = Sketchup.find_support_file("Plugins")ditto "#{plugs}" ~/Desktop/!plugs`` this duplicates the entire contents folder structure in a new folder on the desktop... not an unknown path insight sooo.... now to write that dropbox plugin john
  • [Talk] Qpik::SimpleRays Overhaul

    11
    0 Szavazatok
    11 Hozzászólások
    6k Megtekintések
    Dan RathbunD
    v1.0.1 download Moved to Plugins forum. Old v1.0.0 deleted. THIS thread retitled as "[Talk] Qpik::SimpleRays Overhaul"
  • I want to write a ruby script : rotate an object

    11
    0 Szavazatok
    11 Hozzászólások
    4k Megtekintések
    Dan RathbunD
    @unknownuser said: I want to learn if instead of having a text inputbox you can also have a dropdown menu list with existing layers on it so you can select from there aswell. Yes I have done that.. it is one one my files (somewhere) just guessing it's similar to this: def choose_layer(active=false) model = Sketchup.active_model layset = model.layers deflay =( active ? model.active_layer.name ; layset.first.name ) laylist = layset.map(){|l| l.name }.join('|') results = inputbox(["Layer ;...... "], [deflay], [laylist], " Choose Layer") results ? layset[results.first] ; nil end #
  • How to draw a cylinder by ruby?

    11
    0 Szavazatok
    11 Hozzászólások
    4k Megtekintések
    D
    hi have a look at linetool.rb and class CylTool < LineTool in the Example scripts folder in ../SketchUp/Plugins/examples/linetool.rb, or download it if it's not...... john
  • Notepad++ SU8 Ruby API Autocomplete

    62
    0 Szavazatok
    62 Hozzászólások
    18k Megtekintések
    B
    Thanks a lot!
  • Rotation transformation for a component instance

    10
    0 Szavazatok
    10 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    @honkinberry said: I want to be able to place a component like a bench, and then immediately rotate it about the Z axis. So both the placement and the rotation should be linked very smoothly to accurate cursor position. OH.. well that is extremely EASY. Because that functionality is built-into the native component placement tool, which is accessible from the Ruby API. So.. for example the bench's name is "Bench Wood HighBack" def place_bench() mdl = Sketchup.active_model compdef = mdl.definitions["Bench Wood HighBack"] if compdef mdl.place_component(compdef,false) return true else return false end end The trick is the 2nd argument to Model#place_component() must be false, so that you can use the rotate handles (they appear as little red crosses,) just after you choose the insert point. Insert the bench.. then move the cursor to the top of the comp's boundingbox, and you should see 4 red crosses appear. Hover over one of the cross handles, and the cursor will change to a rotate cursor. Hold & Drag (or Click Move Click,) to rotate about the Z axis.
  • Why creating dictionary triggers onSelectionBulkChange?

    15
    0 Szavazatok
    15 Hozzászólások
    715 Megtekintések
    D
    @dan rathbun said: ... the engine triggers MISSPELLED dan, I truly thought you had misspelt that and had to Google it... best explanation I could find was this... @unknownuser said: British English shows a preference for retaining strong verb forms (burnt, learnt, spelt, dreamt, spoilt etc). American English shows a preference for ignora... I'm mean simplification (burned, learned etc). john
  • [Code] save Camera properties method

    4
    0 Szavazatok
    4 Hozzászólások
    441 Megtekintések
    Dan RathbunD
    @greenskp said: all this code is to work in MAC and PC? Yes it will work on both Mac and PC. BUT it is meant for you to copy it INSIDE your plugin sub-module.
  • How to load the system lib of ruby for SU

    5
    0 Szavazatok
    5 Hozzászólások
    427 Megtekintések
    Dan RathbunD
    SketchUp currently uses Ruby v1.8.6-p287 Ruby (v1.8.6-p287) Windows One-Click Installer Standard Ruby Library folders DO NOT belong in SketchUp's "Plugins" folder. They belong in the Standard Ruby Library folders. Once a user installs the full Ruby edition, SketchUp's Ruby can access it's library folders, by pushing library paths into SketchUp's **$LOAD_PATH** array. See: [ Code ] Ruby LOAD PATHs script (Win32)

Advertisement