hexagon logo

Excel to PC-DMIS and back again

So my company uses Excel to store our info and I am writing 2 VB scripts. The first script is executed at the start of the part program after the alignment and, after some user inputs, selects the correct excel file and imports the nominals and tolerances from the spreadsheet to the dimensions. At the end of the program a second script runs which exports the measured values of each dimension back to the spreadsheet. The problem however is that not all of the features are measured each time the part program is executed. I want the user to be able to skip measurements that are not needed. My script doesn't differentiate between skipped dimensions and measured so it might export an inaccurate value to the excel sheet. I am trying to solve this problem by having the first script also set the measured values of each feature based on the excel sheet. That way the value on the excel sheet will remain unchanged when the second script writes to it. The other possible solution is to only export values that were measured in the part program but I don't know any way to have the script determine that. Is there a function the returns whether a feature was measured or skipped during the current execution? Anyway my biggest problem is that I don't know the syntax to change the measured Z position of a feature to a value from excel. This is the code I have but it returns an error saying that it does not recognize "ZActual." Is there a good reference for syntax somewhere?

If Cmd.IsFeature then
Set DcmdID = Cmd.FeatureCommand
DimID = DCmdID.ID

If DimID = "HEAT PACK TOP" then
DCmd.ZActual = xlsheet.Range("J39").Value
End If
'repeat for a bunch of other features
End If

Any suggestions or solutions would be appreciated. Thanks.
Parents
  • I am also trying to use PC-DMIS to Excel. I do not program thru VB so the code is all foreign to me. I have seen in other threads that there is a spreadsheet available to use but can't seem to get a response when asking for it to be emailed. I have been able to get the data to go to Excel but it puts it all into seperate sheets and not into the same page. Any and all help with this would be greatly appreciated as I am having to enter all the data in by hand.

    Thanks!
Reply
  • I am also trying to use PC-DMIS to Excel. I do not program thru VB so the code is all foreign to me. I have seen in other threads that there is a spreadsheet available to use but can't seem to get a response when asking for it to be emailed. I have been able to get the data to go to Excel but it puts it all into seperate sheets and not into the same page. Any and all help with this would be greatly appreciated as I am having to enter all the data in by hand.

    Thanks!
Children
No Data