Function SaveAs2(Name As String, CadAsReference As Boolean) As Boolean
Member of PCDLRN.PartProgram
Saves the part program with the provided name. CadAsReference allows to save the CAD as reference to the original one
Your Products have been synced, click here to refresh
Function SaveAs2(Name As String, CadAsReference As Boolean) As Boolean
Member of PCDLRN.PartProgram
Saves the part program with the provided name. CadAsReference allows to save the CAD as reference to the original one
Dim App As Object Dim Part As Object Dim Cmds As Object Dim Cmd As Object '======================================================================================================================='------------------------------------------------ 'This Sub Initializes PC-DMIS 'Change History: 'A (JS,8/24/14) : Code from A. Mavrov from PC-DMIS forum ' ' ' '------------------------------------------------ Sub Initialize() Set App = CreateObject("PCDLRN.Application") If App Is Nothing Then MsgBox "PC-DMIS initialization error!",48, "Error!" Exit Sub Else Set Part = App.ActivePartProgram If Part Is Nothing Then MsgBox "Part Program not opened!", 48, "Error!" Exit Sub Else Set Cmds = Part.Commands If Cmds Is Nothing Then MsgBox "Pointer to commands not valid!", 48, "Error!" Exit Sub End If End If End If End Sub '======================================================================================================================='------------------------------------------------ 'This Sub Saves the Active Part Program To the Name And Path Passed. CAD is Deleted. 'Change History: 'A (JS,9/01/14) : Creation ' ' ' '------------------------------------------------ Sub PCDSaveAs(Path As String) Dim Bln As Boolean Bln = Part.SaveAs2(Path,True) Kill Path & ".CAD" End Sub '======================================================================================================================='------------------------------------------------ 'This Sub Saves the Active Part Program To the Name And Path Passed in from PC-DMIS. CAD is deleted. 'Change History: 'A (JS,9/01/14) : Creation ' '------------------------------------------------ Sub Main(Path As String) Call Initialize() Call PCDSaveAs(Path) 'Cleanup Set Cmd = Nothing Set Cmds = Nothing Set Part = Nothing Set App = Nothing End Sub
Dim App As Object Dim Part As Object Dim Cmds As Object Dim Cmd As Object '======================================================================================================================='------------------------------------------------ 'This Sub Initializes PC-DMIS 'Change History: 'A (JS,8/24/14) : Code from A. Mavrov from PC-DMIS forum ' ' ' '------------------------------------------------ Sub Initialize() Set App = CreateObject("PCDLRN.Application") If App Is Nothing Then MsgBox "PC-DMIS initialization error!",48, "Error!" Exit Sub Else Set Part = App.ActivePartProgram If Part Is Nothing Then MsgBox "Part Program not opened!", 48, "Error!" Exit Sub Else Set Cmds = Part.Commands If Cmds Is Nothing Then MsgBox "Pointer to commands not valid!", 48, "Error!" Exit Sub End If End If End If End Sub '======================================================================================================================='------------------------------------------------ 'This Sub Saves the Active Part Program To the Name And Path Passed. CAD is Deleted. 'Change History: 'A (JS,9/01/14) : Creation ' ' ' '------------------------------------------------ Sub PCDSaveAs(Path As String) Dim Bln As Boolean Bln = Part.SaveAs2(Path,True) Kill Path & ".CAD" End Sub '======================================================================================================================='------------------------------------------------ 'This Sub Saves the Active Part Program To the Name And Path Passed in from PC-DMIS. CAD is deleted. 'Change History: 'A (JS,9/01/14) : Creation ' '------------------------------------------------ Sub Main(Path As String) Call Initialize() Call PCDSaveAs(Path) 'Cleanup Set Cmd = Nothing Set Cmds = Nothing Set Part = Nothing Set App = Nothing End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |