Jegsaran
Automotive
- Dec 16, 2020
- 42
Hello everyone,
I'm trying to coincidence 2 different sub-assy axially. I'm facing issue in converting the user selected input into reference as CreateReferenceFromName.
Please suggest me any methods,
Set oDoc = CATIA.ActiveDocument
Set oProd = oDoc.Product
Set constraints1 = oProd.Connections("CATIAConstraints")
Set Sel = oDoc.Selection
inputObjectType(0) = "Edge"
Filter1 = Sel.SelectElement2(inputObjectType, "Select the Line", True)
Filter2 = Sel.SelectElement2(inputObjectType, "Select the Axis", True)
'Reference 1 will be a line in a dummy part
'Reference 2 would be an Axis in a different product
'I want the user selected inputs in the following format
Set reference1 = oProd.CreateReferenceFromName("AssySection1/PartSection1.1/!Geometrical Set.1/X-Axis")
Set reference2 = oProd.CreateReferenceFromName("AssySection1/Sub-Product1.1/Sub-Product2.2/Sub-Product3.1/Part1.1/!Axis
Selection_RSur
Face
Brp
Pad.1;0
Brp
Sketch.1;1)));None
);Cf11
));Pad.1_ResultOUT;Z0;G4702))")
Set constraint1 = constraints1.AddBiEltCst(catCstTypeOn, reference1, reference2)
I'm trying to coincidence 2 different sub-assy axially. I'm facing issue in converting the user selected input into reference as CreateReferenceFromName.
Please suggest me any methods,
Set oDoc = CATIA.ActiveDocument
Set oProd = oDoc.Product
Set constraints1 = oProd.Connections("CATIAConstraints")
Set Sel = oDoc.Selection
inputObjectType(0) = "Edge"
Filter1 = Sel.SelectElement2(inputObjectType, "Select the Line", True)
Filter2 = Sel.SelectElement2(inputObjectType, "Select the Axis", True)
'Reference 1 will be a line in a dummy part
'Reference 2 would be an Axis in a different product
'I want the user selected inputs in the following format
Set reference1 = oProd.CreateReferenceFromName("AssySection1/PartSection1.1/!Geometrical Set.1/X-Axis")
Set reference2 = oProd.CreateReferenceFromName("AssySection1/Sub-Product1.1/Sub-Product2.2/Sub-Product3.1/Part1.1/!Axis
Set constraint1 = constraints1.AddBiEltCst(catCstTypeOn, reference1, reference2)