⚠️ 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
  • Deleting duplicate components

    8
    0 Szavazatok
    8 Hozzászólások
    4k Megtekintések
    sdmitchS
    @bjornburgh said: Pasting the Script in the Ruby console doesn't work. Is there another way? def remove_instances_duplicates defs=Sketchup.active_model.definitions to_delete=[] defs.each do |compo_def| next if compo_def.internal? instances=compo_def.instances instances2=instances instances2.each do |i2| keeping_instance=instances.shift instances.each do |instance| if instance != keeping_instance and instance.transformation.to_a == keeping_instance.transformation.to_a and instance.definition.insertion_point.transform(instance.transformation)==keeping_instance.definition.insertion_point.transform(keeping_instance.transformation) to_delete.push(instance) puts "Erasing duplicate instance of " + instance.definition.name end end end end to_delete.each { |inst| inst.erase! } end There was an extra "end" in the code. Removing that should fix the problem. After pasting into the Ruby Console, press Enter then type in "remove_instances_duplicates" to execute.
  • Any way to install two copies of SU (same version)?

    17
    0 Szavazatok
    17 Hozzászólások
    4k Megtekintések
    T
    If you are really serious about running another copy or another version of SU, without it interfering with the registry then you should consider virtualization a version of your SU software. https://my.vmware.com/web/vmware/downloads Example: I'm currently using SU 2015 as my main workhorse for daily work. Having found out that SU 2016 wont run many of my Ruby scripts. I created a virtual copy of SU 2016, also known as a Portable version, using vmware. Warning: this process should not be attempted without a good understanding of Windows and what virtualization is. Here is a short description of how I make a portable copy. I always have a fresh bootable install of Windoz only, on a new UBS3 HDD I install vmware and SketchUp on 1 3, With vmware running I make a new Bootable copy of SketchUp Now I can run a portable version of SketchUp from my USB3 HDD or move that Portable to any other HDD If you are competent in using vmware you can make versions that allow you to add addons scripts to your portable version, this is very important. good luck!
  • PickHelper does not pick elements outside active context

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    C
    Thanks for picking up the question ThomThom I'm developing a measuring tool and part of the functionality lies on the capability of the tool to make a quick measurement no matter what context you are into. Currently I'm getting the information via pickpoint but I'm having hard time trying to get rid of the interferencing and also confuses me a lot when the cursor is over a face but one or more edges are just behind that face because my draw method to highlight either the face or the edge goes crazy when underneath the cursor are to much geometry happening. I wanted to implement a method using pickhelper but the not picking outside active context thing stopped me. The tool angleinspector from fredo marvelously does exactly what I want to achieve and I'm trying to mimic that functionality but without success. http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=67058 Here you can see a gif describing my problem. Saludos
  • Problem sending PM?

    4
    0 Szavazatok
    4 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @slb_jwm said: In any email client I've used, ... This is an online messaging board, not an email client. (It just happens to have an optional email echo feature.)
  • Open sketchup from Excel VBA and run ruby code

    6
    0 Szavazatok
    6 Hozzászólások
    3k Megtekintések
    Dan RathbunD
    @davesexcel said: Thanks, I think I understand the concept, from excel vba we are opening sketchup and passing on a variable that a plugin will recognize to run the plugin? I think Jim explained it better and more detailed.
  • Commissioning/Developing a Plugin

    3
    0 Szavazatok
    3 Hozzászólások
    823 Megtekintések
    M
    Hi Jim, essentially, yes what you described at the end of your reply is correct. I would like the ability to reorder and rename dynamic parameters of dynamic components, as well as all of their nested children parameters and so on. Regarding your previous question, a master template in this context is the way that I've been building my DCs to this point. I'll build a functioning component, and then save off each part so that I can create variants, and still have all the same parameters. So as an example, lets say I've built a window that cuts into a surface, and showcases a single hung window. I've been saving off the window child component, creating a casement version, and swapping then back and forth to ensure they work flawlessly, and minimize the file size of the component. I can attach an example when I get back to a computer. The fact I said I'd be needing to make constant revisions may be an exaggeration, but my view is this: I'll be overhauling the use of SketchUp in the office to a more standardized system, and as users begin to adopt DCs and they become more useful, I may need to add features that I did not plan out or set aside in the first roll out of DCs. Adding new features shouldn't be too difficult, but seeing as how the order of the exposed parameters is reliant on alphabetical order in the DC options dialog, I don't see any other way to re-order them other than either manually renaming all the params through parent and child level components, or coming up with something more clever. Hopefully that makes sense, let me know if anything isnt clear. Thanks! Sent from my VS987 using Tapatalk
  • SKUI - Retrieve text from Textbox when clicking button

    5
    0 Szavazatok
    5 Hozzászólások
    1k Megtekintések
    F
    Exactly Dan, that was one of my mistakes. Finally I got it by myself, and now I understand the basics. Thank you in any case.
  • Polygon Tool

    8
    0 Szavazatok
    8 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    Angle snapping works for rotational tools or tool states. Length snapping would work for linear tool states.
  • VCB and Shortcut Keys

    34
    0 Szavazatok
    34 Hozzászólások
    6k Megtekintések
    icehuliI
    additional observation: If onKeyDown or onKeyUp returns true then onCancel is not triggered. It is blocked by onKeyDown/onKeyUp as well.
  • "magic wand"

    13
    0 Szavazatok
    13 Hozzászólások
    4k Megtekintések
    JQLJ
    For architects rendering output is needed, but sketchup output might be also worthy. I want my trees to project shadows, so I can study the project. There is also the fact that cast shadows from a 2d face me component, isn't compatible with renderers and sometimes you get thin flat shadows as shadows don't face sun. In my proposed solution the 2nd model can be a fairly rough 3d which casts 3d shadows that work. You can check a bit more about it here: http://sketchucation.com/forums/viewtopic.php?f=40%26amp;t=64471%26amp;p=591460%26amp;hilit=2.5d+components#p591460
  • What Motivates You?

    15
    0 Szavazatok
    15 Hozzászólások
    2k Megtekintések
    medeekM
    What motivates me with programming plugins is that it allows me to be creative and create something that never existed before.
  • Please help me to get a group's layer

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    L
    Thank you Masters. I have another problem: I wrote code to make BOM base on ComponentReport of TIG. Then I place data on a html datatable.So I have to replace all "\n" by "<br>" like this: des=c.definition.description des=des.gsub("\n","<br>") Then the datatable looks good. Then I save data in a .xlsx file. Still look good when openned in Excel. But when I inserted it to LayOut, it create "x000D" before every new line in cell. Please help me how to solve this. Thanks a lottt.
  • Get data from already opened workbook

    4
    0 Szavazatok
    4 Hozzászólások
    854 Megtekintések
    D
    Wow, I got it to work!! require 'win32ole' xl = WIN32OLE;;connect('Excel.Application') xl.visible=1 worksheet = xl.Worksheets(1)
  • Insert Picture into excel

    3
    0 Szavazatok
    3 Hozzászólások
    949 Megtekintések
    Dan RathbunD
    ~ (1) Only write to paths that the user has write permissions on. @davesexcel said: # Puts in SketchUp install directory by default This path is a binary program path and the normal user does not have write permissions there. This is not the default path for Ruby when SketchUp v13+ is running. After SketchUp loads Ruby and it's API, it sets the working directory to the User's "Documents" directory. SketchUp 2013 and higher: Dir.pwd %(green)[#=> C:/Users/Dan/Documents] SketchUp 8 and earlier just left the current working directory in SketchUp's program path (which was a bad thing.) (2) In code when you are doing a write then read, you need to wait until the file is finished being written, and the OS file system advertises that it is "ready" and available. (ie, the old file handle is closed.) The Ruby standard File class has some class methods to help you determine if paths are readable or writable by the current user, and whether the OS reports if the file is finished being written (ie, does it exist yet?) def image_from_model( write_path = 'S;/Stairs/Stair Pics/', keys = { ;filename => 'write_image.jpeg', ;width => 500, ;height => 400, ;antialias => false, ;compression => 0.5, ;transparent => false } ) return false unless File.writable?(write_path) image_path = File.join( write_path, keys[;filename] ) keys[;filename]= image_path model = Sketchup.active_model view = model.active_view view.zoom_extents Kernel.sleep(2.0) # wait for view to redraw view.write_image(keys) @tid = UI.start_timer(0.5,true) { if File.exist?(image_path) UI.stop_timer(@tid) insert_to_excel(image_path) end } end def insert_to_excel() xl = WIN32OLE.new('Excel.Application') xl.visible=1 wb = xl.Workbooks.Open('C;\TestFolder\Test2.xlsx') worksheet = wb.Worksheets('Sheet1') worksheet2 = wb.Worksheets('Sheet2') worksheet.Range('a1').Value=12 worksheet.Range('a1;b4').Value #-----Pictures Insert Code--------------- pic = worksheet2.Pictures.Insert('S;/Stairs/Stair Pics/write_image.jpeg') range = worksheet2.Range('A1;F15') pic.ShapeRange.LockAspectRatio = false pic.Top = range.Top pic.Left = range.Left pic.Width = range.Width pic.Height = range.Height # write done message to SketchUp console; put "Finished inserting image in Excel." end
  • Bugsplat in Sketchup 2017 when manipulating groups

    2
    0 Szavazatok
    2 Hozzászólások
    794 Megtekintések
    TIGT
    Unfortunately v2017 changes the way references can be got and reused. A few pointers... Use: entities = model.**active_**entities Also you can 'grep' to filter many kinds of 'collections' thus: puts face = entities.grep(Sketchup::Face)[0] return nil unless face The 'face' reference is lost in v2017 after the 'explode', instead consider this... group.explode puts face = group2.explode.grep(Sketchup::Face)[0] Now 'face' is a different, but valid, reference... I added the 'puts' to print the references in the Ruby Console. In < v2017 they should be the same, but in v2017 they will differ. This issue has meant that many authors have had to recode some of their plugins to accommodate the changes...
  • [Code] Material picker

    14
    0 Szavazatok
    14 Hozzászólások
    3k Megtekintések
    sdmitchS
    @dan rathbun said: I looked in my 2016 Plugins folder and found what I had working last June 2016. It seems to work for me on SU2016. Thanks Dan. I have come up with a different solution to what I was attempting and it works with all versions.
  • Ruby saveas .XLSM, format code

    5
    0 Szavazatok
    5 Hozzászólások
    2k Megtekintések
    Dan RathbunD
    I did a search in the MS Excel Dev forum on "+SaveAs +xlsm +UndefinedConversionError", and got 947 hits. (You can browse those yourself.) https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=exceldev%26amp;filter=alltypes%26amp;brandIgnore=True%26amp;sort=relevancedesc%26amp;filter=alltypes%26amp;searchTerm=%2BSaveAs+%2Bxlsm+%2BUndefinedConversionError At this point I would double-check that any macros in the Workbook do not have errors, that could give the file export routine issues.
  • Get a list of File names on the input box

    9
    0 Szavazatok
    9 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    OH! I see your booboo: inputbox always returns an array (except when the user cancels it returns false. So always check the result boolean-wise.) input = UI.inputbox prompts, defaults,list, "File Name" return unless input j = input[0]
  • Coping with SU2017 entity handling changes

    9
    0 Szavazatok
    9 Hozzászólások
    1k Megtekintések
    Dan RathbunD
    @sdmitch said: I have tried using .clone and .dup but neither remedy the problem. Any guidance will be greatly appreciated. These two methods are Ruby Core functions that rely upon specific Ruby housekeeping methods to do the copying. The SketchUp API has not set up these "housekeeping" methods, so doing this will not work. They have only in a few places "mimicked" a clone method (mostly in the Geom classes,) and a partial cloning in Group#copy. (It does not copy over attributes and other parameters.)
  • No Implicit Conversion fron String in Messagebox

    7
    0 Szavazatok
    7 Hozzászólások
    1k Megtekintések
    TIGT
    ALL of SketchUp's internal database lengths are stored in inches, irrespective of the units you use. In the API there are the numeric and length classes. So if you have an input value that defaults to a 'length' - e.g. 9.feet, or any other units format - then it is always 'stored' and 'processed' in inches [9*12=108"]. However, this is flexible as the user can input in any units provided they use a units suffix: however how it's displayed in the input-box depends on the current model info > units settings... Otherwise you need to default to a string value and then reverse-engineer that - e.g. h="9" [read from the input[1]] which you then reset for later use as a parallel value hft=h.to_f.feet So the input is always taken as a decimal-feet value, but then used in inches internally...

Advertisement