First off, rely heavily on the API help from the SW help menu.
FileName = DwgDoc.CustomInfo2(configuration, fieldName1) & "-" _ & DwgDoc.CustomInfo2(configuration, fieldName2) retval = DwgDoc.SaveAs4 (FileName, Version, Options, &Errors, _ &Warnings)
Where: FileName = Name of drawing to save configuration = Name of part configuration (use View.ReferencedConfiguration to extract from your drawing view) fieldName1&2 = Name of property with values Proyecto & Piezanum See API help for other variables
You should declare all variables.
If you want to buy a SW utility from my site, I'll write it for you. They start at $10 but you can download and use it in a limited but still useful mode until registered.
formatting link
Kent KCS Company
formatting link