Thank you guys for fast response
I have tried to write below code but its showing me error.
Sub CATMain()
Dim PartStart As Part
Set PartStart = PartDocumentStart.Part
Dim reference As Object
Set reference = PartStart.FindObjectByName("UserFeature2")
'------------------------------------------------------------------
Catia.SystemService.Print "Instantiate the reference in the current part"
Dim factory As InstanceFactory
Set factory = PartDest.GetCustomerFactory("InstanceFactory")
Dim instance As ShapeInstance
Set instance = factory.AddInstance(reference)
'------------------------------------------------------------------
Catia.SystemService.Print "Set Inputs"
Dim Center As Object
Set Center = PartDest.FindObjectByName("FIRST LINE")
Dim Surface As Object
Set Surface = PartDest.FindObjectByName("Surface.1")
Dim Center As Object
Set Center = PartDest.FindObjectByName("Surface.1\edge.5")
instance.PutInput "FIRST LINE", Center
instance.PutInput "Surface.1", Surface
instance.PutInput "Surface.1\edge.5", Surface
'------------------------------------------------------------------
Catia.SystemService.Print "Modify Parameters"
Dim param1 As Parameter
Set param1 = instance.GetParameter("PITCH")
param1.ValuateFromString("1.5mm")
Dim param2 As Parameter
Set param2 = instance.GetParameter("OFFSET")
param2.ValuateFromString("0.5mm")
Dim param3 As Parameter
Set param3 = instance.GetParameter("FRONT_PARABOLA")
param2.ValuateFromString("0.5mm")
'------------------------------------------------------------------
Catia.SystemService.Print "Update"
PartDest.Update
'------------------------------------------------------------------
Catia.SystemService.Print "Retrieves Inputs and Outputs"
Dim inputCentre As Object
Set inputCentre = instance.GetInput("LINE")
Dim inputSurface As Object
Set inputSurface = instance.GetInput("Surface")
Catia.SystemService.Print "Retrieve outputs"
Dim outputDirection As Object
Set outputDirection = instance.GetOutput("Direction")
'------------------------------------------------------------------
Catia.SystemService.Print "Close the CATPart containing the reference"
PartDocumentStart.Close
End Sub
I am pretty new to this VB scripting ,can any one suggest