Hide Table of Contents
FinishRecordingUndoObject2 Method (IModelDocExtension)

Ends recording of a SOLIDWORKS Undo object with the specified name and visibility.

.NET Syntax

Visual Basic (Declaration) 
Function FinishRecordingUndoObject2( _
   ByVal UndoObjectName As System.String, _
   ByVal MakeHidden As System.Boolean _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IModelDocExtension
Dim UndoObjectName As System.String
Dim MakeHidden As System.Boolean
Dim value As System.Boolean
value = instance.FinishRecordingUndoObject2(UndoObjectName, MakeHidden)
System.bool FinishRecordingUndoObject2( 
   System.string UndoObjectName,
   System.bool MakeHidden
System.bool FinishRecordingUndoObject2( 
&   System.String^ UndoObjectName,
&   System.bool MakeHidden


String that appears in the SOLIDWORKS Undo list
True to hide this object in the Undo list and from the user; false to make this object visible in the Undo list and to the user

Return Value

True if recording of the SOLIDWORKS Undo object ends, false if not



To add an object with the name UndoObjectName to the SOLIDWORKS Undo list, place the SOLIDWORKS API calls between IModelDocExtension::StartRecordingUndoObject and IModelDocExtension::FinishRecordingUndoObject2: 


For example, assume that your application creates a complex gear that requires many SOLIDWORKS API calls and you would like your SOLIDWORKS user to be able to undo that gear from the user interface at a later time. Your application can create an Undo object by calling:


  1. IModelDocExtension::StartRecordingUndoObject
  2. SOLIDWORKS API calls that create the gear
  3. IModelDocExtension::FinishRecordingUndoObject2 with MakeHidden = False

Now assume that your application performs many temporary operations that you do not want your users to see in the SOLIDWORKS Undo list, because they are not essential to the modeling and design process. For this case, your application can place the non-essential SOLIDWORKS API calls between IModelDocExtension::StartRecordingUndoObject and IModelDocExtension::FinishRecordingUndoObject2 with MakeHidden = True. The Undo object is still added to the SOLIDWORKS Undo list, but the user does not see it in the list.


WARNING: If your application hides an Undo object in the Undo list by setting MakeHidden = True and the Undo object is the first item in the SOLIDWORKS Undo list, then SOLIDWORKS discards the Undo object from the Undo list. If this happens, then the SOLIDWORKS API calls in this Undo object cannot be undone.


Similarly if the last item to be redone is a hidden API Undo object, then SOLIDWORKS discards it and the SOLIDWORKS API calls cannot be redone.


Only SOLIDWORKS operations that support Undo are undone. Both SOLIDWORKS API and non-API operations are undone.


See Also


SOLIDWORKS 2013 FCS, Revision Number 21.0

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   FinishRecordingUndoObject2 Method (IModelDocExtension)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2017 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.