- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @romu51. The layers can be customized, so the 'Index' number way of accessing them is not a very good way if you want a specific one. You can specify the internal name of the layer instead of its index number there if you want. What is the scope of your request? (Do you want the code to effect every view on every sheet of a multi-sheet drawing ; or do you only want to work with one specific view, or somewhere between? Please specify.) Would you prefer to simply pick the view you want the code to work on manually, instead of trying to find it by code? Do you want it to effect all geometry in the view from every possible WorkSurface type object in the model, or just one specific one? The Layer route is generally better, because you can change how a Layer looks later in the Layers dialog if you want, outside of the code, without needing to change the code itself. There is a quicker way though. You can collect all drawing curve segments into an ObjectCollection, then use the Sheet.ChangeLayer() method to change them all to a specified layer at one time, instead of individually. Less processing that way.
Wesley Crihfield
(Not an Autodesk Employee)