Bu CATIA API fonksiyonu ne işe yarar?
Fonksiyon: CAASchRouteBetween2Equip.CATScript
Cevap:
COPYRIGHT DASSAULT SYSTEMES 2004
 *****************************************************************************
   Purpose:      Route a piping line function between two equipments.
   Languages:    VBScript
   Locales:      English
   CATIA Level:  V5R15
 *****************************************************************************
------------------------------------------------------------------------------
 These variables are visible to private Sub and CATMain
------------------------------------------------------------------------------
 -------------------------------------------------------------------------
 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.
--------------------------------------------------------------------
 Find 2 component instances in the model
--------------------------------------------------------------------
--------------------------------------------------------------------
 Route a line connecting its ends to each component
--------------------------------------------------------------------
--- If ( Not ( objSchRoot Is Nothing )...
 -----------------------------------------------------------------------------
 | 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 ( objSchRoute Is Nothing ) ...
--- If (Not ( objCntrLoc Is Nothing ...
 --- For iCntr = 1 To intNbCntr ...
--- If (intNbCntr > 0) ...
--- If ( Not ( objLCntr Is Nothing ) ...
 -----------------------------------------------------------------------------
 | Find 2 components and their images. The user need to designate specific
 | specific component instances by naming them specially.
 | From - component : should have "_Routefrom" embedded in the name
 | To - component : should have "_Routeto" embedded in the name
 |
 | Input: objSchRootArg:  the root of the document.
 | Returns: objLCompat_g: a list of component instance objects
 |          objLGRRComp_g: a list of component instance image objects
 -----------------------------------------------------------------------------
------------------------------------------------------------------------
  Loop through the members in the list and find 2 components that
  have "network" as part of the product instance names
------------------------------------------------------------------------
--- If ( Not ( objCompCompat Is Nothing ) ...
--- If (Not ( objLCompInst Is Nothing ) ...
 -----------------------------------------------------------------------------
 | Route a line from member 1 in objLCompat_g to member 2 in objLCompat_g.
 | These members are specific interface handle on 2 component instances.
 |
 | Input: objSchRootArg:  the root of the document.
 | Returns: objLCompat_g: a list of component instance objects
 |          objLGRRComp_g: a list of component instance image objects
 -----------------------------------------------------------------------------
---------------------------------------------------------------------
  IsTargetOKRoute returns a list of compatible connectors
  on the target component is the component is compatible to
  to connected to the start point of the route.
---------------------------------------------------------------------
------------------------------------------------------------------
  GetBestCntrForRoute returns a connector from
  the output list that is closest
  to a user selection point.
------------------------------------------------------------------
--- If (IntNbCoord > 1) Then
--- If ( Not ( objLCntrs Is Nothing ) And  _
--- If ( Not ( objGRRComp Is Nothing ) ...
--- For intIndex
---------------------------------------------------------------------------
 Ask application to create a route reference
---------------------------------------------------------------------------
Logical line concept not supported in sample application
So just send in a null string.
strLogLineID = ""
-----------------------------------------------------------------------
 Find the connector of the route matching the
 component connector position at each end
-----------------------------------------------------------------------
-----------------------------------------------------------------------
 Connect the route to the 2 components
-----------------------------------------------------------------------
--------------------------------------------------------------------
 Connect start point of route to "*_from" component
--------------------------------------------------------------------
--- If ( Not (objAppCntrRouteBest Is Nothing ) ...
--------------------------------------------------------------------
 Connect end point of route to "*_to" component
--------------------------------------------------------------------
--- If ( Not (objAppCntrRouteBest Is Nothing ) ...
--- If ( Not ( objSchRoute Is Nothing )...
--- If ( Not ( objAppCompRef Is Nothing ) ...