I know Dale. Thanks.
The following will allow you to delete linetypes one at a time - even the ones you can’t now. Default linetypes will come back automatically however. I might be able to refine this somewhat, but I seem to be having difficulty accessing the IsDefaultLinetype property to be able to exclude those.
"""Forcibly deletes a linetype, except for default types""" import rhinoscriptsyntax as rs import scriptcontext as sc import Rhino def DeleteLinetype(): lt_name=rs.GetLinetype() linetypes=sc.doc.Linetypes lt=linetypes.FindName(lt_name) index=lt.LinetypeIndex linetypes.Delete(index,True) DeleteLinetype()
Awesome! Thank you! I will try it and report back.
Don’t worry about the default linetypes. I don’t want them gone. Not sure why @dale thought the same. I must be miss communicating somewhere. The problem with the defaults (take Hidden for example) was that somehow it got edited with some crazy values and thus is unusable. I wanted to reset it back to default values.
Here’s another one that might help:
"""Deletes ALL linetypes that are currently unused, the defaults will automatically be re-loaded by Rhino. Note this will NOT delete any linetypes that are currently applied to objects in the file - you will need to remove the linetypes from those first.""" import scriptcontext as sc import Rhino def DeleteAllLinetypes(): linetypes=sc.doc.Linetypes for lt in linetypes: index=lt.LinetypeIndex linetypes.Delete(index,True) DeleteAllLinetypes()
Hmmm, both scripts work on the empty file I uploaded. But not on my file with geometry. I quickly tested and found out that if any linetype is assigned to a layer the script won’t delete it.
Neither script will delete linetypes that are assigned to something - I don’t see a way to force Rhino to do this, I’m looking at simply assigning continuous to everything, but it needs some coding to work on nested blocks.
Annotation Styles seems to handle that. But instead of replacing with a Default style it deletes the annotation… Not ideal. It also deletes the object inside the block.
You can try this as the nuclear option…
ResetAllObjLayerLinetypesToContinuous.py (1.3 KB)
Note, with script as posted you need to select objects. If you want to nuke everything in the file, uncomment the
rs.AllObjects() line and comment the next one.
It works! It changes everything to continuous and then I can use Purge to reset back to default linetypes.
The only instance I found it not to work is if the Block object has a linetype set in its properties, instead of the curve inside the block. In that case it does not change it. But I can always use SelBlockInstance and change them all at once to cotinues or by layer, and have all layers be continuous.
Thank you very much @Helvetosaur I hope your efforts do not discourage McNeel to fix these bugs and add a very much needed functionality to the linetype menu…
RH-67234 Linetypes cannot be deleted
OK, I fixed that (I think)…
ResetAllObjLayerLinetypesToContinuous.py (1.4 KB)
I know this subject may have been resolved but I also run into this very same problem with greyed out line types and the inability to edit them. They are not default line types and are line types from my custom template that I use when starting a new project.
Hi Tim -
This issue is on the list as RH-67234, which is still open.
I’m based in Finland and I’ve had similar issues. I think it may be a bug having to do with localization of Windows. More specifically, how the OS deals with units: comma vs. period as separator etc.
No, this issue is present on all systems.
Any update on this? Ran into this problem today where I couldn’t edit or delete a linetype I created.
Hi Hayden -
No. As you can see, it’s still on the 8.x list.
Ok. I’ll ask differently next time. H