import diagnostics gaps heal only from a macro

I have to deal with file translations from other cad programs a lot. Some of the assemblies have 100 parts or more. 99% of the issues with the imports can be fixed by running "import diagnostics". I manually correct the issues currently, it turns out that the majority of the issues are fixed with the "attempt to heal all gaps"

is there a way to call "import diagnostics, attempt to heal all gaps"  from a macro?

Then i can use something like "#task" to batch the macro to the files I need worked on.

Thanks

Mike Russell

SolidworksApi macros
Answers 4
US
US 2018-03-14 Best Answer

Hi  Mike

Dim swApp As Object

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

Sub main()

    Set swApp = Application.SldWorks

    Set Part = swApp.ActiveDoc

    ' 2017 SOLIDWORKS API Help - ImportDiagnosis Method (IPartDoc)

    longstatus = Part.ImportDiagnosis(True, False, False, 0)

End Sub

BiI SAP-PDM

MR
MR 2018-03-14

Wow thanks for the Quick response.

Thanks for the help link and I will give the code a try.

MR
MR 2018-03-14

That did the job thanks Ulf !

CR
CR 2020-01-14

Hi, 

I have the same issue. Any luck with the writing of the macro ?

C.