Hi, i am trying to get all line styles in a background opended document in order to delete them but i can’t find a solution. Normally I would use the node “Tool.GetLineStyleByName” from Steam Nodes but this only works in the current document.
Here’s a related thread you might find interesting… Lots of issues to consider!
@solamour for the additional feedback. After thinking more about this, it seemed better to wrap all of this up into one node. One key piece was calling the Transaction manually rather than the TransactionManager. No matter how I tried to slice it, it kept telling me I couldn’t edit because no transaction was open.
from Autodesk.Revit.DB import *
Of course if you click into the Steam node you can see how the python is working.
Hope that is useful,
I have searched aorund the web for a solution but everything I can find is not working with background documents.
I am having difficulty with this graph. Basically what I want to do is remove all of the Line Styles in the project that are not contained in a list.
I have used the Categories and Get Sub-Categories, filtered the list to remove the categories i want to keep, but i cant seem to delete the ones remaining.
I know that some of the remaining sub-cats are Revit defaults and cannot be removed. You will see 4 “Rubbish” line styles that i want to get rid of, which i cant.
Any help is apprec…
In the screenshot below you can see the node “Get Category Properties” this one would be the perfect one for finding the line styles".
Any ideas or alternatives to make it work with background documents?
Thanks for all your help.