- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Link User Parameters by selecting the part file to link to
I'm trying to write ilogic code to link user parameters between file that will allow me to select the PART I want to drive my parameters from? I have a code that will work but I need to put the file path and name in the code, I can't get it to work if I try and select the part. The file with the parameters is a .ipt and the parameters to be linked are _1 in the comments. I'm just missing the select file to link to in my code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is a post on the pick tool. This might be what your looking for.
https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/ilogic-pick-function/td-p/7550908
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @nowell.colsenXK53F. Just in case you were looking for more of a file dialog, so that you can select a file, instead of the Pick function, some code like this might be useful to you. It is a simple custom Function with no 'input' variables, that will open a file dialog (just like when you use Inventor's Open dialog), but it doesn't actually open the selected file. Instead it just returns the full file name of the selected file.
Sub Main
oFileName = SelectFile
MsgBox("oFileName = " & oFileName,,"")
End Sub
Function SelectFile() As String
Dim oFileDialog As Inventor.FileDialog
ThisApplication.CreateFileDialog(oFileDialog)
oFileDialog.DialogTitle = "Select A File."
oFileDialog.InitialDirectory = ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath
oFileDialog.Filter = "Autodesk Inventor Files (*.iam;*.dwg;*.idw;*.ipt:*.ipn;*.ide) | *.iam;*.dwg;*.idw;*ipt;*.ipn;*.ide | All files (*.*)|*.*"
oFileDialog.MultiSelectEnabled = False
oFileDialog.OptionsEnabled = False
oFileDialog.InsertMode = False
oFileDialog.CancelError = True
Try
oFileDialog.ShowOpen
Return oFileDialog.FileName
Catch
Return ""
End Try
End Function
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS)
.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :bulb: or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Are you starting your rule/code while a part document is open and the active document, or do you have an assembly document open & active when you start the rule/code. Is this code in a 'local' rule (saved within the document) or an external rule? Which version of Inventor are you using (year)? If you are using Inventor 2022, are there any ModelStates involved?
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report