Good morning, everyone.
Below I recorded the generation of the "Sew surface"; does anyone know how to give the references of the faces not using the "part1.CreateReferenceFromBRepName("RSurFac..." ?
By the use of the "Topology.CGMFace,sel", I can already select the faces, and I want to use these to generate the "sew surface". So I would like to insert in reference 1, reference 2, reference n the faces preselected by the "Topology.CGMFace,sel"
Thank you very much to all the forum users
''''''''''''''''''''''''''''''''''''''''''''''
Language="VBSCRIPT"
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridShapeFactory1 As Factory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("PartBody")
Dim shapes1 As Shapes
Set shapes1 = body1.Shapes
Dim pad1 As Shape
Set pad1 = shapes1.Item("Prisma.1")
Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromBRepName("RSurFaceBrpPad.1;0BrpSketch.1;4)));None);Cf11));WithPermanentBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", pad1)
Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromBRepName("RSurFaceBrpPad.1;0BrpSketch.1;3)));None);Cf11));WithPermanentBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", pad1)
Dim hybridShapeAssemble1 As HybridShapeAssemble
Set hybridShapeAssemble1 = hybridShapeFactory1.AddNewJoin(reference1, reference2)
hybridShapeAssemble1.SetConnex 1
hybridShapeAssemble1.SetManifold 1
hybridShapeAssemble1.SetSimplify 0
hybridShapeAssemble1.SetSuppressMode 0
hybridShapeAssemble1.SetDeviation 0.001000
hybridShapeAssemble1.SetAngularToleranceMode 0
hybridShapeAssemble1.SetAngularTolerance 0.500000
hybridShapeAssemble1.SetFederationPropagation 0
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Gruppo geometrico.1")
hybridBody1.AppendHybridShape hybridShapeAssemble1
part1.InWorkObject = hybridShapeAssemble1
part1.Update
part1.Update
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Below I recorded the generation of the "Sew surface"; does anyone know how to give the references of the faces not using the "part1.CreateReferenceFromBRepName("RSurFac..." ?
By the use of the "Topology.CGMFace,sel", I can already select the faces, and I want to use these to generate the "sew surface". So I would like to insert in reference 1, reference 2, reference n the faces preselected by the "Topology.CGMFace,sel"
Thank you very much to all the forum users
''''''''''''''''''''''''''''''''''''''''''''''
Language="VBSCRIPT"
Sub CATMain()
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim hybridShapeFactory1 As Factory
Set hybridShapeFactory1 = part1.HybridShapeFactory
Dim bodies1 As Bodies
Set bodies1 = part1.Bodies
Dim body1 As Body
Set body1 = bodies1.Item("PartBody")
Dim shapes1 As Shapes
Set shapes1 = body1.Shapes
Dim pad1 As Shape
Set pad1 = shapes1.Item("Prisma.1")
Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromBRepName("RSurFaceBrpPad.1;0BrpSketch.1;4)));None);Cf11));WithPermanentBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", pad1)
Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromBRepName("RSurFaceBrpPad.1;0BrpSketch.1;3)));None);Cf11));WithPermanentBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", pad1)
Dim hybridShapeAssemble1 As HybridShapeAssemble
Set hybridShapeAssemble1 = hybridShapeFactory1.AddNewJoin(reference1, reference2)
hybridShapeAssemble1.SetConnex 1
hybridShapeAssemble1.SetManifold 1
hybridShapeAssemble1.SetSimplify 0
hybridShapeAssemble1.SetSuppressMode 0
hybridShapeAssemble1.SetDeviation 0.001000
hybridShapeAssemble1.SetAngularToleranceMode 0
hybridShapeAssemble1.SetAngularTolerance 0.500000
hybridShapeAssemble1.SetFederationPropagation 0
Dim hybridBodies1 As HybridBodies
Set hybridBodies1 = part1.HybridBodies
Dim hybridBody1 As HybridBody
Set hybridBody1 = hybridBodies1.Item("Gruppo geometrico.1")
hybridBody1.AppendHybridShape hybridShapeAssemble1
part1.InWorkObject = hybridShapeAssemble1
part1.Update
part1.Update
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''