Your Products have been synced, click here to refresh
Dim DmisApp As Object Dim DmisPart As Object Dim DmisCommands As Object Dim DmisCommand As Object Dim FCmd As Object Dim savePath Dim repFolder Dim repName Dim tX, tY, tD, tRound, mX, mY, mD, mRound As String Sub Main(OutputFileNameAndPath) Set DmisApp = CreateObject("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set DmisCommands = DmisPart.Commands CommandCount = DmisCommands.Count Set DmisCommand = DmisCommands.Item(CommandCount) repName = format(now(),"YYYYMMDDHHNNSS") savePath = "D:\PC-DMIS Data\Scripts\TEMP\" repFolder = left(DmisPart.Name,len(DmisPart.Name)-4) OutputFileNameAndPath = savePath & repFolder & repName & ".TXT" Open OutputFileNameAndPath For Output As #1 For Each DmisCommand In DmisCommands If DmisCommand.IsFeature Then '' If DmisCommand.Type = 612 Or DmisCommand = 202 Or DmisCommand = 245 Then If Left(DmisCommand.ID, 3) = "CIR" Then Set FCmd = DmisCommand.FeatureCommand tX = DmisCommand.GetText(THEO_X, 0) tY = DmisCommand.GetText(THEO_Y, 0) tD = FCmd.TheoDiam 'tD = PCDCommand.GetText(THEO_DIAM, 0) mX = DmisCommand.GetText(MEAS_X, 0) mY = DmisCommand.GetText(MEAS_Y, 0) mD = FCmd.MeasDiam 'mD = PCDCommand.GetText(MEAS_DIAM, 0) mRound = FCmd.GetFormError() tRound = 0 tL= DmisCommand.GetText(THEO_LENGTH, 0) mL = DmisCommand.GetText(MEAS_LENGTH, 0) tW =DmisCommand.GetText(THEO_WIDTH, 0) mW = DmisCommand.GetText(MEAS_WIDTH, 0) Write #1, DmisCommand.ID & ", " & tX & ", " & tY & ", " & tD & ", " & tRound & ", " & mX & ", " & mY & ", " & mD & ", " & mRound & ", " & tL & ", " & mL & ", "& tW & ", " & mW If mRound>0.3 Then End If End If Next DmisCommand Close #1 End Sub
Dim DmisApp As Object Dim DmisPart As Object Dim DmisCommands As Object Dim DmisCommand As Object Dim FCmd As Object Dim savePath Dim repFolder Dim repName Dim tX, tY, tD, tRound, mX, mY, mD, mRound As String Sub Main(OutputFileNameAndPath) Set DmisApp = CreateObject("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set DmisCommands = DmisPart.Commands CommandCount = DmisCommands.Count Set DmisCommand = DmisCommands.Item(CommandCount) repName = format(now(),"YYYYMMDDHHNNSS") savePath = "D:\PC-DMIS Data\Scripts\TEMP\" repFolder = left(DmisPart.Name,len(DmisPart.Name)-4) OutputFileNameAndPath = savePath & repFolder & repName & ".TXT" Open OutputFileNameAndPath For Output As #1 For Each DmisCommand In DmisCommands If DmisCommand.IsFeature Then '' If DmisCommand.Type = 612 Or DmisCommand = 202 Or DmisCommand = 245 Then If Left(DmisCommand.ID, 3) = "CIR" Then Set FCmd = DmisCommand.FeatureCommand tX = DmisCommand.GetText(THEO_X, 0) tY = DmisCommand.GetText(THEO_Y, 0) tD = FCmd.TheoDiam 'tD = PCDCommand.GetText(THEO_DIAM, 0) mX = DmisCommand.GetText(MEAS_X, 0) mY = DmisCommand.GetText(MEAS_Y, 0) mD = FCmd.MeasDiam 'mD = PCDCommand.GetText(MEAS_DIAM, 0) mRound = FCmd.GetFormError() tRound = 0 tL= DmisCommand.GetText(THEO_LENGTH, 0) mL = DmisCommand.GetText(MEAS_LENGTH, 0) tW =DmisCommand.GetText(THEO_WIDTH, 0) mW = DmisCommand.GetText(MEAS_WIDTH, 0) Write #1, DmisCommand.ID & ", " & tX & ", " & tY & ", " & tD & ", " & tRound & ", " & mX & ", " & mY & ", " & mD & ", " & mRound & ", " & tL & ", " & mL & ", "& tW & ", " & mW If mRound>0.3 Then End If End If Next DmisCommand Close #1 End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |