Does anyone could suggest me any workaround to be able to set a custom display mode for a detailed view?
Command, probably, has a bug because it’s not working (v5sr9).
Would be perfect to learn how to do this in Rhino.common
Thnks
Does anyone could suggest me any workaround to be able to set a custom display mode for a detailed view?
Command, probably, has a bug because it’s not working (v5sr9).
Would be perfect to learn how to do this in Rhino.common
Thnks
I’m confused, What doesn’t work (with setting a custom display mode in a detail view)?
Hi Dale,
I would like to setup a custom display mode for layout views.
The SetdisplaymodeEX isn’t yet implemented in python, and calling it via rs.command(), from PY script, doesn’t work.
So I’m asking if there’s any way to do this using PY. I’m not confident with Rhino.Common but an example could drive me in the right way.
Thanks
You you referring to RhinoScript’s ViewDisplayModeEx method?
This works for me.
import rhinoscriptsyntax as rs
# Use my custom "Blueprint" display mode
rs.Command("_SetDisplayMode _Mode=Blueprint", False)
Ooooops, the rhino.command it’s working, was my mistake.
But, the same, is there any way to do this by a proper script using rhino.common?
Could you show me how to do it?
Thanks.
Thanks Clement, looks very good… I 've just to turn ON my brain to understand!
Yeah ! notice the example by Mitch is for object display mode… but you still can use Rhino.Command if it has to be quick.
c.
I hate to use the Rhino.command. For me, it look too “dirty”.
Rhino.common it’s really elegant and compact… time to start learning it !
Hi.
Learning from Mitch’s script, I wrote my own and tried to set/remove the display mode using the ‘all viewports’ methods, not the ‘single viewport’ ones used by Mitch, but … they seem not to work properly.
SetDisplayModeOverride(DisplayModeDescription)
does change the display mode, but then I am not able to remove it.
RemoveDisplayModeOverride()
seems to never work.
Here is a sample code. Just uncomment the method call to be run.
import Rhino
mode = Rhino.Display.DisplayModeDescription.GetDisplayModes()[ 0 ]
guid = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView.ActiveViewportID
filtr = Rhino.DocObjects.ObjectType.AnyObject
result, obref = Rhino.Input.RhinoGet.GetOneObject( 'Object ?', True, filtr )
att = obref.Object().Attributes
# this seems to work but the mode cannot be removed
# att.SetDisplayModeOverride( mode )
# this seems not to work
# att.RemoveDisplayModeOverride()
# this seems to work
# att.SetDisplayModeOverride( mode, guid )
# this seems to work
# (it does not work if the mode was set using the all-viewports method)
# att.RemoveDisplayModeOverride( guid )
Rhino.RhinoDoc.ActiveDoc.Objects.ModifyAttributes( obref, att, True )
Rhino.RhinoDoc.ActiveDoc.Views.Redraw()
Did anyone else already see this ?
Or am I missing something ?
Thanks