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

    Posts

    Recent Best Controversial
    • RE: BoundingBox.depth. Accurate?

      Ah, thanks.

      Doing some tiling with thoose mesurements. Should be ok then..

      @unknownuser said:

      The internal unit is converted to user units only in the UI

      That's why I got back different results in the ruby console when changing the Model precision.
      Maybe that goes for some other mesurement as well, havent just thought about it until now.

      @unknownuser said:

      When dealing with user units, make the Length class do the work for it. And make sure you know if your objects are Floats or Lengths.

      I'll try to stick to that.

      posted in Developers' Forum
      jolranJ
      jolran
    • BoundingBox.depth. Accurate?

      The API says The depth is returned in the currently set units (inches, by default).
      The same goes for width and heigth(which is not necessary Z axis).

      So question is how does Sketchup handle the digits internaly in this case? 0,001?
      I mean if I set a variable bbox=group.boundsand@x_length=bbox.depth. Is it a consistent method of mesurement?

      Or is Units precision set in the Model prefs dictating the return value.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: (solved)locked files

      OOPs πŸ˜„

      There was a typo in my code. Now the comps are loading(hopefully).
      Forget the last post.

      Edit: Problem solved by saving components(like Dan said) in user/my documents/anyfolder.
      Then I can copy and paste from there.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Need Bird Mouth ruby for Rafters

      Looks like a nice plugin you've created there, Voljanko.

      posted in Plugins
      jolranJ
      jolran
    • RE: (solved)locked files

      No, still don't work as expected. Probaly some win7 issue. But whats tripping me up is that it is happening all of a sudden.

      Now the skp files look OK in the browser. Same rights and fileattributes etc. But the new files don't show up when I create a list of names for a webdialog. Rebooting doesent help.

      To explain further I have a folder (something like: Plugins\JOLtest\Std_comps) where there are specific Hatch components.
      Last month or so I put some components there for testing, and their name show up in the dialog just fine. Yesterday I tried to add a few more and this happend(read topic).

      I'm using this simple Ruby code to get the components name to string array. For using it in Dialog. It works ok, since this folder will only contain specific Hatchcomps.

      
      def getComps(folder)#sorts .skp files to strings to array 
      			
        comps=[] 
        path = File.expand_path( File.dirname(__FILE__) )
        path = File.join( path, folder ) #gets foldername from methodcall.
        std_list=Dir.entries(path)
        std_list.to_a.each{|fil| #return list as string if str. has ".skp" in it.
           if fil.include? ".skp"
              comps << fil.chomp(".skp") #remove ".skp" extension name
           end
        }
        compList=comps.sort.join('|') #join each listitem with "|". 			
        return compList
      end
      
      

      And then in a callback do an execute script like:

      @my_dialog.execute_script(%(document.getElementById("std_list").value="#{getComps('JOLtest\Std_comps')}";))
      

      Although I don't think the code is relevant to this problem, I'm just showing it so it's clear whats going on.

      Edited: BTW I can drag the "Nonworking" components into Sketchup(from folder), so they are not corrupted in that kind of way.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: (solved)locked files

      Hi Dan, and thanks.

      Yes it appears to be Win 7 security issue as you say. Wierd..

      I was saving the files in Sketchup/Components.

      If I wasen't clear about what I was doing, In this case I was talking about saving the components manually, not by code. (Building a library for Hatchfaces).
      But thanks for the code. I'll think I'll need something like that further on, so you did not type it for nothing.

      Anyway, I saved the components in "User Documents path". Then moved them to desired folder.
      That did work. I can live with that..
      Just wonder if there will be any similar issues providing a plugin with a folder of premade skp files.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: (solved)locked files

      Yes. Different file name. And no change in icons when I close Sketchup.
      I acctually did a reboot to doublecheck. Still persists.

      @unknownuser said:

      The "locked" file icon would indicate that the file was currently in use by some application

      That could be helpful.

      Although my first intuition was that I somehow was creating components in a different(or wrong) manner than before. Or some strange pop in my settings.

      I can save a SKP file in the file browser "Save as". And that come through as a normal skp icon.

      Very strange indeed.

      Thanks for the help Dan. Will investigate further tomorrow. It's late..

      posted in Developers' Forum
      jolranJ
      jolran
    • (solved)locked files

      Hi.

      This is probably trivial and basic, but I gotta ask. It's driving me totally nuts.

      I've created some components and saved them. Now it appears a locked icon next to the file name in the browser πŸ˜• And I then cannot retrieve them with ruby..
      I wanted first to save a component with textures and thought that was the issue, but with or without materials the problem remains.

      And no, it is not locked in Sketchup when saving. Tried different things. Right click save as, saving from the component broswer, saving in different folders, etc..

      Funny thing, did exact same thing a month ago and fine. Haven't changed any security setting or something like that..


      locked.jpg

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Thank you Max.

      Glad you liked the style. It's quite easily changed if users would want so.

      @unknownuser said:

      I Hope you can treat us with a new test version at some point in the near future

      I'm working on it. Quite hard acctually, it's my baby. Can't give any dates, cause I'm not experienced enough in scripting to tell how long certain things will take πŸ˜„

      There is one thing that might pose some problems for the whole idea of the plugin.
      After intersections there are quite often errors. I don't think it has so much to do with the script itself creating errors, but as to Sketchups accuracy. Wich is 0,001 inches.

      It's really bugging me. Sometimes edges don't intersect with faces or small faces gets lost.

      My theory is that I'm importing components and tiling them and doing plenty of transformations, wich can lead to: Vertices and edges are lying outside a position tolerance of what Sketchup can handle(intersect).

      Compare that to using native Sketchup tools creating geometry. For ex drawing edges with the pen tool on a face, that would almost always give you tolerated vertice positions(unless you group and move them) for intersecting.

      Well that's only a theory. But I must solve the problem somehow.

      Hope that did not come out to negative Max. But as you can see there are still some work to do.

      posted in Plugins
      jolranJ
      jolran
    • RE: UI Menus - check boxes? multiple UI boxes at once?

      I think you might get more answers in the developping forum, asking this.
      But I'll give it an attempt.

      1. NO. You need Webdialog for checkbox. (very sad indeed)

      2. I'm guessing no, since we are doing promts. Prompts need to be delt with, and what you are saying you want to do, there is already 1 prompt running when you want to excecute another.
        Hopefully I'm wrong.

      However you can have multiple promts succeding each other.

      For ex(biased info), like Hatchfaces crosshatching. By dropdownlist user selects YES or NO for crosshatching and click OK on the inputbox, who closes.

      IF you clicked YES for "crosshatching", another different prompt pops up.

      Stuff like that. You can have a look at the code. TIG helped me with that, so it should be "OK" on that part..

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Yes, sure if you like.

      Think I'm ready with the base of the dialog. I'm porting it to Sketchup as of speak.

      There where a lot of Javascriptcode to get the interface responding to certain events. For ex if one checkbox is selected another element is disabled, and such.
      Using Jquery to help with DOM handling and events. And a spinnbox plugin.

      I'm also sending lists from Sketchup to Dialog. Materials, components and layers.
      Instead of hardcoding them in the HTML.
      For patterns the user will be able to create new components as long as they put them in correct folder. And maybe create a pic as well(optional).

      It's moving forward everyday actually. Slowly but steady. Will still have a lot of cleaning, testing and streamlining to do. But hopfully it will be a useful plugin.

      Here is a screencap from latest dialog version. The style is to keep the interface as "Sketchup" as possible. Opinions in this style would be nice.
      I could go crazy with colors but I kinda like this Sketchup style.


      webver_4.jpg

      posted in Plugins
      jolranJ
      jolran
    • RE: Yardoc for ruby api

      @unknownuser said:

      Did you know you can do online edits right on github? Should I sign you up?

      I'm afraid of messing things up 😳

      I mean, maybe it's best if these things are done by proffessionals.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: JQuery 1.7 Released

      Yes, I understand.

      I've seen your praising for it. That made me want to try to learn it in addition to standard JS.

      Can say.. Haven't been using Jquery for long(or JS for that matter), but only the selectors themself is worth the use of it.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: JQuery 1.7 Released

      Nice!

      Have you tried it and noticed any particular negative behavior, regarding using it with Sketchup ?

      Thanks.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Get form data from webdialogs?

      Aha! Scene manager πŸ˜‰

      Glad you sorted it out πŸ‘

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Get form data from webdialogs?

      Common Gateway Interface (CGI)?

      @unknownuser said:

      It may need to use the standard CGI lib from a full Ruby install.

      Ouch. That could be a lot to ask of users.

      • yet another thing to get into.

      Thanks for the head up anyway, Dan.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Unified Info for Noobies? Wiki?

      Yes, please.

      I speak for myself, but I think it is needed. Especially Step by step tutorials.

      Spent last months learning JS and the "webparts". But doesen't do diddley if one don't know how to communicate with Sketchup properly.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Get form data from webdialogs?

      So sending 1 large string object(JSON or whatever)in 1 go, to SKP ruby , is the way to go in all circumstances?
      (Like texture resizer is doing). And not several get_element_values in callback.

      It seams to me there are 2 ways of doing it, and that is confusing which one to choose.
      I've seen topic about the subject in this forum and its not easy determin whoose right..

      Get_element_value method is more straightforward and easier to understand than converting JSON.
      Maybe thats why JS noobies tend to go with this method first.

      @Dan

      @unknownuser said:

      WebDialog.post_url ??

      Is it a question if someone tried it? Or do you know it will work πŸ˜„

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Get form data from webdialogs?

      @unknownuser said:

      Though, I don't think you can get the checked state of checkboxes or radio boxes with get_element_value ... if I remember correctly...

      Bummer! Was axpecting that for upcoming tests.

      Anyway with some Jquery I got this to show (with get_element_value()) if a checkbox is checked.
      Assuming we have a hidden <div> with id="flipxcontainer".And a checkbox with id="flipx".

      function checkboxess(){
      		$('#flipx').change(function(){
      		
      			if ($(this).checked){
      				$("#flipxcontainer").val("flipxoff");
      			} else{
      				$("#flipxcontainer").val("flipxon");
      			}
      		});
      	}
      
      $(document).ready(function(){ //ONLOAD.
        checkboxess()
      });
      
      
      

      Then in the action callback(in ruby)

      flipx=@my_dialog.get_element_value("flipxcontainer") 
      			
      			if flipx=="flipxon"
      			 puts "it is checked"
      				else puts " it's not checked"
      			end
      

      It's higly unsofisticated, and I would like some comments if it's not a recommended method.
      I reckon this can be done with radiobuttons as well.

      Is there any issues making multiples get_element_values in a single callbackmethod?

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Yardoc for ruby api

      Yeah, this looks really great. Thanks for doing this!

      posted in Developers' Forum
      jolranJ
      jolran
    • 1
    • 2
    • 31
    • 32
    • 33
    • 34
    • 35
    • 51
    • 52
    • 33 / 52