Hide Table of Contents
IsDirty Method (ISwDMConfiguration10)

Gets whether this configuration is dirty (i.e., needs to be updated).

.NET Syntax

Visual Basic (Declaration) 
Function IsDirty() As System.Boolean
Visual Basic (Usage) 
Dim instance As ISwDMConfiguration10
Dim value As System.Boolean
 
value = instance.IsDirty()
C# 
System.bool IsDirty()
C++/CLI 
System.bool IsDirty(); 

Return Value

True if the configuration is dirty, false if not

Example

Visual Basic for Applications (VBA)

Option Explicit

Sub main()

    Const sLicenseKey           As String = "your_license_key" ' Specify your license key

    Const sDocFileName          As String = "c:\test\Wiper_Plate_Assy.SLDASM" ' Specify your document
  
    Dim swClassFact             As SwDocumentMgr.SwDMClassFactory

    Dim swDocMgr                As SwDocumentMgr.SwDMApplication

    Dim swDoc                   As SwDocumentMgr.SwDMDocument

    Dim swCfgMgr                As SwDocumentMgr.SwDMConfigurationMgr

    Dim vCfgNameArr             As Variant

    Dim vCfgName                As Variant

    Dim swCfg                   As SwDocumentMgr.SwDMConfiguration10

    Dim nDocType                As Long

    Dim nRetVal                 As Long

    Dim i                       As Long

    Dim bRet                    As Boolean


    ' Determine type of SOLIDWORKS file based on filename extension

    If InStr(LCase(sDocFileName), "sldprt") > 0 Then

        nDocType = swDmDocumentPart

    ElseIf InStr(LCase(sDocFileName), "sldasm") > 0 Then

        nDocType = swDmDocumentAssembly

    ElseIf InStr(LCase(sDocFileName), "slddrw") > 0 Then

        nDocType = swDmDocumentDrawing

    Else

        ' Probably not a SOLIDWORKS file

        nDocType = swDmDocumentUnknown

        ' So cannot open

        Exit Sub

    End If


    Set swClassFact = CreateObject("SwDocumentMgr.SwDMClassFactory")

    Set swDocMgr = swClassFact.GetApplication(sLicenseKey)

    Set swDoc = swDocMgr.GetDocument(sDocFileName, nDocType, True, nRetVal): Debug.Assert swDmDocumentOpenErrorNone = nRetVal

    Set swCfgMgr = swDoc.ConfigurationManager

    Debug.Print "File = " & swDoc.FullName
    Debug.Print "  ActiveCfgName    = " & swCfgMgr.GetActiveConfigurationName

    vCfgNameArr = swCfgMgr.GetConfigurationNames

    For Each vCfgName In vCfgNameArr
        Set swCfg = swCfgMgr.GetConfigurationByName(vCfgName)
        Debug.Print vCfgName & " -> Dirty Flag = " & swCfg.IsDirty
     Next

End Sub

Remarks

This method only supports documents saved in SOLIDWORKS 2006 and later.

If the configuration is dirty, then you can update its date by activating the configuration in SOLIDWORKS and saving the document while the configuration is active.

 

See Also

Availability

SOLIDWORKS Document Manager API 2008 SP5


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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   IsDirty Method (ISwDMConfiguration10)
*Comment:  
*   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:

x

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
x

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.