"In-place" editing refers to placing a part or sub-assembly document in edit mode, not by directly opening the document, but, via an occurrence in an assembly that the part or sub-assembly represents. It is in this case limited to the context of an assembly, i.e. editing a part or sub-assembly occurrence from within the assembly document.
If an assembly document is open and a part document or a component of the part document (e.g. sketch or feature) has been activated for edit, then the active edit object would be the part document or the component (sketch or feature) respectively, but, the active document would still be the assembly through which the part has been activated for edit. If ?In-place?edit is not active with just the assembly document open then the active document and the active edit object would both be the assembly.
Therefore, in order to determine if you are in an "In-Place" edit session you have to compare the ActiveDocument against the ActiveEditObject. If they are the same, then that would mean some component in the assembly has been activated for edit, as in the following code fragment:
If Not _InvApplication.ActiveDocument Is _
_InvApplication.ActiveEditObject Then
' Do something here as a result
End If
However in the above code there is a caveat. This code in itself is not enough to determine if you are in an In-Place edit session. The code will work if you are in an In-Place edit session, however it will also work if the active document is a Drawing document or a Part document. Hence we need an additional check to see if the current document that we are working with is an Assembly document. The following code fragment demonstrates this:
If _InvApplication.ActiveDocumentType = _
kAssemblyDocumentObject Then
If Not ThisApplication.ActiveDocument Is _
_InvApplication.ActiveEditObject Then
' Do something here as a result
End If
End If
The above code would be sufficient to suggest if In-place editing is active in versions prior to Inventor R6 but, for later versions which have the ability to create features in assemblies (e.g. we can create (activate) a new sketch in the assembly document) the code would suggest that In-place editing is active when actually an assembly feature is being edited. In order to account for this we could get the ActiveOccurrence and check if indeed an occurrence has been activated for edit. The following code fragment demonstrates this:
If _InvApplication.ActiveDocumentType = _
kAssemblyDocumentObject Then
Dim oAssemDoc As AssemblyDocument
oAssemDoc = _InvApplication.ActiveDocument
If Not oAssemDoc.ComponentDefinition. _
ActiveOccurrence Is Nothing Then
MsgBox("In-Place edit session in effect!")
' Do something useful
End If
End If
As you might have noticed, checking to see if an occurrence has been activated for edit would suggest that In-place editing is active.