I would like to get access to a list of Object Styles entries in Dynamo. At this stage I do not want to edit, just check if any entries exist in the “Imported Objects” pane, as per image (attached).
I’m guessing this needs a new Python node to be built - has anyone done anything like this before? Thanks for your help.
Finally Andreas is sleeping so I can answer a question for you. LOL.
Here’s the deal. Imported Object Styles that you are looking to identify don’t really have a unique identifier within bigger Graphics Styles container so it makes it a little tricky to get them out of there. They supposedly all belong to OST_ImportedObjectStyles Category but a filter set up like that fails to return anything. I went the brute force way which might seem a little weird, but it gets the job done. I am assuming that all imported categories are coming from DWG files which gives them an extension *.dwg in their name. You probably noticed that. Imports in Families is a default one that will be there whenever you open a project with imported stuff or start a fresh one. It might be empty or it might have some stuff in it. I am giving you two ways to get those imported categories:
If you know the full name of the category and want only contents of that one particular one use method one:
If you don’t know the name but you are guessing like I did that they came from CAD and thus will carry a *.dwg extension in their name, use method two to get all Imported Categories that have that string in their name. Warning, results might be overwhelming if you have a lot of imports. Just saying.
It works beautifully, thank you so much Konrad. After typing your code out manually (which helped me understand Python a bit more I was able to test the various options and also build a bit more wrapping to make it work in my environment. See image below… and thanks again!
I am new to Dynamo, please excuse my lack of experience, and by default some of my sillier questions.
Is it possible to edit this method to return a list of object styles that were not imported into the project.
I need to extract the Object Styles for the categories (& subcategories) used in a client template. This client requires the list of categories, line weight, color and line pattern.
I am under the impression they will want to modify this list and push it back into the template, could this be done?
Please post this question as a new thread. This is an old question, but given previous forum limitations no one was able to know that it was even asked. Also, its better to post a new question in a new thread rather than hijacking an already existing one since title will not be very descriptive.