08-16-2016
12:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-16-2016
12:02 AM
Hi Rossano,
I've tried your modifications in the following code:
Sub Main()
Dim StartTime As DateTime
Dim aElapsedTime As TimeSpan
StartTime = Now
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments
aFileNameWithoutExt = IO.Path.GetFileNameWithoutExtension(oAsmDoc.FullDocumentName)
For Each oRefDoc In oRefDocs
bFileNameWithoutExt = IO.Path.GetFileNameWithoutExtension(oRefDoc.FullDocumentName)
If oRefDoc.DocumentType = Inventor.DocumentTypeEnum.kPartDocumentObject Then
If InStr(bFileNameWithoutExt, "buis", CompareMethod.Text) = 1 Then
iProperties.Value(oRefDoc.DisplayName, "Custom", "aMeasure") = Measure.ExtentsHeight
iProperties.Value(oRefDoc.DisplayName, "Custom", "bMeasure") = Measure.ExtentsWidth
iProperties.Value(oRefDoc.DisplayName, "Custom", "cMeasure") = Measure.ExtentsLength
End If
End If
Next
aElapsedTime = Now().Subtract(StartTime)
bElapsedTime = aElapsedTime.TotalSeconds
' oWrite = System.IO.File.CreateText("X:\01 productie\25 Werkvoorbereiding\07 Zaaglijsten\" & aFileNameWithoutExt & ".txt")
' oWrite.WriteLine(aFileNameWithoutExt & vbCrLf & DateString & " " & Timestring)
' oWrite.WriteLine("All data was collected in " & Round(bElapsedTime, 2) & "s" & vbCrLf & "")
' oWrite.WriteLine("Tubes:" & vbCrLf & oListB)
' oWrite.Close()
End Sub
It does exactly the same as it did before (see screenshot). The rule returns the measurements from the assembly to the referenced documents, I want the measurements from referenced documents to be returned to the referenced documents themselves.
Stan.