Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: emanuel.c

You know your file system, files, and documentation routine a whole lot better than I do, so I would not venture to suggest which way would work best for you in the end.  I just wanted to remind you of a few potentially problematic scenarios that could arise in that situation, and suggest caution.  I don't know how your system currently names your components in your assemblies, or if you use a routine or tool to rename all of the components after the fact or not, to stabilize them.  My system names the components using the file name, without the file extension, then automatically adds the ":1", ":2", and so on after the name, to keep them unique.  If yours is the same way, and you have multiple components in your main assembly's top level all representing one document, then some components within your sub assemblies representing that same document, and you did not rename any of your components in any way, then I suppose the end result of running your code or another similar one on all levels of the assembly would simply result in the document's iProperty being written to multiple times, but always with the same name, so do big deal either way.  The iProperty would still just contain the file name, without the file extension.  Seems like a routine that could be done on a per-document basis just as easily as through an assembly structure, if that information is always exactly what you need.  I would be more tempted to get the information from the document's file name though, instead of from the component name, but that's my personal preference.

If you need further help writing a different variation of your code, I'm sure we can help with that.  When working my way through a multi-level assembly structure though, I would suggest using the API way of accessing the iProperties, instead of using that iProperties.Value() snippet.  Again...personal preference.  One think to think about is, what if the same component name exists in multiple places throughout the assembly's levels.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)