Hi all,
I'm trying to replace a component within an assembly using ilogic, however my project file is always called something different. Is there a way to change only this part of the file string? I'm new to ilogic and any help would be appreciated.
(1201000 needs changed to the current project name 1201001)
Component.Replace("230 SBF Wheel Assembly CCW:1","O:\Inventor Projects\1201000\Workgroup\Wheel\230 Wheel\CW\230 SBF Wheel Assembly CW.iam", True)
Thanks!
Solved! Go to Solution.
If you make a new string
Dim strProjectName as String
and then set it to a value
strProjectName = "1201000"
Then you could do this
Component.Replace("230 SBF Wheel Assembly CCW:1","O:\Inventor Projects\" & strProjectName & "\Workgroup\Wheel\230 Wheel\CW\230 SBF Wheel Assembly CW.iam", True)
And programmatically change strProjectName
strProjectName = "1201001"
And then the call would be the same
Component.Replace("230 SBF Wheel Assembly CCW:1","O:\Inventor Projects\" & strProjectName & "\Workgroup\Wheel\230 Wheel\CW\230 SBF Wheel Assembly CW.iam", True)
If you were smart about how you organized it, you could use a for loop and run through your projects.
Thanks to dkatz for the solution.
Dan can't you use the pat of the assembly as a reference? instead of entering something all the time?
Dim oPath As String oPath = ThisDoc.Path & "\" MessageBox.Show("Path: " & oPath, "iLogic")