⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • [Request]is there have a plugin can do like this?

    7
    0 Szavazatok
    7 Hozzászólások
    335 Megtekintések
    TIGT
    It's 'newer' NOT 'new'! It's been around for a while... Look for it in the 'Plugins Index' lists... 'LatticeMaker' works on premade meshes - it has a sibling in the Extrusion Tools tool 'EEbyRailsToLattice' that takes curves and makes the 'mesh-grid', and if option is selected it also frames/panes it...
  • Show webdialog quicker?

    24
    0 Szavazatok
    24 Hozzászólások
    624 Megtekintések
    thomthomT
    @chris fullmer said: Interesting, I would have just put it as modal for both. Modal just means it stays on top of all windows? No - in the Windows world it means that the child window blocks any interaction in the parent window while it is open. It also means that .show_modal doesn't return until the webdialog is closed. (Like UI.inputbox - where you continue with the code after you prompted the user.) But it's under OSX where the scheme suddenly change. Not use if it's a platform quick, or just an SU OSX quirk, but suddenly the window does not stay on top when using .show and .show_modal means "stay on top of parent" instead of actually being modal. It's an annoying difference as the behaviour displayed under OSX does not correspond to what the method name implies. http://en.wikipedia.org/wiki/Modal_window
  • Disable_ui

    6
    0 Szavazatok
    6 Hozzászólások
    285 Megtekintések
    thomthomT
    In SU6 you will not find any way to disable the UI from updating that gives any performance boost that is worth the optimisation effort. If you want to cut down the time, look at the Ruby code itself - find ways to make it faster. (See if there are places where a Hash can be used instead of an Array if you are doing lots of lookups, when manipulation selection and entities - use bulk methods that modifies many instead of single elements.)
  • Question about palettes

    22
    0 Szavazatok
    22 Hozzászólások
    2k Megtekintések
    CadFatherC
    yes, maybe i'm better at it after a few guinness... meantime here's the result - i don't have a mac so do not know whether it works there. only thing is that upon reopening, the windows always dock at the bottom of the stack.. Cheers
  • What am I doing wrong?

    11
    0 Szavazatok
    11 Hozzászólások
    973 Megtekintések
    F
    Trust me Chris you and everyone else who takes the time to help us new guys out are anything but useless. @chris fullmer said: Sorry we were so useless. Glad you figured it out, though!
  • Webdialog - how execute_script works

    12
    0 Szavazatok
    12 Hozzászólások
    2k Megtekintések
    D
    @thomthom said: That wasn't the test. The test was how sending strings to Webdialog with < and > characters affected the DOM. ` > wd = UI::WebDialog.new('HelloWorld') wd.set_html( 'Hello world' ) wd.show_modal true wd.execute_script('alert( "<b>bold text</b>" );') true wd.execute_script('alert( document.body.innerHTML );') true wd.execute_script('alert( document.getElementsByTagName("b").length );') true` this is what I tested, the difference I can see, is that your alert window appears to store the previous message, on the mac I don't see that, but the end result seems to be the same. 1[image: KngN_01wd.png] 2[image: v5s5_02wd.png] 3[image: OqYA_03wd.png] john
  • Get Toolbars from ObjectSpace

    7
    0 Szavazatok
    7 Hozzászólások
    713 Megtekintések
    Dan RathbunD
    Yea that's weird. I never recommend using any constructor without making sure that there is a reference to it for later use. We are still lacking (auto-generated) collections for many types of things, incl. toolbars. Either the collection object would be "held" by the UI module (ie: UI::ToolbarSet,) or "held" by the class itself, and accessed via a class method.
  • Question about load_handler parameter from load_from_url

    12
    0 Szavazatok
    12 Hozzászólások
    435 Megtekintések
    J
    This could be done from the JavaScript too. You could use the onPercentChange to simply set a variable, then use a timer in JS to poll the Ruby script for the value of the variable.
  • Offline API Docs

    2
    0 Szavazatok
    2 Hozzászólások
    3k Megtekintések
    J
    Jay, Gone away - I don't have a mirror of the most recent updated site: http://code.google.com/apis/sketchup/docs/index.html I used a command line program named wget to mirror the site originally. Windows users may find hTTrack useful. http://gnuwin32.sourceforge.net/packages/wget.htm http://www.httrack.com/
  • Function to draw 3d text via ruby

    6
    0 Szavazatok
    6 Hozzászólások
    1k Megtekintések
    C
    entities.add_3d_text. This function I am needed. Thank you.
  • Screen Coords

    9
    0 Szavazatok
    9 Hozzászólások
    402 Megtekintések
    A
    Okay, Thanks
  • Exportvertices2csv.rb as a teaching material

    5
    0 Szavazatok
    5 Hozzászólások
    371 Megtekintések
    T
    Thankyou all! The problem was solved. Dan Rathbun Do you mean the whole class "Exportvertices2csv" should be a module? Or, the instance method "printcsv"should be a module?
  • Test Point3d position tolerance?

    6
    0 Szavazatok
    6 Hozzászólások
    279 Megtekintések
    AdamBA
    sure, but if the transform bumps you out of the SU tolerance, you're hosed.
  • Start/commit_operation

    12
    0 Szavazatok
    12 Hozzászólások
    1k Megtekintések
    L
    First I guess like the poster I don't really have a point with this rant except to warn others who is as clueless as I about both neccessary and good practices working with Ruby Sketchup. As usual when I read your posts, thank you, I find a gold nugget, it is sometimes just hard to to know that you need it. Second I see that it is good and and I agree it makes sence that it works that way.. My irritation points are that: As far as I know my add_3d_text didn't output any error beside returning a nil value, a return value you seldom use. There was (AFAIK) no type of exception raised either. The documentation is as usual very short and doesn't mention it actually undoing any work, the work might as well have been undone by a call to abort_operation not automatically.
  • Same Face in Group plane not same

    3
    0 Szavazatok
    3 Hozzászólások
    162 Megtekintések
    thomthomT
    When you open a group or component for editing, everything in that context is converted from local coordiantes to global coordinates.
  • WebDialog and OSX - resizeable regardless?

    5
    0 Szavazatok
    5 Hozzászólások
    214 Megtekintések
    thomthomT
    @adamb said: Nice one driven. Just remember this is not supported by SU6, so make sure you predicate it with version_number. Adam Or - as I prefer - by using .respond_to? to instead check if the feature exists. No mucking about with version numbers.
  • Color the DC conditioning on its attributes &amp; values (MYSQL

    23
    0 Szavazatok
    23 Hozzászólások
    1k Megtekintések
    B
    This code finally worked UI.menu("Plugins").add_item('Assesment') { Inspection.color } require 'mysql' module Inspection def self.color dbh = Mysql.real_connect("localhost", "root", "***", "test",3306) dbh.query("drop table if exists inspection") dbh.query("create table inspection(component varchar(20), ID int(4), rating int(1))") dbh.query("insert into inspection values('deck',2345,2),('Substructure',2349,1),('Superstructure',2353,3)") res = dbh.query("SELECT rating FROM inspection where id = '2345'") while row = res.fetch_row do xx = row[0] printf "%s\n", xx end res1 = dbh.query("SELECT rating FROM inspection where id = '2349'") while row = res1.fetch_row do xy = row[0] printf "%s\n", xy end res2 = dbh.query("SELECT rating FROM inspection where id = '2353'") while row = res2.fetch_row do yy = row[0] printf "%s\n", yy end Sketchup.active_model.entities.to_a.each{|e| if e.get_attribute('dynamic_attributes','id','')=='2345'&& xx=='1' e.set_attribute('dynamic_attributes','rating','1') elsif e.get_attribute('dynamic_attributes','id','')=='2345'&& xx=='2' e.set_attribute('dynamic_attributes','rating','2') elsif e.get_attribute('dynamic_attributes','id','')=='2345'&& xx=='3' e.set_attribute('dynamic_attributes','rating','3') end } Sketchup.active_model.entities.to_a.each{|e| if e.get_attribute('dynamic_attributes','id','')=='2349'&& xy=='1' e.set_attribute('dynamic_attributes','rating','1') elsif e.get_attribute('dynamic_attributes','id','')=='2349'&& xy=='2' e.set_attribute('dynamic_attributes','rating','2') elsif e.get_attribute('dynamic_attributes','id','')=='2349'&& xy=='3' e.set_attribute('dynamic_attributes','rating','3') end } Sketchup.active_model.entities.to_a.each{|e| if e.get_attribute('dynamic_attributes','id','')=='2353'&& yy=='1' e.set_attribute('dynamic_attributes','rating','1') elsif e.get_attribute('dynamic_attributes','id','')=='2353'&& yy=='2' e.set_attribute('dynamic_attributes','rating','2') elsif e.get_attribute('dynamic_attributes','id','')=='2353'&& yy=='3' e.set_attribute('dynamic_attributes','rating','3') end } Sketchup.active_model.entities.to_a.each{|e| if e.get_attribute('dynamic_attributes','rating','')=='1' e.set_attribute( 'dynamic_attributes', 'material', 'black') e.set_attribute( 'dynamic_attributes', '_material_formula', '"black"') $dc_observers.get_latest_class.redraw_with_undo(e) elsif e.get_attribute('dynamic_attributes','rating','')=='2' e.set_attribute( 'dynamic_attributes', 'material', 'blue') e.set_attribute( 'dynamic_attributes', '_material_formula', '"blue"') $dc_observers.get_latest_class.redraw_with_undo(e) elsif e.get_attribute('dynamic_attributes','rating','')=='3' e.set_attribute( 'dynamic_attributes', 'material', 'red') e.set_attribute( 'dynamic_attributes', '_material_formula', '"red"') $dc_observers.get_latest_class.redraw_with_undo(e) end } end end Thanks to all.
  • .dll accessing - how to?

    12
    0 Szavazatok
    12 Hozzászólások
    789 Megtekintések
    AdamBA
    Guy, Generally, you're not going to be able to do anything useful with the entrypoints its exposes. Particularly not from Ruby. Not sure if it helps but here's a quick tutorial on output very high resolution hidden line images using LightUp.. http://www.light-up.co.uk/index.php?t=story&p=101 Adam
  • [Code] Image: definition, transformation, transformation=

    15
    0 Szavazatok
    15 Hozzászólások
    5k Megtekintések
    T
    As a 'Thanks!' to Alex and my contribution to wellness of other exporters and especially their developers here is my modified transformation method that works I think in 99.9%. It may fail due to float precision, but I looks it doesn't happen too often. My idea is to calculate a center of the image, based on initially derived transformation and to compare it with a center of bounding box of the instance self.bounds.center. If the points are not same it means that an image is flipped. If flipped, I create a modified transformation with a negative scaling along y axis. Now I realized that this can be done by simply crating a Geom::Transformation.scaling origin, 1, -1, 1 and applying it to the original trans... def transformation origin = self.origin axes = self.normal.axes tr = Geom;;Transformation.axes(ORIGIN, axes.x, axes.y, axes.z) tr = tr * Geom;;Transformation.rotation(ORIGIN, Z_AXIS, self.zrotation) tr = tr * Geom;;Transformation.scaling(ORIGIN, self.width/self.pixelwidth, self.height/self.pixelheight,1) tr=tr.to_a tr[12]=origin.x tr[13]=origin.y tr[14]=origin.z trans = Geom;;Transformation.new(tr) #Global! trans of an image instance #check if flipped center_point=Geom;;Point3d.new(self.pixelwidth/2.0,self.pixelheight/2.0,0).transform! trans #center of an image center=self.bounds.center flipped=(center_point.x!=center.x or center_point.y!=center.y or center_point.z!=center.z) if flipped tr = Geom;;Transformation.axes(ORIGIN, axes.x, axes.y, axes.z) tr = tr * Geom;;Transformation.rotation(ORIGIN, Z_AXIS, self.zrotation) tr = tr * Geom;;Transformation.scaling(ORIGIN, self.width/self.pixelwidth, -self.height/self.pixelheight,1) tr=tr.to_a tr[12]=origin.x tr[13]=origin.y tr[14]=origin.z trans = Geom;;Transformation.new(tr) end return trans end#def
  • Puts current module &amp; method in ruby console

    6
    0 Szavazatok
    6 Hozzászólások
    453 Megtekintések
    M
    Hi Dan and Chris. Thank you for your answers ! @chris said: Well, those braces can be expanded to as many lines of code as you would like. You could write it like this: Yes, but I wanted to have a automated method... no need to write Module::Sub_module.method, just copy a line that returns current method in the ruby console. @dan said: Why not just open the rb in an editor, and find the command in the file ? that's what I do when I search the command. But I am not sure a "non-ruby" user could find this command easily. @unknownuser said: BTW.. sometimes there is good reason for a command to be kept private, a commercial plugin, or a Pro only plugin. The writer of a plugin, has the right, to not allow their plugin (or it's tools,) to be called in ways that could defeat the license, or cause other problems. I am not saying this bit of code MUST be inserting in each plugin, of course... Just for MY personal plugins, because I like transparency.. I just asked this forum if someone had a better (or a native) way to do like my little method...

Advertisement