- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm working on a ilogic driven assembly where I want to be able to replace all components with a given placeholder, copy out files from a directory and put them back in the assembly again replacing the placeholder.
So far I've got it to work up until reinserting the new components as the component occurrence name changes when I insert the placeholder.
Here's an example of what I'm trying to do:
If ReplaceToPlaceholder = True Then 'Walls Component.Replace("Wall_Front", "PLACEHOLDER.ipt", False) End If AssemblyDir = Component.InventorComponent("MASTER") Dim Workpath As String = System.IO.Path.GetDirectoryName(AssemblyDir.Definition.Document.FullDocumentName) & "\" 'Defines the search path for BaseComponents Dim LibraryPath As String = Workpath & "\BaseComponents\" 'Define files for copying Dim WallPart As String = "Wall.ipt" If ReInsertParts = True Then 'Walls System.IO.File.Copy(LibraryPath & WallPart, Workpath & "Wall_Front" & ".ipt", True) Component.Replace("Wall_Front", "Wall_Front.ipt", False) End If
I have given both the placeholder and the part Wall_Front.ipt a "stabilized" name (I think... I changed the component Wall_Front:1 to Wall_Front) but whenever I replace it the placeholder part is called "PLACEHOLDER:1". I need the occurrence name to stay as Wall_Front to reinsert the part.
Any ideas how this can be done?
Thanks for any advice!
/Fredrik
Solved! Go to Solution.