04-18-2019
07:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-18-2019
07:23 AM
Hello,
The rule below works perfectly when i run it in a drawing. But when i place it in external rules and run it nothing happens. Someon an idea?
Imports System.IO Imports System.Collections Imports System
Dim IPJ As String Dim IPJ_Name As String Dim IPJ_Path As String Dim FNamePos As Long 'set a reference to the FileLocations object. IPJ = ThisApplication.FileLocations.FileLocationsFile 'get the location of the last backslash seperator FNamePos = InStrRev(IPJ, "\", -1) 'get the project file name with the file extension IPJ_Name = Right(IPJ, Len(IPJ) - FNamePos) 'get the project name (without extension) IPJ_ShortName = Left(IPJ_Name, Len(IPJ_Name) - 4) 'get the path of the folder containing the project file IPJ_Folder_Location = Left(IPJ, Len(IPJ) - Len(IPJ_Name)) oThisDoc = ThisDoc.Document If TYPE_PLAN = "Detailtekening" Then Extentie = ".ipt" Else If TYPE_PLAN = "Lassamenstelling" Or TYPE_PLAN = "Ssamenstelling" Then Extentie = ".iam" End If 'Full name of the to search .ipt or .ass' oThisFileName = ThisDoc.FileName(False) & Extentie Dim Folder As New IO.DirectoryInfo(IPJ_Folder_Location) Dim FileList As New List(Of String) For Each File As IO.FileInfo In Folder.GetFiles(oThisFileName,IO.SearchOption.AllDirectories) If File.FullName.Contains(oThisFileName) = True Then FileList.Add(File.FullName) NieuwFilePath = File.FullName doc = ThisDoc.Document 'Change the Referenced File' oFD = doc.ReferencedFileDescriptors(1).DocumentDescriptor.ReferencedFileDescriptor oFD.ReplaceReference(NieuwFilePath) Else MsgBox("the file " & oThisFileName & " not found in this project!") End If Next iLogicVb.UpdateWhenDone = True InventorVb.DocumentUpdate()
The problem is located that i can't get the custom propertie Type_Plan. Because when it's an external rule it doesn't read the prop. Someon knows how i can read that property?
Solved! Go to Solution.