I'm trying to make an automatic properties macro that, among other things, notes the original creator of a drawing/part/assembly, but I'm having a little difficulty. I've been trying swApp.ActiveDoc.FirstFeature.CreatedBy, but run on a part it's returning a username that I think belongs to the person who first set up our network server. Doing this on a drawing file returned the name of the person who first created the template.
Is there any reliably universal way to get the person who created the particular file? And will work for all three big file types? (And hopefully in the case of a file made by creating a copy of an existing file, would return the name of the person who made that copy?)
I don't know of a way to do that.
FirstFeature is always returning the same name because the templates contain features. A template is simply a SW file with a different extension. It already contains (usually) some lights, planes, etc. If you do a fresh install of SW, it will create some default templates from scratch that will contain the username of whoever was logged in when the templates were created. You might look on down the tree for the first feature that's not already present in the template.
For a copied file... It's a copy. How would it contain any information about who copied it? There might be a way you could dig that out from the OS side, but SW looks at file contents. So it would be just like trying to figure out who made a photocopy of the document that someone else signed.