We have a fairly involved program here that allows the user to select a particular material from a cascading type of list structure and go all the way to a unique ASI part number. Then if in SW, the info such as part number, description, etc can be inserted into the currently open part. As it was written years ago, it puts that info into the custom properties area of the SW part, and at this time I want to change it so it puts it into config specific areas instead. I can get it to access the config specific properties, but can't seem to figure out how to get & write to the User Specified Name in the properties box under the Part number displayed when used in a bill of materials.
I have pasted in my test code here so you can see what I have tried. Anybody see my error and can offer some assistance, please?
Dim swApp As Object Dim Part As Object Dim boolstatus As Boolean Dim SwConfig As SldWorks.Configuration Dim ConfigName As String Dim AltName As Variant Dim ConfigDesc, ConfigLength As String
Sub main() Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc
Set SwConfig = Part.GetActiveConfiguration ConfigName = Part.GetActiveConfiguration.Name
boolstatus = True SwConfig.UseAlternateNameInBOM = boolstatus ....This next line is the bad line. AltName = Part.SwConfig.alternateName ConfigDesc = Part.CustomInfo2(ConfigName, "Description") ConfigLength = Part.CustomInfo2(ConfigName, "Length")
End Sub
WT