Not sure if you are familiar with this process, or if it would work for you, but you could mark all your UserParameters as 'Key', then export them to an external XML file. Then, you can import them into another document. The process of marking all user parameters as Key is relatively simple to do by code, and there is actually a simple iLogic API line of code for the export or import step.
Dim oDoc As Document = ThisDoc.Document
Dim oUParams As UserParameters = Nothing
If (TypeOf oDoc Is AssemblyDocument) OrElse (TypeOf oDoc Is PartDocument) Then
oUParams = oDoc.ComponentDefinition.Parameters.UserParameters
ElseIf (TypeOf oDoc Is DrawingDocument) Then
oUParams = oDoc.Parameters.UserParameters
Else
Return
End If
For Each oUParam As UserParameter In oUParams
Try : oUParam.IsKey = True : Catch : End Try
Next oUParam
Dim sXMLFile As String = ThisDoc.PathAndFileName(False) & ".xml"
iLogicVb.Automation.ParametersXmlSave(oDoc, sXMLFile, XmlSaveOption.KeysOnly)
'iLogicVb.Automation.ParametersXmlLoad(oDoc, sXMLFile)
This assumes that you have not marked any of your ModelParameters or other parameter types as Key. If you have, then you may need to include a little more code to temporarily set those to not being Key, then export, then set them back as Key. The last line of code in the example above would be the one used for importing (loading) parameters into a document from an already existing XML file, just for reference, but would not really be used in the example above.
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)