⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Find a component definition in a list

    4
    0 Szavazatok
    4 Hozzászólások
    265 Megtekintések
    thomthomT
    A less verbose version:. <span class="syntaxdefault">result&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">references</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">find&nbsp;</span><span class="syntaxkeyword">{&nbsp;|</span><span class="syntaxdefault">string</span><span class="syntaxkeyword">|&nbsp;</span><span class="syntaxdefault">string</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">rstrip&nbsp;</span><span class="syntaxkeyword">==&nbsp;</span><span class="syntaxdefault">ref&nbsp;</span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">puts&nbsp;</span><span class="syntaxstring">'Hello'&nbsp;</span><span class="syntaxkeyword">if&nbsp;</span><span class="syntaxdefault">result</span>
  • Modifying Reporting Area Script

    2
    0 Szavazatok
    2 Hozzászólások
    182 Megtekintések
    JQLJ
    Have you tried report label areas plugin by Fredo? http://sketchucation.com/forums/viewtopic.php?f=323&t=40025&p=471921&hilit=area#p376837
  • OnKeyDown not working when Web dlg is focuse...why?

    6
    0 Szavazatok
    6 Hozzászólások
    437 Megtekintések
    D
    some reading http://unixpapa.com/js/key.html it's title JavaScript Madness: Keyboard Events trying to get my head around it at the moment...
  • How to distinguish face size

    11
    0 Szavazatok
    11 Hozzászólások
    798 Megtekintések
    pingpinkP
    Thank you very much ! Actually , I refer "round_to" in a class Fixnum below my main codes. I don't see any error. It's my new knowledge about sprintf("%.2f", 1.23456) [ruby]class Fixnum def abs rx = self if rx < 0 rx = -rx end return rx end def to_meter ufactor = 1.m rx = (self) / ufactor return rx end def round_to(x) (self * 10**x).round.to_f / 10**x end def ceil_to(x) (self * 10**x).ceil.to_f / 10**x end def floor_to(x) (self * 10**x).floor.to_f / 10**x end def rad_to_deg (self / Math;;PI) * 180.0 end def deg_to_rad (self * Math;;PI) / 180.0 end def comma_format s = self.to_s if s.include? ?. pre, post = s.split '.' "#{pre.reverse.gsub( /\d{3}(?=\d)/, '\&,' ).reverse}.#{post}" else s.reverse.gsub( /\d{3}(?=\d)/, '\&,' ).reverse end end end [/ruby][/code]
  • Can't draw subclasses of Sketchup::Edge

    25
    0 Szavazatok
    25 Hozzászólások
    1k Megtekintések
    thomthomT
    I hope we get to see your creation one day. It sounds interesting!
  • Sorting algorithm

    9
    0 Szavazatok
    9 Hozzászólások
    445 Megtekintések
    bomastudioB
    Ok TIG I understand.....I just said "group" because I don't use neither the SUpro import nor external plugin, I'm using mine importer: it return to me a group with all the dxf drawing. I used your technique (sustituting the group to the componenet.definition) and it works fine..
  • Grey Out Issue is back

    30
    0 Szavazatok
    30 Hozzászólások
    813 Megtekintések
    Rich O BrienR
    I'm also noticing that box select is not selecting or click select. If i right click something it selects but the menu is greyed
  • How to create donation button for your plugins?

    6
    0 Szavazatok
    6 Hozzászólások
    592 Megtekintések
    renderizaR
    Thank you very much TIG!
  • Custom importer preview?

    5
    0 Szavazatok
    5 Hozzászólások
    210 Megtekintések
    bomastudioB
    @dan rathbun said: @voltaicsca said: If so, how does one access this functionality? This is an operating system feature. Previews will display if a thumbnail image has been saved INSIDE the file. (Which SketchUp can do with models.) But this works only if a picture is available.... so thinking about SU only if I'm writing an exporter (in the case I've got the SU model and its thumbnail). But what about the opposite situation (an importer, say a DWG/DXF/OBJ etc)?
  • Followme &amp; Pushpull Commands

    4
    0 Szavazatok
    4 Hozzászólások
    674 Megtekintések
    pilouP
    You have also a French section here where few ruby developpers can help you (Fredo6, Didier Bur, Matt666... (when they make a little visite User Control Panel / UserGroups/ Français
  • Ruby to open a sequence of files - run ruby

    8
    0 Szavazatok
    8 Hozzászólások
    506 Megtekintések
    T
    Thanks Dan, this worked great! Sketchup.undo() while Sketchup.active_model.modified? Stuart
  • Can a script fire another?

    23
    0 Szavazatok
    23 Hozzászólások
    935 Megtekintések
    CadFatherC
    @aerilius said: Sorry for being late that's quite alright.. i was taking my time anyway..
  • Modifying geometry in freshly copied Groups (not unique)

    8
    0 Szavazatok
    8 Hozzászólások
    675 Megtekintések
    Dan RathbunD
    @jolran said: However I was thinking more as a benefit to others, keeping this info visible. I added this topic to my manual list of Snippets. See Groups: [Code Snippets] by Subject
  • [Plugin] ToolbarBuilderDemo

    13
    0 Szavazatok
    13 Hozzászólások
    547 Megtekintések
    BoxB
    I think a three or four button save in the free version will get you many more Pro buyers.
  • Ruby script to detect OS

    5
    0 Szavazatok
    5 Hozzászólások
    2k Megtekintések
    A
    That (edit: scott's) is already almost ruby code. This should do it: module TDxSkp WIN = ( (Object;;RUBY_PLATFORM =~ /mswin/i || Object;;RUBY_PLATFORM =~ /mingw/i) unless defined?(WIN) OSX = ( Object;;RUBY_PLATFORM =~ /(darwin)/i ? true ; false ) unless defined?(OSX) if WIN require 'sketchup.rb' require '3DxSketchUp/3DxSketchUp.dll' file_loaded("3DxSketchUp.rb") elsif OSX require 'sketchup.rb' require '3DxSketchUp.bundle.plugin/Contents/MacOS/3DxSketchUp.bundle' file_loaded("3DxSketchUp.rb") end end # module http://sketchucation.com/forums/viewtopic.php?f=180&t=34631&p=305368 We use proper operating system names because we are not detecting hardware. I'm not sure if that's the namespace ( TDxSkp) that they use, but our constants should better not float in top level namespace. However note that 3DConnexion is a binary plugin and adds content to the Ruby environment that we can not check for errors (or we can find but not fix them).
  • How to get transformation.origin of a internal component

    2
    0 Szavazatok
    2 Hozzászólások
    457 Megtekintések
    TIGT
    First find the insertion point of the Redbox instance in its current context. Next find the transformation of the Bigbox container instance. You need to get a handle on the 'Redbox'. Let's assume there is only one instance and that's inside Bigbox. redbox = model.definitions['Redbox'].instances[0] Now get its insertion point pt = redbox.transformation.origin Now let's assume there's only one instance of 'Bigbox'. bigbox = model.definitions['Bigbox'].instances[0] Get its transformation tr = bigbox.transformation Apply that to the point 'pt' pt.transform!(tr) The point 'pt' is now relative to the model's origin, NOT the Bigbox's internal origin...
  • File Path with backslashes

    6
    0 Szavazatok
    6 Hozzászólások
    397 Megtekintések
    TIGT
    @dan rathbun said: TIG's example: .tr("\"","/") means replace all double quotes with a slash. It probably should be: **.tr("\\","/")** Dan thanks for spotting my typo. I've corrected the original... By coincidence I was doing some changes between double and single quotes and it got stuck in my muscle memory !
  • Reference to entities(id)

    7
    0 Szavazatok
    7 Hozzászólások
    532 Megtekintések
    jolranJ
    Yep, solid tip. Thank you Dan.
  • How to unhide single entity in a hidden hirarchy of entities

    3
    0 Szavazatok
    3 Hozzászólások
    838 Megtekintések
    B
    Thanks for a quick reply! @tig said: If you use nested objects [groups or component-instances] and give them different layers, you can use layer-visibility to control what you see... My target plugin requires to use nested objects 'inside each other' to identify entity parents and their IDs in a complex scene Is there a way to 'unnest' an object?
  • Bat print skp files

    5
    0 Szavazatok
    5 Hozzászólások
    313 Megtekintések
    TIGT
    This idea is not new... http://sketchucation.com/forums/viewtopic.php?f=15&t=37510 https://groups.google.com/forum/?fromgroups=#!topic/sketchupruby/XCW2zuW_lY8 etc Without considerable effort and extreme programming skills, you will almost certainly have to open each SKP in turn and export it as a jpg or png, then print that using a 'bat' file ? This is readily programmable in ruby...

Advertisement