sketchucation logo sketchucation
    • Login
    1. Home
    2. niccah
    3. Topics
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    N
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 18
    • Posts 90
    • Groups 1

    Topics

    • N

      Model2GCode - who would like to continue?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      669 Views
      J
      I made a Bitbucket repo for this code before the Model2Gcode site went offline. My intention is only to preserve the code. https://bitbucket.org/jimfoltz/model2gcode
    • N

      Set alpha of a face without material

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      198 Views
      N
      Oh, okay, this is a nice trick... I think, I will get a lot of problems, when Sketchup crashes... What do you think about this idea: I will create for every face, which has a material != nil a new material => name: face.to_s To show the faces again, I will remove the materials again...
    • N

      [Plugin] Model2GCode V0.5 - released 04.02.13

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      13
      0 Votes
      13 Posts
      9k Views
      N
      @joergber said: Hi Tobi, thank you for sharing! Unfortunately I am not able to make it work ... (I only tried v0.5!) In milling mode 'Surface' I'm getting an error from the Java cmd prompt: Error: Wrong surface part argument! In milling mode 'Pocket' I'm getting an error from the Java cmd prompt: Error: 1 In milling mode 'Cut out' I'm getting an error from the Java cmd prompt: Error: Wrong cutout part arguments! And with mouse over the added parts the shown milling options seem to be screwed up ... The milling options and the milling mode seem to be incorrect. I would really like to make this thing work!!! Moin, Jörg Hi Jörg! So, we discussed a lot via email. I would like to "present" the result of our discussion. The problem was: to cutout something, a 3D model is necessary. Just a single plane is not enough. I hope, I can "fix" it in the next version.
    • N

      Empty groups get deleted?!

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      19
      0 Votes
      19 Posts
      533 Views
      Chris FullmerC
      @niccah said: The user would like to create a project => so, somewhere I have to save this information about the projects (name, options, etc, ..). And the user could create a project and close Sketchup => so, the information about the new project has to be saved somewhere "for ever". Use an attribute dictionary to attach information to the model. It will stay with it after the model is closed and opened. Single Dictionatires http://www.sketchup.com/intl/en/developer/docs/ourdoc/attributedictionary Collections of multiple dictionaries http://www.sketchup.com/intl/en/developer/docs/ourdoc/attributedictionaries This is a much more stable way to maintain data in the model from session to session. Chris
    • N

      Will this work on Mac OS?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      137 Views
      D
      hi, you may need a java version test, as mac no longer ships with it pre-installed, it does however recomend installing as part of the start-up sequence. so, from ruby console java_version=(`java -version 2>&1`).split("\n")[0].to_s.split[-1] "1.6.0_37" john
    • N

      Easy way for offset of a face

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      132 Views
      N
      Thanks a lot Chris! Okay, no problem, then I start with my ideas! In my case, I have always faces with z = 0. So, I think, it should reduce the complexity of my project I will public my solution for other people...
    • N

      Two identical faces, but show just one

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      698 Views
      N
      At first at all, thank you very much for all your help! I will try it at weekend. @thomthom said: But... why do you even have two faces overlapping anyway? It's generally something to avoid in any 3d modelling. Following situation in my plugin: you have a model you choose a part of this model, which you like to get milled (for example a pocket) after you have choosen it and add it to the "milling list", my plugin will copy this choosen faces into a hidden group when you click on the list, the "to be milled" faces (I collored it green) will be shown with the help of the hidden faces, the plugin is independent of the real model => so, before calculating the GCode, the user is allowed to change the model itself I hoped, I could explained my situation understandably
    • N

      Group in a group in a group... - transform point to outside?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      25
      0 Votes
      25 Posts
      2k Views
      N
      I think, I solved the problem - but I don't know exactly, what WAS wrong... I saw, by copiing the selected faces into a new group, not every face has the original direction. So, I changed my Face.copy function (I know, its not good to change the Face.class, but I will solve THIS problem later) in that way: outer_face = ents.add_face ov outer_face.material = "green" if outer_face.normal != self.normal outer_face.reverse! end Now, all the faces have the right direction and now the problem with the offset of the points is gone. But, to be honest, I have realy no idea, how these two problems correlate! And it doesn't help, to change the direction of these faces by hand - the problem stays! Just by copiing all the faces again, the problem of the offset is gone! Do you have ANY idea what's going on? I thank you sohhhhh much for all your support!!! You helped my realy a lot!
    • N

      Win 7 to Win 8 => no system() anymore...

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      10
      0 Votes
      10 Posts
      187 Views
      Dan RathbunD
      @pixero said: @thomthom said: ... I then add a .rb file in the Plugins folder that adds that folder to the $LOAD_PATH array and then loops over all the rb and rbs files to load them. That way I'm working on my plugins in a location where I have full permissions. Could you please post how that file looks in its entirety? I would like to get that to work for me as well. @Pixero, and anyone else.. I have already posted such a script, ready-made for you to modify with your custom paths, be it a dropbox or just folders in your "user/documents" path (which you will always have full permissions to.) In addition, it adds an autoload feature that looks for sub-directories named " %(#408000)[!_autoload]", in ALL of the $LOAD_PATH directories, and if found, will call require on any loadable files it finds. I do this because this way you KNOW what files (in those custom paths,) will be automatically loading. Here's the link: [Code] !autoload.rb loads "!_autoload" folders
    • N

      Allow to start a plugin just once

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      4
      0 Votes
      4 Posts
      78 Views
      Dan RathbunD
      @tig said: Then later use @dlg to change its url, show it etc, and set/reset all other options available etc... This is important! The dialog instance is not destroyed when you close it. You can re-open it again. And if you had data from the dialog, stored in Ruby vars, you can reset them back into the dialog's Javascript vars, after it reopens.
    • N

      Start a Java application asynchronous

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      981 Views
      TIGT
      As I explained... Dan's idea of opening [executing] a file, can't work by passing a 'command' or even an exectable with following arguments, it will only work if you pass it a file. So UI.openURL(full_url) opens that web-page in the default browser. And UI.openURL('file:///'<<full_path_to_file) opens that file in its default application, so if it's a .txt file then Notepad opens it, if it's a .doc file then Word opens it and so on [for a PC at least]. If it's an 'executable' then it 'runs' - these kinds of file include .exe, .cmd, .bat, .vbs etc on a PC [.command on a MAC etc]. Some executables take arguments when they are run from a 'shell'/'console'/'terminal' - e.g. in a PC command-shell typing Notepad[.exe] opens that program with a new empty/untitled window; but Notepad "txt_file" would open that file if it exists, or if it doesn't exist it asks you if you want to make it... BUT you CAN'T pass arguments with UI.openURL() So UI.openURL("Notepad.exe") will open an instance of 'Notepad' [true] UI.openURL("\"Notepad.exe\" \"path_to_my_txt_file\"") will fail [false] UI.openURL('file:///'<<"path_to_my_txt_file") will open that existing txt file with Notepad [true] or it will fail [false] if that txt file doesn't exist. Using system(commands) in Ruby should give similar results to typing the exact same text into a command-shell - hence Dan's advice to 'quote' arguments - because 'spaces' in file paths will be taken as the start of a new argument otherwise and mess you up... So using system(system("\"Notepad.exe\" \"path_to_test.txt\"")) is the same as using the very same strings inside a command-shell... BUT this runs as part of the Ruby thread, and Ruby will wait for it to complete... The way to pass arguments to an external executable, that runs independently of Ruby once it's started, is to run it as something like a .cmd/.bat [.command on MAC]. You can't avoid the startup black PC window [although you can reduce it to a flicker by having one .cmd file to start another main .cmd file, the first opens and closes almost instantaneously while the second then runs silently]. So you can write a temporary .cmd' file [etc] then use UI.openURL('file:///'<<path_to_cmd_file) to run it [also changing directory briefly to the file's folder does allow you to 'open' it 'by name only'...] If you use some other kinds of executables like .jar or .vbs these can be set to run 'silently' - however, passing arguments to them is then awkward [although you could 'write' a temporary .vbs file etc containing ALL of the info needed to complete things*, or perhaps use an .ini. file containing the data needed by the .jar to read in for that to do it's stuff; on a MAC you would use an AppleScript or equivalent]. *For a 'silent' VBS solution you would use something like this line of code that you 'puts' into a 'temp.vbs' file... createobject("wscript.shell").RUN "java -jar \"full_path_to_Model2GCode.jar\" \"full_path_to_fileForJava\"", 0, False Obviously you need to adjust it for you own full file paths/names etc... Then in Ruby you'd use UI.openURL('file:///'<<"full_path_to_temp.vbs") to run it - and it then executes asynchronously, quite separate from Ruby...
    • N

      UI::WebDialog =&gt; set_html =&gt; large HTML pages

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      2k Views
      N
      Thanks guys for the hints! I got a message from Noel!
    • N

      Add_edges with a LOT of edges

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      11
      0 Votes
      11 Posts
      187 Views
      TIGT
      Yes.... but... Small edges can exist quite happily, it's just using them that is problematical. So if he has completed all changes/processing, then I believe that rescaling the geometry is best, but if further changes are wanted then any [re]scaling needs to be avoided until all processing is done anyway...
    • N

      Newbie question - execute jar file in ruby

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      16
      0 Votes
      16 Posts
      3k Views
      Dan RathbunD
      Hmmm... OK. Yes, actually it's Ruby 1.8.x itself that uses "green threads" instead of native threads. You might have more luck using a OLE interface to the java. See: [Plugin Library] Win32API and Win32OLE so files and: WIN32OLE rdoc
    • N

      Multithreading - Queue?!

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      569 Views
      N
      @thomthom said: Do you have a snippet of multi-threaded SketchUp Ruby code? I'd be very interested! hehe, okay, here it is.... @unknownuser said: facesCount = FACE.length # wieviel Flächen habe ich? $facesPerThread = facesCount.divmod($opt.cpuCores.to_i) # Wieviel Flächen bekommt jede CPU? thread = Array.new $j = 0 $opt.cpuCores.to_i.times do |i| $k = ($j-1) + $facesPerThread[0] # Der Rest der Flächen wird noch auf die einzelnen CPUs aufgeteilt if $facesPerThread[1] > 0 $k += 1 $facesPerThread[1] -= 1 end #UI.messagebox $k thread[i] = Thread.new do for l in $j..$k do #UI.messagebox FACE[l] out = FACE[l].isInCylinder break if out end out end # Startpunkt für den nächsten Thread $j = $k + 1 end thread.each do |tmp| tmp.join end I tested it with some simple models and I saved some single seconds.... not too much, but faster then without any threads.... I'm very interested to hear what do you think about it...
    • N

      Group the selected entities and give them a name[Solved]

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      186 Views
      TIGT
      Nothing! Just to make reading it easier ? Note that gp=some_entities.add_group(some_stuff) is ONLY successful if all of the some_stuff entities are in the some_entities context AND it's the active_entities: otherwise you'll Bugsplat! So it's fine when you are adding a selection to a group in the same entities - as to select them they must all be in the same [active] entities context and you make the new group in that context too. Just be wary of grouping groups and adding things that are in one context into another context - to do that IS possible but involves either complex 'cloning' of geometry OR getting the definition of groups/instances and repeating their instances [temporarily] in the new context before erasing the original one[s]...
    • N

      Min. z value of some points

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      182 Views
      D
      Yes, readability. If it was operating on large quantities of data, I would definitely use your suggested method.
    • N

      Global vertex position fails, when I pull a face

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      162 Views
      thomthomT
      Note that the method doesn't transform the point itself - but returns a copy.
    • 1 / 1