puck
Aerospace
- Nov 9, 2001
- 61
I'm writing a script that lets me select a product or part to copy and paste and then translate them.
The problem I'm running into is getting the items that I just pasted as my selction to translate.
Here is an example of the code and the part that I'm having trouble is where I Set product2 = ?????
<code>
Dim Sel1(0)
Sel1(0) = "Product"
Dim Done As Integer
Dim vbYes As Constants
Dim vbNo As Constants
vbYes = 6
vbNo = 7
Done = vbYes
Do While Done = vbYes
ProdDoc.Activate
Dim SelObject As Object
Set Selection1 = ProdDoc.Selection
Selection1.Clear
vRet = Selection1.SelectElement(Sel1, "Select the Part or Product to Copy.", True)
Set SelObject = Selection1.Item(1)
Set CurProd = SelObject.Value
MsgBox CurProd.Nomenclature
ProdDoc.Selection.Add(CurProd)
Selection1.Copy
ProdDoc.Activate
Selection1.Clear
Selection1.Add Prod
Selection1.Paste
Prod.Update
Selection1.Clear
Dim product2 As Product
Set product2 = ?????
Dim move1 As Move
Set move1 = product2.Move
</code>
Any ideas?
TIA,
Puck
The problem I'm running into is getting the items that I just pasted as my selction to translate.
Here is an example of the code and the part that I'm having trouble is where I Set product2 = ?????
<code>
Dim Sel1(0)
Sel1(0) = "Product"
Dim Done As Integer
Dim vbYes As Constants
Dim vbNo As Constants
vbYes = 6
vbNo = 7
Done = vbYes
Do While Done = vbYes
ProdDoc.Activate
Dim SelObject As Object
Set Selection1 = ProdDoc.Selection
Selection1.Clear
vRet = Selection1.SelectElement(Sel1, "Select the Part or Product to Copy.", True)
Set SelObject = Selection1.Item(1)
Set CurProd = SelObject.Value
MsgBox CurProd.Nomenclature
ProdDoc.Selection.Add(CurProd)
Selection1.Copy
ProdDoc.Activate
Selection1.Clear
Selection1.Add Prod
Selection1.Paste
Prod.Update
Selection1.Clear
Dim product2 As Product
Set product2 = ?????
Dim move1 As Move
Set move1 = product2.Move
</code>
Any ideas?
TIA,
Puck