JSVKAN
Mechanical
- Dec 20, 2013
- 20
Hi,
I tried to copy and paste the V4 model file into v5 through VBA coding. I just recorded this procedure and executed it. However, got an error message at the highlighted line in the below coding. Could someone please help me to resolve this issue or Is there any other way to copy and paste V4 model file into v5? Please find the coding below.
Sub CATMain()
Dim document1 As Document
Set document1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = document1.Selection
selection1.Clear
Dim v4MasterModel1 As V4MasterModel
[highlight #FCE94F]Set v4MasterModel1 = document1.GetItem("*MASTER")[/highlight]
selection1.Add v4MasterModel1
selection1.Copy
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Add("Part")
Dim product1 As Product
Set product1 = partDocument1.GetItem("Part2")
Dim bSTR1 As String
bSTR1 = product1.DescriptionRef
product1.DescriptionRef = ""
End Sub
I tried to copy and paste the V4 model file into v5 through VBA coding. I just recorded this procedure and executed it. However, got an error message at the highlighted line in the below coding. Could someone please help me to resolve this issue or Is there any other way to copy and paste V4 model file into v5? Please find the coding below.
Sub CATMain()
Dim document1 As Document
Set document1 = CATIA.ActiveDocument
Dim selection1 As Selection
Set selection1 = document1.Selection
selection1.Clear
Dim v4MasterModel1 As V4MasterModel
[highlight #FCE94F]Set v4MasterModel1 = document1.GetItem("*MASTER")[/highlight]
selection1.Add v4MasterModel1
selection1.Copy
Dim documents1 As Documents
Set documents1 = CATIA.Documents
Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Add("Part")
Dim product1 As Product
Set product1 = partDocument1.GetItem("Part2")
Dim bSTR1 As String
bSTR1 = product1.DescriptionRef
product1.DescriptionRef = ""
End Sub