Search Results for

    Show / Hide Table of Contents

    Method EnsureIsDirty

    EnsureIsDirty(ref DocumentId)

    Ensures that a document is dirty before performing modifications.

    Declaration
    [OperationContract]
    [AvailableSinceVersion(7, 6, 0, 0)]
    void EnsureIsDirty(ref DocumentId ioDocumentId)
    Parameters
    Type Name Description
    DocumentId ioDocumentId

    Identifier of the document to modify (IN) / identifier of the document ready to be modified (OUT).

    Remarks

    A new revision of the document may have been created, in which case the returned document is not the same than the initial document.

    An exception is thrown if the document cannot be modified.

    This method must be called before any modification is attempted on a document.

    StartModification(string, bool) must be called before calling this method.

    This method is available since v7.6.

    Examples
    DocumentId docId = TopSolidHost.Documents.EditedDocument;
    if (docId.IsEmpty) return;
    
    if (TopSolidHost.Application.StartModification("My Modification", false)) 
    {
    	try
    	{
    		TopSolidHost.Documents.EnsureIsDirty(ref docId);
    
    		// Perform my modification on document.
    
    		TopSolidHost.Application.EndModification(true, true);
    	}
    	catch
    	{
    		TopSolidHost.Application.EndModification(false, false);
    	}
    }
    In this article
    Back to top
    • Term of use
    • Corporate information
    • Privacy Policy - GDPR

    Copyright ©2025 TopSolid - All rights reserved.