Siva007
Automotive
- Jun 21, 2024
- 2
Im trying to attach two CatProduct with catscript, I'm getting an error
I don't have an idea what should be right string for "AttachmentCont" , this is the first time I'm using attachment factory method
Let me know if anyone help me on this
My Code is here
Sub Attach()
Dim ProductDoc
Set ProductDoc = DELMIA.ActiveDocument
Dim Product1
Set Product1 = ProductDoc.Product
Dim products1
Set products1 = Product1.Products
'insert first CATProduct(Block1)
' insert second CATProduct (Block2)
Dim Product2 'parent
Set Product2 = products1.Item("Block1")
Dim Product3 ' child
Set Product3 = products1.Item("Block2")
Dim objAttachCont
Set objAttachCont = ProductDoc.GetItem("AttachmentCont"). ' I'm getting error here "Method GetItem failed"
Dim objAttachmentFactory
Call objAttachCont.GetAttachmentFactory(objAttachmentFactory)
Dim AttachObject
Call objAttachmentFactory.Attach(Product2, product3, AttachObject)
End sub
I don't have an idea what should be right string for "AttachmentCont" , this is the first time I'm using attachment factory method
Let me know if anyone help me on this
My Code is here
Sub Attach()
Dim ProductDoc
Set ProductDoc = DELMIA.ActiveDocument
Dim Product1
Set Product1 = ProductDoc.Product
Dim products1
Set products1 = Product1.Products
'insert first CATProduct(Block1)
' insert second CATProduct (Block2)
Dim Product2 'parent
Set Product2 = products1.Item("Block1")
Dim Product3 ' child
Set Product3 = products1.Item("Block2")
Dim objAttachCont
Set objAttachCont = ProductDoc.GetItem("AttachmentCont"). ' I'm getting error here "Method GetItem failed"
Dim objAttachmentFactory
Call objAttachCont.GetAttachmentFactory(objAttachmentFactory)
Dim AttachObject
Call objAttachmentFactory.Attach(Product2, product3, AttachObject)
End sub