10-12-2021
07:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-12-2021
07:21 PM
Sub Main()
Dim oAsmDoc As Inventor.AssemblyDocument
Set oAsmDoc = ThisApplication.ActiveDocument
Zapnuti_occurrence oAsmDoc
End Sub
Sub Zapnuti_occurrence( oDoc As Inventor.AssemblyDocument)
Dim oSuppress_Occurrence As Boolean
Dim oOccurrences As ComponentOccurrences
oOccurrences =oDoc.ComponentDefinition.Occurrences
Dim oModelState As ModelState
Dim oModelState_created As Boolean
oModelState_created = False
For Each oOccurrence In oOccurrences 'tady to změnit na list
oSuppress_Occurrence = False
If oOccurrence.Suppressed = True Then
oOccurrence.Unsuppress
oSuppress_Occurrence = True
End If
If oOccurrence.DefinitionDocumentType = kAssemblyDocumentObject Then
If InStr(oOccurrence.Definition.Document.DisplayName, new_element) = 0 Then
oDoc.Update
End If
Rem In the Opened Asm File,All the oOccurrence were opened in memeroy,needn't use the document open method again; try this.
Zapnuti_occurrence oOccurrence.Definition.Document
End If
Next
oDoc.Save
End SubIn the Opened Asm File,All the oOccurrence were opened in memeroy,needn't use the document open method again; try this.