there is also difference between model created in sw2008 and converted to 2009 and new created weldment in 2009. Another property sheet of structural member. Converted is missing groups and is crashing by weldmentprofilepath command.
if you are creating new part you can also create temporary dummy assembly and put your part in there, for changing profile path and save your part and throw assy away.
make assembly from your part first
'-------------------------------------------------
'
' Preconditions: Assembly document open that has part with a feature named Structural Member1.
'
' Postconditions: Profile changed to profile specified in macro.
'...
Dim s As String
Dim arr() As String
s = Dir("C:\temp\*", vbNormal)
ReDim arr(0)
Do While s <> ""
Select Case MsgBox("Add file " & s & " to array?", vbYesNoCancel Or vbExclamation Or vbDefaultButton1, App.Title)
Case vbYes
arr(UBound(arr)) = s
ReDim Preserve arr(UBound(arr) + 1)...
Is it possible to add mate, without first select something with selectbyID2? Or how to make selection invisible. I don't like it, when macro is running to see what it is doing.