Grasshopper

algorithmic modeling for Rhino

This is a stupid and easy question for sure, but I don´t know much about VB. After import some cad documents, I need to delete some layers, inside the same VB.net comp. I really don´t need to declare another input for that layernames (that would be much better), I only need to script inside that names. How can I get this?

If( Not Open ) Then
      ids_tree = m_ids_tree
      Return
    End If

    If Open Then

      app.RunScript("-_import " & sFileName & " _Enter")

      app.RunScript("-_SelNone ")

      app.RunScript("-_SelLayer " & ???????(select certain layers by name)??????????? & " _Enter")
     
      app.RunScript("_delete")

    End If




Views: 1038

Replies to This Discussion

Hi Paul,

_SelLayer will not select a layer, it will select all the objects that are part of that layer. Similarly, _Delete will not delete selected layers, it will delete selected objects.

Try this:

app.RunScript("-_Layer _Delete ""Layer 02"" _Enter")

--
David Rutten
david@mcneel.com
Poprad, Slovakia
(thnxs for the quick reply) Well, I also want to delete the objects in that layers... I guess this will erase both; and what about several layers? Layer01, Layer02...etc?
Just call that command multiple times. It think it's more readable than trying to do it all in one command.

--
David Rutten
david@mcneel.com
Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service