Bu CATIA API fonksiyonu ne işe yarar?
Fonksiyon: CAASchAppObjFactory.CATScript
Cevap:
COPYRIGHT DASSAULT SYSTEMES 2004
 *****************************************************************************
   Purpose:      Create an application reference and add connectors. Also
                 create an application route connecting to an instance of
                 the component.
   Languages:    VBScript
   Locales:      English
   CATIA Level:  V5R15
 *****************************************************************************
 -------------------------------------------------------------------------
 Optional: allows to find the sample wherever it's installed
 -------------------------------------------------------------------------
 Open the schematic document
 Find the top node of the schematic object tree - schematic root.
-----------------------------------------------------------------------
 Get all the necessary factories.
-----------------------------------------------------------------------
---------------------------------------------------------------------
 Ask application to create a component reference
---------------------------------------------------------------------
---------------------------------------------------------------------
 Find a unassociated component symbol in the document
---------------------------------------------------------------------
---------------------------------------------------------------------
 Add two connectors to the reference component
---------------------------------------------------------------------
-------------------------------------------------------------
 connector position and alignment vector are in coordinates
 relative the origin of the reference component graphical
 representation (the detail axis).
-------------------------------------------------------------
--- If ( Not ( objSchCntr Is Nothing ) ...
-------------------------------------------------------------------
 Place an instance of reference just created in an empty space in
 the design document
 Note that the target document is an input to PlaceInSpace
-------------------------------------------------------------------
-------------------------------------------------------------------
 Component instance (to be created below) orientation matrix.
 x-axis = (1.0,0.0)
 y-axis = (0.0,1.0)
 origin = (100.0,100.0)
-------------------------------------------------------------------
--- If ( Not ( objAppCompRef Is Nothing ) ...
---------------------------------------------------------------------
 Find the coordinates of the route point by asking an existing
 component instance for a nearest compatible connector (connector A
 on the component instance).

 The position of connector A will be used to define
 the first route point. A extremity connector will be
 automatically created for the route
 at this start point (connector B).

 Connect the route to the component using
 connector A and connector B.
---------------------------------------------------------------------
-------------------------------------------------------------------
 Get the image (ditto) of the component instance
-------------------------------------------------------------------
---------------------------------------------------------------
  IsTargetOKRoute returns a list of compatible connectors
  on the target component if the component is compatible to
  be connected to the start point of the route.
---------------------------------------------------------------
------------------------------------------------------------
  GetBestCntrForRoute returns a connector from
  the output list that is closest
  to a user selection point.
------------------------------------------------------------
-------------------------------------------------------------
 Ask application to create a route reference
-------------------------------------------------------------
strLogLineID = "U1-P101-2in-CS150R-FG"
-----------------------------------------------------
 Connect "Connector A" to "Connector B"
-----------------------------------------------------
--- If ( Not (objAppCntrRouteBest Is Nothing ) ...
--- If ( Not ( objSchRoute Is Nothing )...
--- If ( Not ( objAppCompRef Is Nothing ) ...
--- If ( Not ( objLCntrs Is Nothing )...
--- If ( Not ( objSchCompCompat Is Nothing ) ...
--- If ( Not  ( objSchCompInst Is Nothing ) ...
--- If ( Not ( objAppObjFact Is Nothing )...
--- If ( Not ( objSchRoot Is Nothing )...
 -----------------------------------------------------------------------------
 | Find a component symbol that has not been associated with a schematic
 | component from a document root.
 | Input: objSchRootArg:  the root of the document.
 | Returns: component symbol object.
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 | Find the first symbol used for the input schematic component.
 | Input: objSchCompGraph:  the schematic component
 |        (a CATIASchCompGraphic interface handle).
 | Returns: the component image (the symbol instance)
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 | Find the first graphical primitives of an input route.
 | Input: objSchRouteGraph:  the schematic route
 |        (a CATIASchRouteGraphic interface handle).
 | Returns: the route graphic primitives
 -----------------------------------------------------------------------------
 -----------------------------------------------------------------------------
 | Find a connector that matches the input x-y coordinates.
 | Input: dbXArg,dbYArg:  the x-y coordinates of the matching point
 |        objSchGRR: the graphic primitives of the route.
 |        objSchCntbl: the connectable to search for the connectors
 | Returns: the connector handle
 -----------------------------------------------------------------------------
--- If ( Not ( objSchCntblArg Is Nothing ) ...
--- If (Not ( objCntrLoc Is Nothing ...
 --- For iCntr = 1 To intNbCntr ...
--- If (intNbCntr > 0) ...
--- If ( Not ( objLCntr Is Nothing ) ...