Bu CATIA API fonksiyonu ne işe yarar?
Fonksiyon: CAASchInsertComponent.CATScript
Cevap:
COPYRIGHT DASSAULT SYSTEMES 2004
 *****************************************************************************
   Purpose:      Insert a schematic component into a route.
   Languages:    VBScript
   Locales:      English
   CATIA Level:  V5R15
 *****************************************************************************
 -------------------------------------------------------------------------
 Optional: allows to find the sample wherever it's installed
 -------------------------------------------------------------------------
 Open the catalog document
 Open main schematic design document (for new component instances created here)

 Find the top node of the schematic object tree - schematic root.
-----------------------------------------------------------------------
 Get the symbol of a component from the component catalog.
-----------------------------------------------------------------------
---------------------------------------------------------------------
 Get the owner of the symbol. That is, a reference component,
 in the catalog.
---------------------------------------------------------------------
If ( Not ( IsEmpty (objSchCompCVRef ) ) ...
----------------------------------------------------------------
  Insert a component into a route.

  Approach 1 - with compatibility information.
  1- QueryConnectAbility.
     Ask the reference of the component for information
     to use in compatibility checking. The objCompRefPlaceInfo
     is an output and should be used as a "black box".
     It is the input to the next call.

  2- IsTargetOKForInsert
     Check whether the route is compatible to the component
     in making connections.
     The route instance is the "target".
     objCompatInfo is an output and should be used as
     a "black box". It is an input to the next call.

  3- GetBestFitInsertInfo
     Input the placement location, close to middle of the route
     objFinalInsertInfo is an output and should be used as
     a "black box". It is an input to the next call.

  4- InsertIntoRouteWithInfo
     Place a new component instance with the black box info.
     The route will be broken up into 2 pieces (shorten the
     existing route and create a new route instance).
     The new component instance will be connected to the
     2 routes on each of the 2 sides (left and right).
----------------------------------------------------------------
 -- step 1
 -- step 2
-- a point at the middle of the route
 -- step 3
 -- step 4
----------------------------------------------------------------
  Insert a component into a route.

  Approach 2 - without compatibility information.
  One step approach.
  Is this specific example, we want to place another
  instance of the control valve on the middle of the first
  segment of the new route we have just created.

  1- we need the interface handle on the new route we
  have just created

  2- we need to figure out the placement point location.
  For this we need to extract the x-y coordinates of the route
  points.
----------------------------------------------------------------
---- If ( ( Not ( IsEmpty (objSchCntblRouteInst ) ) ...
----If ( Not ( IsEmpty (objSchCompCVRef ) )...
---- If ( Not ( IsEmpty (objSchCntblCVRef ) )...
----- If ( Not ( IsEmpty (objSchGRRCVCtlg ) )...
----If ( Not ( IsEmpty (objSchRoot ) )...
 -----------------------------------------------------------------------------
 | Find a route instance in the model.
 | Input: objSchCompGraph:  the schematic component
 |        (a CATIASchCompGraphic interface handle).
 | Returns: the component image (the symbol instance)
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 | Find a route instance in the model.
 | Input: objSchRouteArg:  the route
 |        (a CATIASchRoute interface handle).
 | Returns: the mid point of the first segment of the route.
 -----------------------------------------------------------------------------
--- If ( Not ( IsEmpty (objSchLGRR ) ) ...
--- If ( Not ( IsEmpty (objSchRouteGraphArg ) ) ...