that works, but I don’t see why it should only work like that.
What if you have several clipping planes and want the hatches to be different colours for each clipping plane? Or a different hatch?
To me it seems more natural that if a Layer has nothing set for the Sections, then whatever is set in the Clipping Plane should appear. Don’t you agree?
Yes, I know that you can, but that does not solve the problem.
The problem is this:
Different clipping planes can have different styles for different purposes. If there are no overrides in the objects or layers, then the style of the clipping plane should be the style used for all the objects. Otherwise the style of the clipping plane does not make any sense.
The day you have implemented a list of Section Styles that can be handled separately, then this will be less of a problem. We have hundreds of Layers and it is tedious and time consuming to set the clipping style of each layer manually.
I think I understand what is the issue here and what I’m getting at.
New objects created have “By Layer” as default.
Now what happens if that Layer has Section Style set to “None” which is the default?
If you create a Clipping Plane the custom hatch functions will not function on that object. Only was to make it function is to set the objects properties to “By Clipping Plane”.
But this then makes it necessary to only use “By Clipping Plane”, because you can’t control those object “By Layer” anymore.
The “By Layer” default is much more powerful for most applications and it is bad to force all object to use “By Clipping Plane” …
So what I’m looking for is a function where the you can override for all objects (whatever state they are set to) that the clipping plane hatch parameters take over. Like “use for all”.
Then you can use Clipping Planes for easy hatching of geometry whatever state the objects are in. And you can still use “By Layer” options for more fine-tuned sections with different patterns per Layers without destroying the state of the object. And you can still use it the way it works today.
Does this make sense? As it is today I need to select all the geometry and make sure it is set to “By Clipping Plane” before thing work. And every time I add new geometry I need to redo this.
These are object based properties, so no global settings.
I modified this script to allow you to select all objects and ensure a section style state (in this case Clipping Plane)
#! python 2
import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
def SwitchSectionStyle():
# Get multiple objects instead of a single object
obj_ids = rs.GetObjects("Select objects")
# Check if any objects were selected
if not obj_ids:
return
# Process each selected object
for obj_id in obj_ids:
rh_obj = rs.coercerhinoobject(obj_id, True, True)
# Set the new source
source = Rhino.DocObjects.ObjectSectionAttributesSource.FromSectioner
# Apply the new attributes
attr = rh_obj.Attributes.Duplicate()
attr.SectionAttributesSource = source
scriptcontext.doc.Objects.ModifyAttributes(rh_obj, attr, False)
# Redraw the view to show changes
scriptcontext.doc.Views.Redraw()
SwitchSectionStyle()
thanks for taking your time to amend the script and provide it.
I do not have a problem changing the state.
I have a problem understanding the reasoning behind the functionality.
Using section style set “By Layer” is so much more powerful.
But sometimes you need to quickly produce simple sections with for example a solid hatch.
Today this is impossible without destroying the object based properties.
The only thing needed is a checkbox in the clipping plane dialog box - “Override object parameters”. That solves the problem. And makes the system so much versatile.
Do you understand ? The objects can retain their settings while we can powerful possibilities to quickly override hatching for all objects.
There is already a glitch in Rhino regarding this. I’ve mentioned it before. New objects are created with “By Layer” default setting for Section Style.
If the Layer where the object is has no Section Style, then there is no Section Style displayed. First when the user sets the Layer section style it starts working (or set the object to “By Clipping Plane”).
This is confusing for the users (especially those using this for the first time).
To me it seems fair that Section Style of the Clipping Plane takes control if there is no appliable setting for an object (eg if it has no object setting and the layer has no section style). This would mean that all clipping planes would work from the start (the Section Style dialog would work).
Another thing - why is the Clipping Plane dialog called “Section Style”? Either you stick to “Clipping Plane Style” or you change the whole name paradigm to something much more recognizable: Section Plane and Section Style … adhering to the standard terminology. Clipping Plane is a term mostly used for computer graphics …
I’m seeing a few new feature requests for Rhino 9.
Adding Hatches to the DisplayMode Clipping plane overrides
Clipping Plane Option to Override Object Section Style. (Display mode could still override the override)
Change Layer default from None to Clipping Plane (this is subjective, but will give it a go)
The naming stems from working with existing Rhino features that have been added over the versions, wholesale renaming is difficult to get consensus on.
Opening/Closing seems to have fixed it. I’m in the latest release.
Edit - Seems to be some new problems not corrected by opening and closing. I’ll investigate further. They probably came in with the previous update because stuff was working better before (other than the liveweight issues). I see there’s a new update so I’ll update then figure it out this week I guess.
are you in charge of the section tools in Rhino? I have quite long list of bugs/features relating to the Sections here and they frankly make working “in Section” almost impossible.
Some of them almost need a Zoom session to explain. Or rather, the Zoom session would make it more understandable why certain things are not working well or are buggy.