sketchucation logo sketchucation
    • Login
    1. Home
    2. niccah
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ”Œ Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download
    N
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 18
    • Posts 90
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Group in a group in a group... - transform point to outside?

      Okay, sorry, let me explain the situation a little more in detail...

      An user choose any "things" in the Sketchup Model. Things: Groups, faces, lines etc

      My plugin should collect every face selected and give all the coordinates of these things. But important: the coordinates have to be based on the outside coordinate system.

      So, there could be a possibility that the user choose a group with a lot of groups inside, with a lot of groups inside... ... with faces inside => thats my problem, to get easy the outside coordinates of these faces.

      posted in Developers' Forum
      N
      niccah
    • RE: Group in a group in a group... - transform point to outside?

      Oh, this sounds more complicated then expected...

      I'm thinking about this way:

      I take the outer group and explode them... Lets think about this situation:

      - Group 1 ___- groupA ____- faces, points etc ___- groupB ____- faces, points etc ___- groupC ____- faces, points etc

      What will happen, when I explode Group1? Will I get all the faces and points in the deepest groups? Or will I get the three groups (groupA, groupB, groupC)?
      Means: When I explode an other group, will I explode all inner groups too? => that would be great! πŸ˜„

      Thanks for your help!!

      posted in Developers' Forum
      N
      niccah
    • Group in a group in a group... - transform point to outside?

      I have the following situation:

      an user can have a group with a lot of groups inside. Each inside group can have again several groups inside... the deepest group contains faces, points etc..

      My function will get a face (for example), so at first, I don't know in how many layers of groups this face is.

      However, I would like to transform the points in the deepest group to the outside Sketchup axis.

      Do you know a elegant way to do that?

      I hope, I could explain my problem understandable enough! πŸ˜‰

      Thanks for all your help!

      posted in Developers' Forum
      N
      niccah
    • RE: Win 7 to Win 8 => no system() anymore...

      @thomthom said:

      that adds that folder to the $LOAD_PATH array

      I never stop learning! πŸ˜„ Thanks, I will try it...

      Using Win 7, editing the files wasn't a big problem...

      posted in Developers' Forum
      N
      niccah
    • RE: Win 7 to Win 8 => no system() anymore...

      @aerilius said:

      UI.openURL("/path/to/file.bat")

      Ahh, I remember - you told me this method some month ago! Thanks for this hint! I will try it at home...

      And in the bat file I will write just: java -jar Model2GCode.jar ?

      So, if I can write the bat file with ruby, then I can insert very easily the arguments into it...

      posted in Developers' Forum
      N
      niccah
    • RE: Win 7 to Win 8 => no system() anymore...

      @tig said:

      Have you tried
      system(java -jar Model2GCode.jar)
      Have you also tried this
      pwd=Dir.pwd Dir.chdir(Model2GCodeJarsFolder) system(java -jar Model2GCode.jar) Dir.chdir(pwd)
      to ensure it finds the .jar file ?

      So, at first: thank you very much for your help!

      I tried follow things:

      odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system("java -jar Model2GCode.jar")) Dir.chdir(odir)

      odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system('java -jar Model2GCode.jar')) Dir.chdir(odir)

      odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system('java -jar ' + File.join(File.dirname(__FILE__), 'Model2GCode.jar')) Dir.chdir(odir)

      @Thom: Should I send you this jar-File? It would be great, if you can test it on your machine!

      One other idea:

      • since Win 8, I'm not able to edit the plugin files with my editor, just in admin mode (arg)
      • so I think, Win 8 increased the "security levels" => could it be: for the ruby application it is not allowed anymore to start the command line?

      Thanks a lot!

      posted in Developers' Forum
      N
      niccah
    • Win 7 to Win 8 => no system() anymore...

      Hey!

      I have a strange problem again...

      I switched from Windows 7 to Windows 8. Now, I would like to start my external Java application, but without success!

      UI.messagebox "a" output = system("java -jar Model2GCode.jar") UI.messagebox "b"

      "a" and "b" is shown normally in the UI.messagebox. But no command line!

      When I started the jar-file manually in the command line, it works...

      Do you have an idea, what's different in Windows 8?

      I thank you very much for your help!

      posted in Developers' Forum
      N
      niccah
    • RE: Attributes in Sketchup - Probably a stupid question

      Hi Frank!

      I don't know, but could it be, that get_attribute() is case sensitive? You are writing "test" but 'Test' in your UI.messagebox?!

      Just an idea...

      posted in Developers' Forum
      N
      niccah
    • RE: Adding new options or OptionsProviders?

      @dan rathbun said:

      @niccah said:

      @thomthom said:

      Then attach an attribute to the model.
      https://developers.google.com/sketchup/docs/ourdoc/entity#set_attribute

      This sounds perfect! πŸ˜„ Thanks Thom!!

      punchbug! I said that also ...

      I have to say sorry, Dan! At your post, I stopped to read at the horizontal line... I though it is not the topic of the post! ... πŸ˜„

      posted in Developers' Forum
      N
      niccah
    • RE: Adding new options or OptionsProviders?

      @thomthom said:

      @niccah said:

      the projects are connected to a single Sketchup file... so I don't like to "flood" the registry with lots of project names and their options... What do you think?

      Then attach an attribute to the model.
      https://developers.google.com/sketchup/docs/ourdoc/entity#set_attribute

      This sounds perfect! πŸ˜„ Thanks Thom!!

      posted in Developers' Forum
      N
      niccah
    • RE: Adding new options or OptionsProviders?

      @dan rathbun said:

      [size=120]The NamedOptions Provider is bugged.
      Please do not use it until it is fixed

      Oh, I didn't expect, that the answer is so easy! πŸ˜„ Thanks Dan!

      @dan rathbun said:

      If you want this 'list' to be 'universal' and accessible to every SKP opened on that PC then use Sketchup.write_default() and Sketchup.read_default() to store a list of project names.

      Hm, I thought about that, but....

      the projects are connected to a single Sketchup file... so I don't like to "flood" the registry with lots of project names and their options... What do you think?

      Can I produce an empty group or something like that and fill its "description"?

      posted in Developers' Forum
      N
      niccah
    • RE: Adding new options or OptionsProviders?

      Okay, I have further problems... Let me explain, what I want to do....

      I would like to do a list of "projects". So, when someone add a project, a new option key will insert. The name of the key: "M2GC_projects_" << projectName

      So, at the end, I have a list of all projects by checking of the optionsProvider.

      ` optionsManager = Sketchup.active_model.options
      optionsProvider = optionsManager["NamedOptions"]
      optionsProviderKeys = optionsProvider.keys

      	projectName = dlg.get_element_value("projectName").delete("^a-zA-Z0-9");
      
      	if (projectName != "" && !optionsProviderKeys.include?("M2GC_projects_" << projectName))
      		optionsProvider["M2GC_projects_" << projectName] = ""
      
      		dlg.execute_script("addToProjectList('" + projectName + "')")
      		dlg.execute_script("document.getElementById('projectName').value=\"\"")
      	else
      		UI.messagebox "Project name already in use"
      	end`
      

      It sounds very strange, but I am able to insert just ONE key each "session". So, I try to insert several keys => no error in the ruby console. Now I save the Sketchup file. Close Sketchup. Open Sketchup again... just the first inserted key is now available. Now, I can insert a second value... by reopen Sketchup, both are now available...

      Guys - whats happening here?! πŸ˜„ I'm totally confused...

      Thanks for your help!

      posted in Developers' Forum
      N
      niccah
    • RE: Adding new options or OptionsProviders?

      I have to refresh this topic again!

      I am able to add new key for the optionsProvider "NamedOptions". The problem is: When I insert a new key and the user close Sketchup, there will be no notice to save the Sketchup file.

      Do you have an idea how I can handle this problem?

      My idea: I have to ask the user to save the file when the WebDialog gets closed

      What do you think?

      Thanks!

      posted in Developers' Forum
      N
      niccah
    • RE: Allow to start a plugin just once

      Sometimes, it is so easy! πŸ˜„

      Thanks TIG!!

      posted in Developers' Forum
      N
      niccah
    • Allow to start a plugin just once

      I'm wondering, that I can't find a nice solution, to allow to start a plugin just once.

      So, with the help of my plugin, I start a WebDialog... How I can ask, if there is the same WebDialog already opened?

      I think, this should be very easy, but, sorry...

      I tried:

      if (!defined? dlg) dlg = UI::WebDialog.... else dlg.bring_to_front

      But with this version, I am able to start several WebDialogs...

      Thanks for your help!

      posted in Developers' Forum
      N
      niccah
    • RE: Start a Java application asynchronous

      @dan rathbun said:

      Try:

      path = File.dirname(__FILE__)
      > cmd = 'java -jar '<< File.join(path,'Model2GCode.jar').inspect << ' ' << File.join(path,fileForJava).inspect
      > UI.openURL(cmd)
      > 
      

      P.S.: Use the << string append method, rather than the + concat method.

      Hm, nothing hapens, when I tried this... no error from ruby, no opening window for the java... I'm a little bit confused?!

      UI.openURL: "The openURL method is used to open the default Web browser to a URL." => are you sure, that I have to use UI.openURL?

      posted in Developers' Forum
      N
      niccah
    • RE: Start a Java application asynchronous

      @thomthom said:

      @dan rathbun said:

      There is another topic where you (TIG) describe how to write out a command file and execute it with UI.openURL.

      http://sketchucation.com/forums/viewtopic.php?f=180&t=48761

      ❓

      Puh, this sounds complicated!

      I think, I will try Dans version and pass the arguments via temp. text file. This should be independent of the operation system...

      Thanks for your ambitious help!!

      posted in Developers' Forum
      N
      niccah
    • RE: Start a Java application asynchronous

      @tig said:

      I've found that running a jar with a full-file-path fails, but running it by name when already in its folder will work - not exactly sure why, but it works - presumably because '-jar' only expects a file name and not a full-file-path ?

      Ah okay! Now, a further question... the java app starts fine. But Sketchup is waiting for the result... so, what can I do, to solve this?

      posted in Developers' Forum
      N
      niccah
    • RE: Start a Java application asynchronous

      Oh TIG, you are the best! Thanks a lot!

      Why your version works, and my version not?

      @tig said:

      Try doing a temporary change to the jar's directory thus ?
      odir=Dir.pwd Dir.chdir(File.dirname(__FILE__)) output = system("java -jar " + "Model2GCode.jar " + fileForJava) Dir.chdir(odir)
      I've not tested it πŸ˜•

      posted in Developers' Forum
      N
      niccah
    • Start a Java application asynchronous

      Hi at all!

      I'm trying to start a Java application from Ruby. I just want to start it. I'm not waiting for results and it doesn't matter how long the application takes.

      So, I wrote

      output = system("java -jar " + File.dirname(__FILE__) + "/Model2GCode.jar " + fileForJava)

      It opens the cmd just for a half of a second. Nothing else happens.

      When I write "java -jar " + File.dirname(FILE) + "/Model2GCode.jar " + fileForJava" in the command line, everything is fine.

      Do you have an idea, what could be the problem? I though, system() just starts the cmd and write the content... ?!So, it should be same, as when I write it by myself in the cmd.

      Thanks for your help!

      posted in Developers' Forum
      N
      niccah
    • 1 / 1