10-17-2019
02:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-17-2019
02:53 PM
You can run this on the iPart factory (parent file) to break the link of all the ipart members (children)
Dim oParent As iPartFactory oParent = ThisDoc.Document.ComponentDefinition.iPartFactory Dim oRow As iPartTableRow For Each oRow In oParent.TableRows oParent.CreateMember(oRow).BreakLinkToFactory Next
You can try this to delete event triggers
Sub Main
oDoc = ThisApplication.ActiveEditDocument
'---------------------------------------------------------
'[ delete all existing event triggers
'Get access to the set of Event Triggers
Dim oEventTriggersSet As PropertySet
oEventTriggersSet = GetEventTriggersSet(oDoc)
Dim oRuleTrigger As Inventor.Property
For Each oRuleTrigger In oEventTriggersSet
oRuleTrigger.Delete
Next
']
End Sub
Function GetEventTriggersSet(oDoc As Document) As Inventor.PropertySet
On Error Resume Next
oEventTriggersSet = oDoc.PropertySets.Item("iLogicEventsRules")
If oEventTriggersSet Is Nothing Then
oEventTriggersSet = oDoc.PropertySets.Item("_iLogicEventsRules")
End If
If oEventTriggersSet.InternalName <> "{2C540830-0723-455E-A8E2-891722EB4C3E}" Then
Call oEventTriggersSet.Delete
oEventTriggersSet = oDoc.PropertySets.Add("iLogicEventsRules", "{2C540830-0723-455E-A8E2-891722EB4C3E}")
End If
If oEventTriggersSet Is Nothing Then
oEventTriggersSet = oDoc.PropertySets.Add("iLogicEventsRules", "{2C540830-0723-455E-A8E2-891722EB4C3E}")
End If
If oEventTriggersSet Is Nothing Then
Trace.WriteLine("!!!!!!! oEventTriggersSet is Nothing !!!!!!", "iLogic") ''debug
'Logger.Info("!!!!!!! oEventTriggersSet is Nothing !!!!!!")
Exit Function
End If
On Error Goto 0
Return oEventTriggersSet
End Function
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com