ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • View.refresh behavior

    3
    0 Votes
    3 Posts
    562 Views
    thomthomT
    For animations it's best to use the Animation class instead of using sleep() and forcing a screen refresh. http://www.sketchup.com/intl/en/developer/docs/ourdoc/animation
  • About VB.Net and Sketchup Integration

    3
    0 Votes
    3 Posts
    983 Views
    thomthomT
    The C API allow you to read and write files. For .NET integration you would have to create a wrapper that bridges the two.
  • Open Excel code to a Plug-in.

    3
    0 Votes
    3 Posts
    439 Views
    D
    Thank You Very much.
  • Manipulating a polyline like the freehand tool

    2
    0 Votes
    2 Posts
    302 Views
    pbacotP
    Bezier Spline? http://sketchucation.com/forums/viewtopic.php?t=13563
  • How to get face which is belong to two group

    9
    0 Votes
    9 Posts
    537 Views
    TIGT
    Try the groups' .bounds if they 'touch', then some_group.bounds.max.x OR .y OR .z and some_other_group.bounds.min.x OR .y OR .z might be coincident ?? Especially if the are simple boxes...
  • Status Text being reset

    3
    0 Votes
    3 Posts
    333 Views
    tt_suT
    There is no way to force a statusbar text to stick around. It's normally set by the active tool, but also by menu and toolbar items. Do you have a sample snippet that demonstrate the issue?
  • Need some help again.

    3
    0 Votes
    3 Posts
    295 Views
    S
    Thanks again TIG! I am very grateful. I knew I was missing something, but was pretty much stumped. Thanks for putting me back on track, and so quickly. Cheers
  • How to attach text to a line

    3
    0 Votes
    3 Posts
    520 Views
    P
    I'm sorry I have tried that .. but that is not what is in my mind.. I just want the text to follow the line even if I move one point only . . doing this manually is possible.. but not for ruby scripts I think..
  • RBZ installation on MAC OS

    3
    0 Votes
    3 Posts
    474 Views
    S
    Hi John, many thanks for your quick reply. It was really helpful. I am now using the command line of winzip in my Powershell script, as you have proposed. The generated RBZ file is now working on my MAC also. Thanks a lot for your help. Sonja
  • Best way to delete entities

    19
    0 Votes
    19 Posts
    7k Views
    Al HartA
    great - that's what I was looking for anyway
  • Problem with modules and classes: undefined method

    5
    0 Votes
    5 Posts
    421 Views
    S
    **It works!**Thanks a lot, you saved my weekend!
  • Newby Ruby "Undefined Method" issue

    3
    0 Votes
    3 Posts
    446 Views
    M
    The code is good. From the console it appears that the first run was ok, and then you ran again the script and the face cannot be created. The problem is that you are trying to create a face object in the same place occupied by the face created before. Clean all your objects first (select all> delete), and try again.
  • Exploding group removes material from a face

    4
    0 Votes
    4 Posts
    434 Views
    TIGT
    inner = [[211.304795230314, 59.3387335473855, 144.121274015103], [198.016313479612, 93.8459200290483, 144.121274015103], [198.016313479612, 93.8459200290483, 209.586476052542], [211.304795230314, 59.3387335473855, 209.586476052542]] outer_right = [[123.368393800971, 287.689711452616, 222.214015434512], [124.599206984753, 284.49356753989, 222.214015434512], [124.599206984753, 284.49356753989, 7.04087985299685], [123.368393800971, 287.689711452616, 7.04087985299685]] outer_bottom = [[123.368393800971, 287.689711452616, 0.0], [123.368393800971, 287.689711452616, 7.04087985299685], [124.599206984753, 284.49356753989, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685], [280.16221708339, -119.468442554957, 7.04087985299685], [280.16221708339, -119.468442554957, 0.0]] outer_left = [[278.931403899616, -116.272298642254, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [280.16221708339, -119.468442554957, 7.04087985299685], [278.931403899607, -116.27229864223, 7.04087985299685]] outer_top = [[121.306929034951, 293.042869957925, 227.414539710024], [201.765305442185, 84.110634448818, 323.731055308166], [282.223681849419, -124.821601060289, 227.414539710024], [282.223681849419, -124.821601060289, 222.214015434512], [280.16221708339, -119.468442554957, 222.214015434512], [278.931403899616, -116.272298642254, 222.214015434512], [278.931403899616, -116.272298642254, 227.414539710024], [201.765305442185, 84.110634448818, 314.768300386351], [124.599206984753, 284.49356753989, 227.414539710024], [124.599206984753, 284.49356753989, 222.214015434512], [123.368393800971, 287.689711452616, 222.214015434512], [121.306929034951, 293.042869957925, 222.214015434512]] # place bounding faces temp_group = Sketchup.active_model.entities.add_group outer_right_face = temp_group.entities.add_face outer_right temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_bottom_face = temp_group.entities.add_face outer_bottom temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_left_face = temp_group.entities.add_face outer_left temp_group.explode temp_group = Sketchup.active_model.entities.add_group outer_top_face = temp_group.entities.add_face outer_top edges=temp_group.entities.grep(Sketchup;;Edge) temp_group.explode ### edges.each{|e| e.find_faces if e.valid?} # place a textured inner face temp_group = Sketchup.active_model.entities.add_group inner_face = temp_group.entities.add_face inner temp_group.explode ( material = Sketchup.active_model.materials.add("Red") ) unless material=Sketchup.active_model.materials["Red"] material.color="Red" # make 'red' once only inner_face.material = material ### # inner_face.erase! ### alternative # inner_face has lost it's material puts inner_face.material This works. It adds a face within the overall form too. The 'window' is colored after the explosion. Note how I also only make a 'Red' material once. You could erase the 'window' instead of making it 'Red'... The order of operations and exploding groups affects the result, but knowing that you can avoid it.
  • Send_action workarounds?

    8
    0 Votes
    8 Posts
    676 Views
    Dan RathbunD
    On the PC, send_action can process native tool command integer IDs. I pub'd some IDs here (but do not use that file as is. It mods the API.) Just use it for tool ID reference. Somewhere here Thomas also posted a tool ID hash. Ex: Sketchup::send_action( 24201 ) # Union Tool
  • Is an entity in a surface

    13
    0 Votes
    13 Posts
    1k Views
    tt_suT
    That's for that revised version!
  • Problems defining a method

    4
    0 Votes
    4 Posts
    498 Views
    tt_suT
    Your error message pointed to the last line in your code: classify (u, apoint, face1) I suspect it was the space between the method name and parentheses. Especially when you encounter syntax error it's good to go over your code and make sure the code style is consistent. Checking that there are no spaces between parentheses in method calls and making sure you have parentheses around all arguments etc.
  • Prompting user to select objects while running script

    2
    0 Votes
    2 Posts
    266 Views
    tt_suT
    Sounds like you need to implement a custom Tool: http://www.sketchup.com/intl/en/developer/docs/ourdoc/tool You can make the tool select entities the user clicks on by using the PickHelper class. Both these classes has examples in the documentation that will get you started.
  • Find Intersection of 2 curves

    4
    0 Votes
    4 Posts
    460 Views
    C
    From a time complexity perspective I think the problem is inherently O(n^2) (which means that your code can't be any simpler), also, if the curves have few segments and you already know enough to throw away half of them, then I would say your code is probably close to optimal. In general, the simplest way to gain speed is to use bounding boxes in various ways like reducing the input to segments in the bounding box intersection between the curves and so on, however, there are constant costs associated with this so it may not be a gain on small inputs.
  • Entity ID and Materials!

    15
    0 Votes
    15 Posts
    4k Views
    tt_suT
    Ah, yea - there is name and display_name - at least in the Ruby API. name is the unique one that should be used to refer to materials. display_name should be used only to display the material name to the UI. However, it appear that the C API doesn't quite do that. Let me have a chat with the rest of the team.
  • Mac and Materials (with textures)

    12
    0 Votes
    12 Posts
    762 Views
    tt_suT
    I can reproduce what you see when I use a larger texture. I also notice that the Console output is odd. lots of empty lines and a strange order of the lines. I'm not sure what it is yet.

Advertisement