Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Transfer the information to other files.
I'm not getting.
Can anyone help me understand?
Thanks!
Iva.btblan
Solved! Go to Solution.
Transfer the information to other files.
I'm not getting.
Can anyone help me understand?
Thanks!
Iva.btblan
Solved! Go to Solution.
I can't open your file because I have Inventor 2020 installed.
Are you trying to copy a user parameter definition from one file to another file? Grettings!
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
Thanks for listening!
I need to transfer all parameters to other files.
I don't understand and I can't do it.
I'm sending the files again.
Can you help me?
Use Parameter export / import as xml file.
You can choose in the options wether all parameters or only key parameters are exported.
Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
I have 546 files.
I want to transfer all information to everyone.
Performing the transfer one at a time is a lot of time wasted
Nice Tool, did you write it?
There is some code in Rule Create Parameter that throws an exception.
I do not understand the sense of this code.
Disable the code and try again.
Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
I would like to contact Mr. Curtis W.
About the material from that address: https://forums.autodesk.com/t5/inventor-customization/copy-custom-parameters-from-one-ipt-to-multipl...
Fantastic subject and I want to take some questions.
Thanks!
Sorry for the delay in responding, I have been very busy this week.
I have seen several errors in the rules, and I have modified some approaches to adapt it to my working method.
First in your file, to access each part file from the list you define it through item (this will give the fullfilename of the file, this is a string) and you need to specify an integer to access each item in the multivaluelist.
On the other hand, when you defined a mass, you have had a conflict of units, that is why in your file the expression remains in red, to fix it I have placed the string "kg / cm ^ 3"
What I modify below is the focus, and I hope it is what you will need for parameter copying. Work with subroutines, remove the "create parameter" and "delete parameter" rules and enter them in the "batch rule". I did this to simplify the commands.
So, you first create the parameters you need, in your main file that contains the form. These parameters can be text, boolean or numeral. They can also be multivaluelist.
Once you have created all the parameters you can open the form and select all the part files to which the previously created user parameters will be copied.
Then run the rule and open the files to verify that the copying has been done correctly.
Here I show you the changes made in the Batch Rule
Sub main oRUSure = MessageBox.Show("Are you sure you want to: " & vbLf & " " & Parameter("ActionList"), _ "Start Batch Process?",MessageBoxButtons.YesNo,MessageBoxIcon.Question) If oRUSure = vbNo Then Exit Sub Dim doc As PartDocument = ThisDoc.Document Dim oCD As PartComponentDefinition = doc.ComponentDefinition '[ batch process the list Of files ----------------------------------------------------- If Parameter("Part_Files_List") = "< No Files >" Then MessageBox.Show("There are no files in the list.", "iLogic",MessageBoxButtons.OK,MessageBoxIcon.Information) Exit Sub End If Dim invDoc As Document For i As Integer = 0 To MultiValue.List("Part_Files_List").Count - 1 'open the indexed file, false opens the file without generating the graphics invDoc = ThisApplication.Documents.Open(MultiValue.List("Part_Files_List").Item(i), False) If Parameter("ActionList") = "Delete All Custom Parameters" Then For Each oParam As Inventor.Parameter In invDoc.componentdefinition.Parameters.UserParameters Try oParam.Delete Catch End Try Next Else ' Copy All Custom Parameters from main Document to InvDoc Try For Each oParam As Inventor.Parameter In oCD.Parameters.UserParameters If oParam.Name <> "Part_Files_List" And oParam.Name <> "ActionList" Then checkParam(oParam, invDoc.componentdefinition ) End If Next Catch End Try End If invDoc.update invDoc.Save invDoc.close Next '] iLogicVb.UpdateWhenDone = True MessageBox.Show("Batch processing files is complete.", "iLogic", MessageBoxButtons.OK, MessageBoxIcon.Information) End Sub Sub checkParam(oParam As Inventor.Parameter, RefCD As PartComponentDefinition) Dim oUserParameters As UserParameters = RefCD.Parameters.UserParameters Dim oList As New ArrayList, oExprList As ExpressionList If oParam.ExpressionList.Count = 0 Then Try If oUserParameters(oParam.Name).Units = oParam.Units Then oUserParameters(oParam.Name).Expression = oParam.Expression Else oUserParameters(oParam.Name).Delete oUserParameters.AddByExpression(oParam.Name,oParam.Expression,oParam.Units) ' AddByValue(oParam.Name, oParam.Value, oParam.Units) End If Catch oUserParameters.AddByExpression(oParam.Name,oParam.Expression,oParam.Units)' .AddByValue(oParam.Name, oParam.Value, oParam.Units) End Try Else Try Dim List(0 To oParam.ExpressionList.Count - 1) As String For t As Integer = 0 To oParam.ExpressionList.Count-1 List(t) = oParam.ExpressionList(t+1) Next Try If oUserParameters(oParam.Name).Units = oParam.Units Then oExprList = oUserParameters(oParam.Name).ExpressionList Call oExprList.SetExpressionList(List, False) oUserParameters(oParam.Name).Expression = oParam.Expression Else oUserParameters(oParam.Name).Delete oUserParameters.AddByExpression(oParam.Name,oParam.Expression,oParam.Units) oExprList = oUserParameters(oParam.Name).ExpressionList Call oExprList.SetExpressionList(List, False) oUserParameters(oParam.Name).Expression = oParam.Expression End If Catch oUserParameters.AddByExpression(oParam.Name,oParam.Expression,oParam.Units) oExprList = oUserParameters(oParam.Name).ExpressionList Call oExprList.SetExpressionList(List, False) oUserParameters(oParam.Name).Expression = oParam.Expression End Try Catch End Try End If End Sub
I share the file for those who want to download and analyze it, but it is in the Inventor 2020 version and it says you have 2015, so put part of the main code snippet
Hope this helps with your problem, or throws in some new idea so you can solve it. Cheers!
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
Thank you!
Wonderful!
I am very grateful for your help.
That help of yours was something of great joy.
Thank you!