Hello Everyone,
I'm trying to fix a Part in an assembly using constraints but I'm getting (method "AddMonoEltCst") Error.
Below is my code,
Set oDOC = CATIA.Documents
Set oTemplateDoc = oDOC.Add("Product")
Set oTemplateDocProd = oTemplateDoc.Product
Set oTemplateDocProds = oTemplateDocProd.Products
Set oTopAssy = oTemplateDocProds.AddNewComponent("Product", "")
oTopAssy.Name = "Assy - Section.1"
Set oTopAssys = oTopAssy.Products
Set oTempltAssy = oTopAssys.AddNewComponent("Part", "")
Set opartDoc = oTempltAssy.ReferenceProduct.Parent
Set oTempltPrt = opartDoc.Part
Set constraints1 = oTopAssy.Connections("CATIAConstraints")
sItemName = oTempltAssy.Name
Set reference1 = oTopAssy.CreateReferenceFromName(sItemName & "/!" & "/")
Set constraint1 = constraints1.AddMonoEltCst(catCstTypeReference, reference1)
I'm trying to fix a Part in an assembly using constraints but I'm getting (method "AddMonoEltCst") Error.
Below is my code,
Set oDOC = CATIA.Documents
Set oTemplateDoc = oDOC.Add("Product")
Set oTemplateDocProd = oTemplateDoc.Product
Set oTemplateDocProds = oTemplateDocProd.Products
Set oTopAssy = oTemplateDocProds.AddNewComponent("Product", "")
oTopAssy.Name = "Assy - Section.1"
Set oTopAssys = oTopAssy.Products
Set oTempltAssy = oTopAssys.AddNewComponent("Part", "")
Set opartDoc = oTempltAssy.ReferenceProduct.Parent
Set oTempltPrt = opartDoc.Part
Set constraints1 = oTopAssy.Connections("CATIAConstraints")
sItemName = oTempltAssy.Name
Set reference1 = oTopAssy.CreateReferenceFromName(sItemName & "/!" & "/")
Set constraint1 = constraints1.AddMonoEltCst(catCstTypeReference, reference1)