Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JaneFan
in reply to: Olsndot

Hey @Olsndot ,

 

Here is updated code if you are getting document from ActiveEditDocument. Thanks for Rocky's suggestion.
Here is the updated code:

Sub EditUpdate()

Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = ThisApplication.ActiveEditDocument

Dim oEditOccu As ComponentOccurrence
Dim oTopDoc As AssemblyDocument
If Not (oAsmDoc Is ThisApplication.ActiveDocument) Then
Set oTopDoc = ThisApplication.ActiveDocument
Set oEditOccu = oTopDoc.ComponentDefinition.ActiveOccurrence
End If

Dim oOcc As ComponentOccurrence
Set oOcc = oEditOccu.SubOccurrences(1)

oOcc.edit
End Sub




Jane Fan
Inventor QA Engineer