@A.K.CORTEL , you can export/import the parameters via the XML to do this manually, and then your assembly will have these parameters ready in the assembly, so that you can push the parameter values to the parts via code.
If that won't work for your needs, you could use this to copy the parameters of all parts to the the assembly?
' Get the active assembly document
Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
' Get user parameters collection of the assembly
Dim oAsmParams As UserParameters = oDef.Parameters.UserParameters
' Track number of parameters added and skipped
Dim paramsAdded As Integer = 0
Dim paramsSkipped As Integer = 0
' Process each referenced document
For Each refDoc As Document In oDoc.AllReferencedDocuments
Try
' Get user parameters from referenced document
Dim refParams As UserParameters = refDoc.ComponentDefinition.Parameters.UserParameters
' Process each parameter in referenced doc
For Each refParam As UserParameter In refParams
Try
' Check if parameter already exists
Dim existingParam As UserParameter = Nothing
Try
existingParam = oAsmParams.Item(refParam.Name)
Catch
' Parameter doesn't exist - add it
oAsmParams.AddByValue(refParam.Name, refParam.Value, refParam.Units)
paramsAdded += 1
Logger.Info($"Added parameter {refParam.Name} from {refDoc.DisplayName}")
Continue For
End Try
' Parameter exists - skip it
paramsSkipped += 1
Logger.Info($"Skipped existing parameter {refParam.Name}")
Catch ex As Exception
Logger.Error($"Failed to process parameter {refParam.Name}: {ex.Message}")
End Try
Next
Catch ex As Exception
Logger.Error($"Error processing document {refDoc.DisplayName}: {ex.Message}")
End Try
Next
' Show summary
MessageBox.Show($"Parameters added: {paramsAdded}" & vbCrLf & $"Parameters skipped: {paramsSkipped}", "Parameter Copy Complete")
