⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
  • Looking for plugin/code to connect lines

    5
    0 Votes
    5 Posts
    6k Views
    C
    Thanks Fredo. I think loft is what I was looking for. I just couldn't think of the name so I could search properly. No, nothing bad happened. I just got involved in a lot of other projects. I am getting back into SU now because of one of my newest projects, 3d printing.
  • Webdialogs and Javascript void

    11
    0 Votes
    11 Posts
    9k Views
    Dan RathbunD
    @martinrinehart said: Does void differ from return null? YES. (in the following, violet denotes javascript.) (1) return type: undefined and null are separate return types. ___http://msdn.microsoft.com/en-us/library/7wkd9z69(VS.85).aspx void(whatever) always returns undefined* return( null ) obviously will return null (in this case.)A variable can have a null value, but not an undefined value, because undefined refers to the object, not it's value. You check undefined using quotes: %(#BF00BF)[if(typeof(var)=="undefined") //do something] You check null without quotes: %(#BF00BF)[if(var==null) //do something] The difference is subtle. Basically, if a symbol references a variable that has not been declared, or has been declared but never had a value assigned, then "undefined" is returned. If a symbol references a variable that has had any value (including null,) assigned to it, it will not return "undefined". But be careful! There's a gotcha (because of backward compatibility.) %(#BF00BF)[(object.prop==null)] will return true if the property has the value null or if the property does not exist! You can use in to be more specific: %(#BF00BF)[if ("prop" in object)] will return true if the property does exist. (2) Both are evaluation functions: return( expression ) [called a Statement] Always returns the result (of whatever type,) that expression evaluates to. http://msdn.microsoft.com/en-us/library/22a685h9(VS.85).aspx void( expression ) [called an Operator] Evaluates expression then always returns "undefined" (regardless of the result.) The expression is required or an argument error would be raised. The expression 0 is traditional, and comes from C language (where null and zero were interchangable; but in javascript, 0 is a number type, null is it's own type.) http://msdn.microsoft.com/en-us/library/e17c7cbe(VS.85).aspx The internal code might be represented as: %(#BF00BF)[function void( *expression* ) {] %(#F0F0F0)[___]%(#BF00BF)[eval( *expression* );] %(#F0F0F0)[___]%(#BF00BF)[return( undefined ); }] ___
  • Set_attribute problem

    3
    0 Votes
    3 Posts
    6k Views
    PixeroP
    ~~Then I get: {@myid} I'm doing it inside a: sel.each {|e| puts"{@myid}"; e.definition.set_attribute("A", "Id", @myid) } ~~ Edit: Doh! It was all a small typo with a D instead of a d. Works as it should now.
  • Extension Translators

    3
    0 Votes
    3 Posts
    8k Views
    thomthomT
    @fredo6 said: @thomthom said: Where do your source your translators? Do you mean the tool or people? People.
  • Resolve [Ruby help] Script for create window sills

    3
    0 Votes
    3 Posts
    8k Views
    B
    hello , Thank you SDMITCH for help cordially Benj
  • Transform to local axis question

    6
    0 Votes
    6 Posts
    6k Views
    fredo6F
    If the vector is given in world coordinates, then you need the total transformation from the top model to the component. This is not something you can derive from the component itself. Usually it comes from a picking process in an interactive tool or the knowledge of the chain of containers from the top model down to the component
  • Always face camera with View Observer - Would this work?

    5
    0 Votes
    5 Posts
    10k Views
    Dan RathbunD
    A major drawback is that you'd be modifying the model entities with every change of the camera. Currently changing the camera position or even the active scene does not set the modified? flag.
  • Assigning DC attributes to nested components & groups

    2
    0 Votes
    2 Posts
    6k Views
    Dan RathbunD
    DC attributes are set directly upon nested DC group instances. BUT, ... for component instances they are defined upon the definition along with a default value. If there are to be more than 1 instance of the DC and they differ, then the differing values are then set on the instance. (However the "smarts" of each DC attribute, ie, access, formula, label are only in the definition's DC dictionary.) If changing an instance's attribute(s) causes the definition's entities collection to change, then the DC engine will unique-ify the DC, by cloning the definition and making the instance the first instance of this new DC definition. (An example is when changing the DC so that more or less copies of a sub-component, like a stile are generated. This changes the DC definition's entities collection, so if there are more than 1 instance, the one needing a different number of stiles would need a new definition.)
  • Download RBZ file

    30
    0 Votes
    30 Posts
    41k Views
    Dave RD
    What plugins did you download? Plugins won't download as .skp files. That would indicate you've downloaded SketchUp models/components.
  • Angle_between issue

    2
    0 Votes
    2 Posts
    7k Views
    fredo6F
    @rinse04 said: I am trying to differentiate the difference between an internal corner and an external corner to get two different angles as shown in the below image. angle_between() returns the angle between 0 and 180 degrees. If you wish the oriented angle, you need to set a reference of some sort to distinguish between concave and convex angles. Look at your model, and make abstraction of the walls, keeping only the vectors, and you'll see that none can make a difference between inside and outside. Usually, if you have vectors v1 and v2, say in the horizontal plane, then (v1 * v2) % Z_AXIS is either positive or negative. Now, up to you, based on conventions to consider this is an internal or external angle. Fredo
  • Connecting touching lines or points...

    10
    0 Votes
    10 Posts
    11k Views
    mariochaM
    Yea TT Select Curve is great. But I have come across a modeling request where I need it to continue selecting past an intersection. similar to a ring select. Searching .... [image: kKV2_ringselecting.png]
  • Component Axes

    3
    0 Votes
    3 Posts
    8k Views
    H
    Boom! That worked! Thank you sir! --J
  • Using Shoes (ruby UI) in sketchup plugin

    2
    0 Votes
    2 Posts
    7k Views
    Dan RathbunD
    @sminky said: Hi, Is there any way to use Shoes to make UI for a sketchup plugin? No. sorry. A special fork and compilation of the Shoes code would be required, afaik. I believe that no one has attempted it.
  • How do I check if component name starts with a certain word?

    4
    0 Votes
    4 Posts
    8k Views
    Dan RathbunD
    . Ruby 2.x+ (SketchUp 2014+) [String#start_with?](https://ruby-doc.org/core-2.0.0/String.html#method-i-start_with-3F) ie ... if e.definition.name.start_with?("MyComp") ... or ... if e.definition.name.start_with?("Door","Window")
  • Component definition has TWO names ???

    5
    0 Votes
    5 Posts
    7k Views
    Dan RathbunD
    @didier bur said: Sketchup.active_model.name is NOT (always) the same as the SKP file name... Sketchup.active_model.name and Sketchup.active_model.description are used to set the name and description when you will be using the entire file as a component. Secondly, these 2 fields are used to set the name and description that will be displayed when using the file as a template. So it seems that someone who saved the file, renamed it using francais and resaved it under the old english filename. There are cases when the filename (minus extension) are used to set the component name. Importing an image is one case.
  • Problems with ShadowTime/Time conversion

    7
    0 Votes
    7 Posts
    10k Views
    T
    Hi Careca, Thanks for the extension - looked great - but I'm having trouble with getting it off "summer" in the drop down so it will work with "winter" instead and with a bit different times. Also, how do we output the nice shaded shadows combination, let's say from 9AM thru 4PM on Dec 21, 2019 for our customer? Maybe I've installed it incorrectly? No instructions have shown up either. I'm on a Windows 10 with SU 18. Thanks ! tab1
  • How to use animation (nextFrame) when key pressed?

    3
    0 Votes
    3 Posts
    9k Views
    PixeroP
    Thanks. Ill try that.
  • How to reload a extension loader file?

    5
    0 Votes
    5 Posts
    10k Views
    rami_lpmR
    I use this. def self.reload() Sketchup.send_action(CMD_RUBY_CONSOLE) load __FILE__ puts "reloaded #{__FILE__.to_s}\n" end
  • Order in Extensions menu

    3
    0 Votes
    3 Posts
    6k Views
    PixeroP
    Thanks for clarifying it. I had a hard time finding my own plugin in the menu and thought something was wrong with the code.
  • Import script to import 300 dae into 1 project

    27
    0 Votes
    27 Posts
    21k Views
    S
    Hi mate, maybe operator error the first couple of times I tried. Confirmed working in SU2019 Pro both with Collada DAE meshes created in Meshlab and from batch triangulated Collada export from Blender.

Advertisement