⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Open SKP in VB.NET Application

    9
    0 評價
    9 貼文
    2k 瀏覽
    Dan RathbunD
    If you look in the SDK folder (where "SDK" is whatever name you gave it,): SDK\SkpWriter\Headers\source\sketchup\skpwriter\sapi and the specific file: applicationfactory.h you will see the following source line that declares an exported DLL function: %(#4040BF)[extern _declspec(dllexport) IApplication* GetApplication();] I believe you must first get a handle to the Sketchup Application Interface, by calling %(#4040BF)[GetApplication()]... then you can call that object's methods, such as getting the handle on the current document, or creating a new document (meaning a SKP model file.) All of the API classes and methods are listed in the "documentation" folders, but be sure to reference both of them. (There is a "documentation" folder under both the "SKPWriter" and "SKPReader" folders.) The files are html, and can be opened locally with your browser. (Click the "index.html" file to start off.) There are a few simple examples in the help docs for SKPReader. There are also a couple of VS project examples under the "Examples" folders.
  • AutoHotKey shortcuts for the Ruby Console

    7
    0 評價
    7 貼文
    2k 瀏覽
    thomthomT
    @kwalkerman said: Hi Jim, This looks awesome. Sorry for the newbie question, but I can't figure out how to activate it. Where do I put the file? How do I start it from the ruby console? Thanks so much, -- Karen This is not a SketchUp Ruby, but an AutoHotKey file - follow the link in the OP.
  • Tracking changes of component definitions with observers

    9
    0 評價
    9 貼文
    544 瀏覽
    Dan RathbunD
    @adamb said: you may want this as a singleton that is shared amongst all instances (as you've almost written by mistake). Like so: # class definition inside module AC3D_Raven_Exporter class DefinitionsObserver < Sketchup;;DefinitionsObserver @@entities_observer = nil # ref to the singleton instance attr_reader( ;entities_observer ) def initialize() if @@entities_observer.nil? # ref'ing the class ref @@entities_observer = AC3D_Raven_Exporter;;EntitiesObserver.new() # otherwise the instance to the observer is valid and just reuse it. end @entities_observer = @@entities_observer end def onComponentAdded(definitions, definition) definition.entities.add_observer(@entities_observer) end end ADD: and you can do the same thing 1 level up (in your custom AppOserver,) by creating a singleton instance of the DefinitionsObserver, and attaching it to all the component definitions that you wish to "watch". I usually also write a detach_from() method, that uses an array or hash of "watched" items, in order to detach observers when I no longer need to watch them.
  • Resize DC with ruby

    6
    0 評價
    6 貼文
    548 瀏覽
    M
    Hello, I wrote a small code to add a DC at a specific position and resize it. So when Sketchup add an instance of a DC its position is 0,0,0. You need to define a transformation to place it where you want. t1 = Geom;;Transformation.axes(...,...,...) newDC = Sketchup.active_model.entities.add_instance(Sketchup.active_model.definitions["MyDC"],t1) To set the length I used the set_attribute method of the DC definition len = 13 len2 = 12 newDC.definition.set_attribute "dynamic_attributes","_lenx_nominal",len.to_s newDC.definition.set_attribute "dynamic_attributes","_lenz_nominal",len2.to_s
  • Group.volume

    11
    0 評價
    11 貼文
    593 瀏覽
    M
    i think i know where the problem is.. it only works in SketchUp 8. i just tried it really sorry about that. i was using 7 before that
  • Help with Japanese Kanji in file name.

    10
    0 評價
    10 貼文
    1k 瀏覽
    honoluludesktopH
    Sorry Dan, Guess this is over my head, but thanks anyway.
  • Calculate button in a messagebox?

    7
    0 評價
    7 貼文
    315 瀏覽
    T
    Thanks Jeff! Let me look at it a bit, I'm not used to dynamic components. It look pretty cool. Thanks again! s
  • Access to Dimension Line text?

    17
    0 評價
    17 貼文
    1k 瀏覽
    Dan RathbunD
    post removed. (Too tired, low confidence in what I wrote.)
  • Back face front face?

    3
    0 評價
    3 貼文
    365 瀏覽
    T
    Your importer will have to handle faces on the world plane as SU always reflips these on import. http://forums.sketchucation.com/viewtopic.php?f=180&t=31887
  • Video textures possible in SketchUp

    29
    0 評價
    29 貼文
    12k 瀏覽
    B
    very good ruby reminds me of a software called PHYTA it has same ability (direct video ,sound ,lighting and direct rendering plus shadows) all in one package 3d modelling (a voir)
  • RegEx fun.... not.... :(

    7
    0 評價
    7 貼文
    421 瀏覽
    Dan RathbunD
    @thomthom said: But I just wanted to understand Regexp better - to why I could not do what I tried to do. I thot I explained it. Your first example, returns the position of a match, IF it occurs using =~ /(foo|bar)/ ... which is an integer index. In contrast, both match() methods return a MatchData object. @thomthom said: So it's not possible to do what I intended with Regexp? ... BUT you then went on to say what you wished was to have the matched numerical string returned, so let me simplify the code (the secret is the $+ global pattern matching variable): # define a Regexp rx = /(\*\s*(d+)|(d+)\s*\*)/ rx.match('* 15') $+.to_i >> 15 rx.match('15 *') $+.to_i >> 15
  • Making identical groups into a shared component.

    4
    0 評價
    4 貼文
    807 瀏覽
    Al HartA
    I see you have addressed the "Definition of a group" in another thread: http://forums.sketchucation.com/viewtopic.php?f=180&t=19765 It looks like I may have some luck using: definition = group.entities.parent to get the definition, and definition.instances to locate the groups which use the same definition. My client mentioned there was already a ruby to convert groups to components. Did you write it, or do you, (or anyone), know where it is? [Edit: It looks like I am looking for: Selection Toys. I will try to find it]
  • Sketchup front back face

    5
    0 評價
    5 貼文
    877 瀏覽
    Dan RathbunD
    Try posting to the C++ SDK forum: http://groups.google.com/group/su-sdk-fileshare/topics
  • View.draw2d adds lots of bad lines?

    8
    0 評價
    8 貼文
    494 瀏覽
    TIGT
    With draw2d if the user orbits/pans and the draw isn't updated don't you get weird effects? Using draw.line would allow users to move around with colored lines overlaying the geometry consistently without need to redraw ?
  • Film &amp; Stage (Advanced Camera Tools) Plugin Added Methods

    7
    0 評價
    7 貼文
    1k 瀏覽
    Dan RathbunD
    I don't find a specific forum for discussing Advanced Camera Tools (here or at Googlegroups.) If SCF had a forum, where would it be put ? .. under Extensions & Applications Discussions or under SketchUp Discussions
  • Interest in a Networking Sockets Workaround

    29
    0 評價
    29 貼文
    6k 瀏覽
    Dan RathbunD
    Sorry... had the link in my previous post pointing to the C sourcecode archive. (Corrected links in original post.) Ruby v1.8.6-p287 Windows One-Click Installer (self-extracting zip installer.)
  • Attribute data size limit?

    6
    0 評價
    6 貼文
    412 瀏覽
    Didier BurD
    Hi TT, I was speaking of an own object type (array of parameters for instance), not SU entities or objects.
  • Bug with TAB character in menu (SU8)

    10
    0 評價
    10 貼文
    627 瀏覽
    A
    @unknownuser said: ... Did you log a bug to the SU Site or should I do it? Fredo You can do it, because I don't know how to do it.
  • Smooth Curve

    3
    0 評價
    3 貼文
    406 瀏覽
    K
    Absolutely!!! I would like to be able to start with either an ArcCurve, or just a curve. I have Fredo's bezier curve plugin installed, but I don't know how I would use it in this instance. Can you walk me through the steps a bit more? Thanks so much, -- Karen EDIT: Oh, wait, the polyline divider is what does it. I think I can take it from here. Thanks for the clue.
  • Inherit from Sketchup Classes

    13
    0 評價
    13 貼文
    1k 瀏覽
    K
    @pierreden said: I would love to be able to make my own My::Point3d class with additional methods, and still be able to use My::Point3d together with Geom::Point3d without errors. The other option is to extend an instance of a Point3d... module YourPoint3d attr_accessor ;your_var1, ;your_var2 def your_def1 end def your_def2 end end p = Geom;;Point3d.new p.extend YourPoint3d p.your_var1 = 20 This gives your particular Point3d additional methods and attributes without messing with the Point3d class at all. -- Karen

Advertisement