A script to make Detailstools faster

DetailsToolsDragNDrop.rvb (5.5 KB)

Hello Rhino friends,

Maybe @phcreates
I use the script Detailstools (attached) a lot to switch the display mode in my Layout details from whatever display there are to wireframe and back. When there are a lot of details on a page, if the display mode in the details is shaded or rendered, moving the drawing around can be slow. I am wondering if it’s possible to make two scripts that would make it faster? The first script would switch the displays from whatever they are to wireframe:

Run the command Detailstools.
Pick the option ChangeDisplayMode
Pick Wireframe

That way when I look at a particular page, I can press an alias and immediately change it to wireframe, work on it, and then change it back.

The second script would switch the display back from wireframe to whatever they were.

Is this possible?

Thank you.

Cosmas Demetriou

This should work:

Call ChangeDisplayModeTOWireframeAllDetails()

Sub ChangeDisplayModeTOWireframeAllDetails()

Dim strLayout, strDetail, aDetails

strLayout = Rhino.CurrentView(, False)

aDetails = Rhino.DetailNames(strLayout, False)


Rhino.EnableRedraw(False)
	
For Each strDetail In aDetails
		

	Rhino.CurrentDetail strLayout, strDetail
			
	'do the view change here
	Call Rhino.ViewDisplayModeEx(, "wireframe")		
						
		
Next
	

Rhino.CurrentDetail strLayout, strLayout 'set view back to layout vs detail
Rhino.EnableRedraw(True)	

End Sub

Best solution would be to make a version that can be run via macro (as you suggested), but I vaguely recall that I had trouble getting the command line picking of display modes to work because of spaces in display mode names. So probably either someone else will have to solve that or you’ll have to settle for individual scripts for each mode. I’ll give it a shot though and see what happens.

Hi Peter,

@phcreates

Thank you, thank you, thank you. I came in to the office to test the script and I was, indeed, able to make it work – half way, though. I was able to make it quickly turn the display modes in all the details to wireframe, (which is a real time saver) but when I tried to run it again, it did not turn them back to the display mode they were in before. Some of my details are in Shaded mode and some are in Rendered. Is this not possible?

Thank you,

Cosmas

Definitely do-able, but I can’t do that anytime soon. Maybe someone else can pick up where I left off (or start over?) & make it work?

Thanks, @phcreates Peter. After I posted my request, I was able to shortcut the restoration by using:

_detailstools _changedisplaymode

That way I, at least, skipped the first set of options and went directly to the pull down where you specify the display mode. To be honest, this is fine for me now, but it would be nice to have a completely seamless restoration that would be handy when you have a large number of details on a sheet and they don’t all have the same display mode.

Thank you again for what you did give me. I have been using it today and love it.

Cosmas

Thank you very much Peter. I will try it later.