Dear friends, I have a few questions to ask of you, urgently!
I want to use the code to automatically import DMS file allows CMM automatic measurement, but a lot of problems when running:
1, I created a program, perform VB code automatic import DMS file after the probe into a Test 1, the tip becomes a blank. The DMS imported content can not recognize the probe calls; (Picture 1)
2, when manually import DMS file have dialog box, there is the option , or how to use VB6 code to control these options; (Picture 2)
3, I create a new program, when automate the import DMS, PC-DMIS pop error "Could not Open File". How to solve it. (Picture 3)
4, how to use VB6 code to start and create a new program file on PC-DMIS CAD 4.2;
5, the attachment is my code and materials, to help me check what went wrong, thank you! I use the version of the PC-DMIS CAD 4.2. I was inexperienced, I hope there is code directly advise. Thank you!
Test Note that you need to Name.txt files on the D drive, dms folder is also placed in the D drive.
VB code
Dim DmisApp As PCDLRN.Application
Dim DmisPart As PCDLRN.PartProgram
Dim DmisParts As PCDLRN.PartPrograms
Dim DmisCmd As PCDLRN.Command
Dim DmisCmds As PCDLRN.Commands
Dim DmisProbes As PCDLRN.Probes
Dim DmisProbe As PCDLRN.probe
Dim DmisTips As PCDLRN.Tips
Dim DmisTip As PCDLRN.Tip
Sub part1()
Set DmisApp = CreateObject("PCDLRN.Application")
If DmisApp Is Nothing Then
Exit Sub
End If
Set DmisPart = DmisApp.ActivePartProgram
Set DmisCmds = DmisPart.Commands
CommandCount = DmisCmds.Count
Set DmisCmd = DmisCmds.Item(CommandCount)
DmisCmds.InsertionPointAfter DmisCmd
Set DmisCmd = DmisCmds.Add(GET_PROBE_DATA, True)
retval = DmisCmd.PutText("D2-95", FILE_NAME, 0)
You said you're inexperienced? What are you doing playing with Visual Basic code? There are far easier ways to program and run a part measurement program. For example, Visual Basic is not taught until the advanced courses. Go to
https://www.hexagonmetrologyu.com and enroll in all the free courses available. This is the best advice I can give you. Have been programming for a couple years and just recently took a closer look at using Visual Basic.
You said you're inexperienced? What are you doing playing with Visual Basic code? There are far easier ways to program and run a part measurement program. For example, Visual Basic is not taught until the advanced courses. Go to
https://www.hexagonmetrologyu.com and enroll in all the free courses available. This is the best advice I can give you. Have been programming for a couple years and just recently took a closer look at using Visual Basic.