Mac User? | Join the Rayscaper Beta for Mac Learn More
  • Code correction

    Newbie Forum sketchup
    7
    0 Votes
    7 Posts
    830 Views
    K
    Hi, TIG. Finally, Its working as I have hoped. This is the corrected code. I needed not use 'group'. The cone shape is created after I deleted the line. Thank you! require 'sketchup.rb' class Cone @@Length = @@angle =@@x=@@y=@@z = nil def create_cone @@Length = 100 if not @@Length @@angle = 30.0 if not @@angle @@x = 0.mm if not @@x @@y = 0.mm if not @@y @@z = 0.mm if not @@z prompts = ["Radius","Angle", "x", "y", "z"] values = [@@Length, @@angle, @@x, @@y, @@z] results = inputbox prompts, values, "Fire sensor" if results @@Length, @@angle, @@x, @@y, @@z = results model = Sketchup.active_model model.start_operation "Fire sensor" compdef = Sketchup.active_model.definitions.add ents = compdef.entities @Length = @@Length.mm @angle = (@@angle.degrees)/2 @pt0 = [0,0,0] @pt1 = [0, 0, -@Length] @pt2=@pt1.transform(Geom;;Transformation.rotation(@pt0,[0,-1,0],@angle)) arcarray = ents.add_arc [0,0,0], [0,0,-1],[0,-1,0], @Length, 0, @angle arc = arcarray[0] arccurve = arc.curve verts = arccurve.vertices a = ents.add_line @pt0, @pt1 b = ents.add_line @pt0, @pt2 face = ents.add_face @pt0, @pt1, @pt2 path = ents.add_circle [0,0,-@Length], [0,0,1], -@Length face.followme path ents.erase_entities path face2 = ents.add_face verts path2 = ents.add_circle [0,0,-@Length], [0,0,1], -@Length face2.followme path2 ents.erase_entities path2 trans = Geom;;Transformation.new([@@x.to_i, @@y.to_i, @@z.to_i]) status=model.place_component(compdef) Sketchup.active_model.active_entities.add_instance(compdef, trans) model.commit_operation end #if Sketchup.send_action 'selectSelectionTool;' end #def end #Class if( not file_loaded?(__FILE__) ) UI.add_context_menu_handler do |menu| end dir=File.dirname(__FILE__) cmd_array = [] cmd = UI;;Toolbar.new "sphere" # Create the Command object cmd = UI;;Command.new("Cone") {Sketchup.active_model.select_tool Cone.new.create_cone} # Configure the Command's appearance cmd.small_icon = cmd.large_icon = dir+"/FGmanual/images/cone.png"#<-- cmd.tooltip = "Cone" cmd_array.push(cmd) tb=UI;;Toolbar.new("Creating tools") cmd_array.each {|i| tb.add_item(i)} tb.show if tb.get_last_state == -1 end file_loaded(__FILE__)
  • Morphing cube to sphere

    SketchUp Discussions sketchup
    12
    0 Votes
    12 Posts
    2k Views
    K
    Thank you Pilou and thank you Rich!
  • 0 Votes
    3 Posts
    2k Views
    oceanembersO
    If I understand the question correctly, you want to be able to rotate the component, but only a certain distance? You can just use a conditional statement. Angle = if(inputAngle<maxAngle, inputAngle, maxAngle) If you wanted to actually be using the rotate tool, you could nest the component within a shell, and have the nested component compensate when the shell's rotation exceeds the max rotation. I don't think you can have a single rotation attribute constrained with a formula and still be able to directly alter it with the rotation tool, unfortunately.
  • 0 Votes
    1 Posts
    535 Views
    No one has replied
  • Terrainmodelling from flat ISO-Lines ?

    SketchUp Discussions sketchup
    2
    0 Votes
    2 Posts
    312 Views
    sdmitchS
    Why not just move the group to the proper Z then explode the group. You might also try my Move2Elev plugin.
  • Linework Diminishing In Layout

    Newbie Forum sketchup
    4
    0 Votes
    4 Posts
    450 Views
    Dave RD
    You're welcome. I modified the line style by adding a shorter version of the stroke. I also set the level of detail to max and killed the Halo setting. You can try it to see if you get better results. There is a still a limit to minimum line length displayed but it's half what it is in the original style. Here's a quick comparison. [image: Straight Line 02px] [image: The modified version] [image: Default lines] There are some other things you might be able to do to increase detail. Mainly welding curves. Straight Lines 02pix Modified.style
  • 0 Votes
    2 Posts
    219 Views
    J
    Bump?...
  • 0 Votes
    1 Posts
    273 Views
    No one has replied
  • 0 Votes
    7 Posts
    590 Views
    U
    Thanks very much sdmitch, I'm not a coder at all, but even failing a programming degree has proven useful, also Notepad++ very helpful for find code bits I can now go and roll this idea across a subdivision and all will look nicely loose and random
  • 0 Votes
    15 Posts
    3k Views
    R
    @unknownuser said: Let it go, OK?
  • Help needed

    Newbie Forum sketchup
    6
    0 Votes
    6 Posts
    442 Views
    Dave RD
    At this point it isn't a solid. [image: Screenshot - 6_9_2015 , 4_27_37 PM.png] After choosing Fix All in Solid Inspector², it becomes a solid and should print just fine.
  • 0 Votes
    19 Posts
    4k Views
    C
    I uninstalled my license to transfer it to my new computer, but the "license has been used on too many computers" popped up. I always make sure I uninstall my license when I move from PC to PC. I'm worried that they'll respond to me by giving me a link to purchase more seats. how did this happen? did it not notify the servers that I uninstalled my license? Rich
  • 0 Votes
    15 Posts
    3k Views
    TIGT
    A web-search for 'vctools' suggests that is a resource often used for hacking. http://www.vctools.net/forum/ So it looks like you have a Virus or Trojan that is trying to latch onto SketchUp as you run it... Luckily the author has made an error in his code and it's failing ! It could have come in from almost anywhere... You need to search for and delete it - the path in the error message is spurious - it's not on your network, but relates to something used when the little bugger was compiled... Use a reputable Anti-virus/SpyWare/Trojan removal app... 'CCleaner' can also be used to tidy up your Temp files and Registry... http://www.piriform.com/ccleaner
  • Entities visibility relationships

    SketchUp Discussions sketchup
    5
    0 Votes
    5 Posts
    391 Views
    D
    The clipping plane is actually not recognized on the visualization service ... So it looks much complicated. Thanks a lot anyway !
  • Multiple Imported Files Material Issue

    SketchUp Discussions sketchup
    1
    0 Votes
    1 Posts
    203 Views
    No one has replied
  • Colour By Axis

    SketchUp Discussions sketchup
    12
    0 Votes
    12 Posts
    2k Views
    S
    This behavior occurs for exactly the same root reason as the infamous small geometry problem: to allow for floating-point arithmetic, SketchUp puts a tolerance around how closely things match before they are considered "same". In the small geometry case, it causes vertices that SketchUp deems to be "the same" to merge. In the color by axis case, it causes SketchUp to color an edge if it is "close enough". And in both cases, it is not hard to construct a model in which close enough wasn't adequate.
  • 0 Votes
    5 Posts
    1k Views
    P
    I will look into your suggestion. Thank you Rich!
  • Revit to sketcup - curved surfaces?

    SketchUp Discussions sketchup
    2
    0 Votes
    2 Posts
    327 Views
    oceanembersO
    There are several plugins that could help you. fredo's bezier spline and thomthom's bezier surface spring to mind, and will give you the functions you need in this instance. Unfortunately, Sketchup does not have any native support for curves, so there won't be a way to bring in the models and keep 100% of the editability they had in revit.
  • Work Planes

    Newbie Forum sketchup
    5
    0 Votes
    5 Posts
    500 Views
    S
    As a further thought, the desire for "work planes" is sometimes due to an attempt to make SketchUp function like other CAD software. As Dave says, you should be free to use SketchUp the way that works best for you, but you should also try to learn and use the way it was designed.
  • AUTOSAVE NOT WORKING???

    SketchUp Discussions sketchup
    1
    0 Votes
    1 Posts
    178 Views
    No one has replied