+ Reply to Thread
Results 1 to 5 of 5

Thread: rs.GetLayer and rs.ObjectLayer() not working with multiple sublayers

  1. #1

    rs.GetLayer and rs.ObjectLayer() not working with multiple sublayers

    Hi,

    I have some issues with the rs.GetLayer and rs.ObjectLayer() command.
    If the Layer Structure in Rhino has multiple sublayers with the same name the rs.Getlayer and rs.ObjectLayer() don't work.

    See files attached.
    If you select the sublayer "out" in "main2" rhino still draws the point on "out" in "main1"

    Python Code:
      layer_out = rs.GetLayer("Select Layer to draw geometry", None, True, True)
       
      pt = rs.AddPoint(0,0,0)
       
      rs.ObjectLayer(pt, layer_out)

    Any suggestions?

    THX
    Attached Files

  2. #2
    I've also had some problems with this. Some of the rs functions accept layer full names, others don't, and results are unpredictable.

  3. #3
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,472
    Blog Entries
    19
    I see this bug and am looking into fixing it. I would rather the python functions just work with full layer paths whenever possible so we don't get ambiguous results like this.
    Thanks for pointing it out,
    -Steve

  4. #4
    Senior Member Steve Baer's Avatar
    Join Date
    Apr 2010
    Location
    Seattle
    Posts
    1,472
    Blog Entries
    19
    I just pushed a fix for this up to github. I think there will need to be a bit more work for me to do here, but we should eventually have these functions work only with layer full paths. Here are the scripts if you want to update before the next V5 beta
    https://github.com/mcneel/rhinopytho...cript/layer.py
    https://github.com/mcneel/rhinopytho...erinterface.py

    This is good. The sooner this is cleaned up the better.
    Thanks again,
    -Steve

  5. #5
    Hi Steve,

    great!
    Thanks for your support!

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts