data for us

Catalog definition 본문

Catia V5 4us

Catalog definition

한스 2007. 7. 20. 14:35
Catalog Definition


* Create a new catalog
  - suffix : CATfct
  - Must be located in the CNEXT\resources\graphic directory of
    your framework
  - Use the CreateCaltalog method definded in header file
    CATCatalogFactoryServices.h

      CATUnicodeString catalogName = "TestCat.CATfct";
      CATICatalog * piTestCatalog = NULL;
      HRESULT hr= ::CreateCatalog(&catalogName, &piTestCatalog);

      CATUnicodeString clientId = "..." ;
      hr = piTestCatalog->SetClient(&clientId);

* Or upgrade an existing catalog
  - Must be a user catalog
  - Use the UpgradeCatalog method defined in header file
    CATCatalogFactoryServices.h
  - The client ID is needed to open the catalog

      CATUnicodeString catalogName = "TestCat.CATfct";
      CATICatalog * piTestCatalog = NULL;
      CATUnicodeString clientId = "..." ;
      HRESULT hr = ::UpgradeCatalog(&catalogName, &piTestCatalog, &clientId);


* Create the StartUps
  - A StartUp is defined by
     . its name (instance name) : CATUnicodeString
     . its late type : CATUnicodeString
     . its super type : CATUnicodeString
  - The new StartUp will inherit all the attributes and behaviors defined
    at the level of the super type StartUp
    
        CATBaseUnknown * myStartUp = NULL;
        HRESULT hr = myCatalog->CreateSUInCaltalog(......);

  - There are three different cases
    . Creation of a StartUp from scratch
       .. Use CATICatalog::CreateSUInCatalog without super type
    . Creation of a StartUp that derives from a user StartUp
       .. If the original catalog is not already opened use AccessCatalog
          to open it in read only mode
       .. Then use CATCatalog::CreateSUInCatalog
    . Create of a StartUp that derives from a DS StartUp
       .. Mechanical feature: use the CATOsmSUFactory global function
       .. Machining feature: CreateMachiningFeatureSu or
          CreateMachiningOperationSU from the CATIMfgStartupFactories
       .. Analysis feature: CATSamCatalogFactory
     

* Add Attributes to your StartUps
  - Name : CATUnicodeString
  - Type : C++ enumeration value
    . A simple type: tk_string/tk_double/tk_booleam/tk_octet/tk_integer
    . A feature type: tk_specobject, tk_component
    . A list of any other types; tk_list
    . A more general object type : tk_external
  - Quality: defines the attribute role in the build process and update
                mechanism
    . sp_OUT: output data
    . sp_IN : input data for Build process
    . sp_NEUTRAL : attribute ignored by the update mechanism
  - Get pointer to CATISpecObject on the StartUp
  - Use the AddAttribute method from the CATISpecObject interface
    to define a new attribute
  - An attribute access mode is public by default, but can be set
    to private (use the SetAccess method)
  - Attribute should be accessed through the CATISpecAttrAccess
  - Store an attribute key to speed up access
  - Use GetXXX and SetXXX methods to access to the value


* Save the catalog
  - Use the SaveCatalog method