+1

Have PC-DMIS save mid program automatically

Richmond il y a 2 mois dans Metrology Software / PC-DMIS mis à jour par Yuan Ren il y a 3 semaines 4

When running larger programs in PC-DMIS on my computer, if I have any kind of error the software usually freezes then closes on me. Would it be possible to have the software save periodically in the background while its running. Right now I stop the program 3-5 times to save it so if it crashes I dont have to start from the beginning.

Make a Basic Script:

Sub SaveDuringExecution()

'Create objects
Dim PCDMISApp As Object
Set PCDMISApp = CreateObject("PCDLRN.Application")

Dim PCDMISPart As Object
Set PCDMISPart = PCDMISApp.ActivePartprogram

'Save existing program
PCDMISPart.Save

' finish
Set PCDMISApp = Nothing
Set PCDMISApp = Nothing

End Sub

Put it in a subprogram and you can easily summon the script in your partprogram by typing 'CALLSUB' and select the subprogram.

You can also run the sctript directly in the partprogram but it's easier when you place it in a subprogram.

But if you check out the PCDMIS forum (Nexus), you can find answers for questions like these ;)

I used the Basic script as Multi- station inspection with CMM 

So my Basic scrip is complicated as you, but I can`t  solution  that read-only program

(I haven`t add auto create folder) 

Image 627


Sub Main(str1 As String, str2 As String, str3 As String)

Dim App As Object
Dim Part As Object
Dim Cmds As Object
Dim Cmd As Object
Dim FName As String
Dim SName As String
Dim TName As String

Set App = CreateObject("PCDLRN.Application")
Set Part = App.ActivePartProgram
Set Cmds = Part.Commands

FName =Part.FullName
SName =str1 & str3 & "/" & Part

'MsgBox (FName)

If Dir(SName) <> "" Then

Value = MsgBox(SName & " already existed, program NOT saved! Please Create FDU Folder and manual save as program data",48,"PC-DMIS")

Exit Sub

End If

Part.Save

FileCopy FName, SName

End Sub

I need to learn the BASIC programming language. That stuff is completely foreign to me. Do you have any suggestions for the best online classes ? 

I know a little, and learned from the PCDMIS forum and alot of trial and error.

Ask Hexagon where you can get an education on Basic.