Edit Layers of multiple Details at the same time

unhandled

#1

I need to unhide a single layer in multiple details, about 10 per page, 30 pages. You can imagine how tedious this is, to have to double-click into every detail one at a time and turn on the same layer’s layout visibility bulb. Is there a way to edit multiple details at once?


#2

Dont exactly know what you mean with pages but you can copy a little script and paste it in rhino so you dont have to open the layer and click the bulb.

script can be:

-_layer _on "layer name" _enter 

replace “layer name” with the name of your layer.

-Jordy


#3

I know your pain. Good to add. I don’t think it’s possible yet, is it?


(Pascal Golay) #4

Hi Siri- are you unhiding the layer in all layouts and all details?

-Pascal


#5

Thanks for the script, I’ll check it out. What I meant by the “pages” comment was that I have 30 layout sheets, each with around 10 details = about 300 details.


#6

Yes, I am needing to unhide the layer in all 30 layouts (300 details).


#7

I don’t see any way via scripting to activate a detail view on a layout page… only a double click in the detail seems to be able to do that. Did I miss something?

–Mitch


#8

Maybe there should be a SetDetailActive command that would allow this to be scripted. I assume details have unique ID’s like other objects… And/or a SelNamedDetail command to work with it.


#9

Yeah, that would make things easier. However, I think I found most of the the handles necessary to do this with Python/RhinoCommon. Will take me awhile, finding this stuff and making it work is still a bit of trial-and-error for me…

–Mitch


#10

OK, here’s a first draft… Python/RhinoCommon script. Will hide one or more selected layers in all details on all layout pages found in the document. Due to the fact that there is no rs.GetLayers() or rs.MultilistBox() yet available for Python, the layer choice is via a checklist box… I still had to script rs.Command(“HideLayersInDetail…”) as I don’t see how to access that functionality in RhinoCommon.

Please check the results carefully, I hope it’s all correct… Undo should get you back to where you were if it fails, but scripting HideLayersInDetail seems to be a bit strange. In any case it doesn’t delete anything, I would just save the document before running the script and if it doesn’t do what you expect, use “Revert” to go back to the original.

–Mitch

Edit: Having given you the “poison”, I had better also give you the antidote… :smiling_imp: Attached is the inverse script, allowing you to show a series of layers in all details. I also added a bit of command line reporting to both.

HideLayersInAllDetails.py(1.8 KB)

ShowLayersInAllDetails.py(1.8 KB)


#11

Thank you very much! I will test out these scripts and report back.
Cheers,
Siri


#12

Oh, man – @Mitch – this could be very useful. I spend my life in layout mode and having a tool like this for those rare but painful occasions when you need it could really make a difference.

Thank you.


#13

Hey @mitch,

Am trying to use your Hide/ShowLayersInAllDetails python scripts you created four years ago and was able to make Show layers work, but Hide layers doesn’t seem to find the script. What I did was place the two python files in my
username/appdata/roaming/mcneel/rhinoceros/6.0/scripts folder, then created an alias for each file with the macro _-RunPythonScript “NameofPythonScript.py” but when I ran the Hide file it couldn’t seem to find it. Does it need to be modified for v6?

Any help you can extend to me would really be appreciated.

Thank you.


#14

Hmm - just to check, the filename is HideLayersInAllDetails2.py - did you include the 2 in the file name?

–Mitch


#15

No- the file name I downloaded off your October 2013 post above doesn’t have the 2.


#16

It seems to be working here… One problem, it does seem that the function Checklistbox in the script errors out with some of my layer names that are in French - I have to see why that is, but that problem also present in V5. But the script does seem to run here in V6 in my simple test.

HideLayersInAllDetails.py (2.2 KB)

–Mitch


#17

Hey @Mitch, I seem to be stuck here. I wonder if you could please watch this very short video and tell me what I’m doing wrong?

Thank you.


#18

Does the script execute if you load it into the Python script editor (EditPythonScript) and run it from there?

–Mitch


#19

Yes, it does. I have a feeling I’m not doing something very basic but I’ll let you tell me if you will:slight_smile:


#20

Have you set a path in the python editor to your scripts folder? That’s necessary for it to work. Inside the editor under the Tools menu, you will find the path section, add the path there (don’t delete any of the others).

I have a feeling your alias for “Show” has the full path written explicitly, but “Hide” doesn’t. Maybe I’m wrong though…