- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I have an ilogic code that iterate through an assembly document and checks if vault state is "CHANGE ORDER" or not.
Then I want to access one property at drawings which have state "CHANGE ORDER" but I can't find out a code to access the drawing properties when I'm run Ilogic code from assembly document. The code below don't access drawing prioperties. Does anyone know how to write a code that works?
For Each docFile In openDoc.AllReferencedDocuments
If docFile.DocumentType = 12290 or docFile.DocumentType = 12291 Then
Dim FNamePos As Long
FNamePos = InStrRev(docFile.FullFileName, "\", -1)
Dim docFName As String
docFName = Right(docFile.FullFileName, Len(docFile.FullFileName) - FNamePos)
Dim mVltCon As VDF.Vault.Currency.Connections.Connection
mVltCon = VB.ConnectionManager.Instance.Connection
If mVltCon Is Nothing Then
MessageBox.Show("Not Logged In to Vault! - Login first and repeat executing this rule.")
Exit Sub
End If
Dim VaultPath As String = docFile.FullFileName
VaultPath = VaultPath.Replace("C:\Vault Workspace\", "$/") 'flip the slashes
VaultPath = VaultPath.Replace("\", "/")
Dim VaultPaths() As String = New String() {VaultPath}
Dim wsFiels() As AWS.File = mVltCon.WebServiceManager.DocumentService.FindLatestFilesByPaths(VaultPaths)
Dim mFileIt As VDF.Vault.Currency.Entities.FileIteration = New VDF.Vault.Currency.Entities.FileIteration(conn,wsFiels(0))
Dim lifeCycleInfo As VDF.Vault.Currency.Entities.FileLifecycleInfo = mFileIt.LifecycleInfo
If lifeCycleInfo.StateName = "ÄNDRINGS ORDER"
no = no + 1
oFile = txtfile
oAppend = IO.File.AppendText(oFile)
desc = iProperties.Value(docFName, "Summary", "Title")
'*****************
drwFName = Left(docFile.FullFileName, (Len(docFile.FullFileName) -3)) & "idw"
oDrawDoc = ThisApplication.Documents.Open(drwFName, True)
revNote = "Ingen info"
drwName= Left(docFile.DisplayName, (Len(docFile.DisplayName) -3)) & "idw"
revNote = iProperties.Value(drwFName, "Summary", "Comments")
'***************
oAppend.WriteLine(docFile.DisplayName & " " & desc & " " & lifeCycleInfo.StateName & " " & revNote)
oAppend.Flush()
oAppend.Close()
Else
End If
End If
Next
Solved! Go to Solution.