💡 LightUp 7.1 | SketchUp's only real-time renderer that uses object-based rendering Download Trial
  • How can I use "createPopupMenu" to create a right click Menu

    6
    0 Votes
    6 Posts
    6k Views
    Dan RathbunD

    @season_x said:

    I think Right - click menus are more important than toolbars and shortcut key.

    Doug Olivier (formerly a Trimble employee) is working on a popup button matrix called GhostMenu:

    There is a beta version available to test. https://app.ghost.menu/

    It uses a keyboard shortcut to popup the GhostMenu.

    (But I cobbled up a little script to insert a command for GhostMenu into the top of SketchUp's context menu.)

  • Use Ruby To Apply Materials to Spacific Layers

    24
    0 Votes
    24 Posts
    10k Views
    A

    Man I thought python and Dynamo were hard. I even had a go at lisp but for some reason I cant get my head a round ruby. I like the code above but want to use the clean code but also just add in the layer names and leave the other ones alone. It seams that when I run this it converts all the layers in the model to Default and then the layer color had to be the same as the material name. I like the hash option but cant seem to get it to run on transparent materials and it only paints 1 side. any suggestions

    P.S. I am bringing in a dwg (exported from Revit) with 20 or so layers and want to put all the layers to 1 color but windows I want them to be on Translucent Glass Gray

    F.E. all layers to color 123_White except 0_EX_Glazing it needs to be on Translucent Glass Gray

    Some of the issues

    the import comes in as 1 group (with layers in the group) some of the groups come in the main group with groups within groups (doors and Door windows)
    Objects come in with a material not defined (<auto1>)so a generic material must be placed on all the objects for the script to have a chance.

    Thanks in advance

  • Close a WebDialog, THEN execute ruby code?

    11
    0 Votes
    11 Posts
    10k Views
    M

    I did some workaround on this behavior by adding an event listener on the dialog box via JS. This way the callback will be triggered.

    window.addEventListener("beforeunload", function (e) { sketchup.focus_dialog() }, false); @dlg.add_action_callback('focus_dialog') do |ac| @dlg.bring_to_front end
  • How to get near and far clipping plane of view?

    9
    0 Votes
    9 Posts
    9k Views
    E

    @pyroluna said:

    Well obviously the answer to my previous post here is yes. But it took a few years...
    https://www.clippingplane.com/
    https://sketchucation.com/pluginstore?pln=AdvancedCameraSettings

    Pyroluna, did you know that there's already a free plugin by S4U to do this?
    https://sketchucation.com/pluginstore?pln=s4u_Clipping_Camera

    And it's not quite true that it took a few years. The legacy ThomThom's Camera Tools ( https://sketchucation.com/forums/viewtopic.php?f=323&t=43290 ) provide you instant (Camrea > Advanced) access to the debug dialogue. This plugin is very old but only with SketchUp 2017+ we have FORCE button.
    May the Force be with us!

  • Distace from Camera to object in drawing.

    44
    0 Votes
    44 Posts
    39k Views
    monsterzeroM

    Thread revive!

    I found this extension and wow---it's a lifesaver 7 years later! Thanks!

  • [undoc] Camera info window

    17
    0 Votes
    17 Posts
    10k Views
    E

    An oldish thread but I'll poke in and let you know about 2 plugins that can easily access camera dialog box:

    S4U Camera Clipping - https://sketchucation.com/pluginstore?pln=s4u_Clipping_Camera - a rather new plugin

    Legacy ThomThom's Camera Tools - https://sketchucation.com/forums/viewtopic.php?f=323&t=43290. You access it via Camera > Advanced (and it has nothing to do with ACT).

    Have fun and never ever struggle with clipping! 😄

  • Sketchup::model#import : Force "Use Image As" Image

    2
    0 Votes
    2 Posts
    5k Views
    Dan RathbunD

    @alexms said:

    But, when I do like that, I'm depending on the last choice of Use image as the user's made in import dialog.

    You are correct there are no importer options for image file types exposed in the Ruby API.

    If you are still using SU2017 Make, then there is no way to change what the user's last setting was, whilst SketchUp is running. It is saved in the registry, and although SketchUp will immediately update the user's setting (if it changes,) SketchUp core will still use it's internal memory of the setting instead of checking the registry.
    This means if you attempt to tweak the registry whilst SketchUp is open, it will have no effect.

    @alexms said:

    Or should I make a full tool and use add_image ?

    This is likely your only option. I did post an example of dragging objects around within a tool at the SketchUp forums ... See links in this post:
    https://forums.sketchup.com/t/how-to-realize-the-drag-effect/125758/4

    Once the image is placed, you might try to push it's reference into the selection set alone and activate the ScaleTool.
    Sketchup.send_action("selectScaleTool:")

  • SketchUp 7.0 ?

    9
    0 Votes
    9 Posts
    7k Views
    I

    @masp said:

    I found 7.1.6859 (free) for mac (based on Aerilius' post):

    http://dl.google.com/sketchup/gsu7/FM-2-1-6859-EN.dmg

    (what a relief: I've been trying to find it for ages!)

    pro would be similarly:

    http://dl.google.com/sketchup/gsu7/PM-2-1-6859-EN.dmg

    Mike

    Hi! I know it´s been quite posts while since these posts, but miraculously those links are still working. Thanks!

    I´m trying to download the two older Pro versions for Mac (7.0.8656) and (7.0.10246) but couldn´t find them with this method so far. I tried a lot of alternatives but they didn´t work. Did anyone have any luck?

    Thanks

  • Individually export all components to .dwg

    4
    0 Votes
    4 Posts
    5k Views
    TIGT

    So if that is the extent of the options, then 'selection' is not there ?
    So look at my alternative idea of deleting 'everything' but the chosen component instance, then aborting...

  • 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
    7k 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 &amp; 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
    39k 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 ....

    ring selecting.png

Advertisement