Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach a product with another product in Delmia V5 / catscript

Status
Not open for further replies.

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
 
Replies continue below

Recommended for you

Try

Code:
DELMIA.GetItem("AttachmentCont")

or

Code:
Poduct2.GetTechnologicalObject("AttachmentCont")
 
Thank you very much, first code works good
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor