Hi I’m really confused because I can’t tackle my problem.
Actually, I never had a problem with the UDF instantiation in the partdocument context. So I discover that all what I know about the UDF instantiation don’t work in the context of productdocument.
So I will be very happy if anyone can help me to resolve this problem
How can I instantiate document template (which is composed of a CATIA product (of 2 parts)) by using an “instance factory”.
Dim mUdfFileName As String = "C:\DocumentTemplate\ProductTemp.CatProduct"
Dim UDFDocumentemplate As ProductDocument = CType(ICATIA_Appl.Documents.Read(mUdfFileName), ProductDocument)
Dim strUdfName As String = "ProductTemp"
Dim UDFReference As AnyObject = UDFDocumentemplate.Product.Products.Item(strUdfName)
'------- My problem: Instead of using mPart (which is a part of partdocument) I want to use a Methode like GetCustomerFactory in context of productdocument, because my document template is a product. ------------
Dim UDFFactory As InstanceFactory = CType(mPart.GetCustomerFactory("InstanceFactory" , InstanceFactory)
'------- It’s important to know that my product template doesn’t contain an Input. The PutInput methode is not required in my context--------
Dim UDFInstance As AnyObject = UDFFactory.AddInstance(UDFReference)
So please, is there anyone to help me to know if I’m in the right way, the above script doesn’t work ??
PS: I’m working with VB.Net
Thanks to help me |