首页 / dm / oaLibDef

oaLibDef

模块: oapy._oa._dm 导入: from oapy._oa import _dm

概览

oaLibDefoapy 中可用,可通过 _dm 模块访问。

本页汇总 oaLibDef 当前在 oapy 中可用的 Python 接口。

详细说明

oaLibDef is a derived class of oaLibDefListMem 。 It represents a library definition included in the owning library definition list ( oaLibDefList )。

方法总览

状态 Python 调用
obj.getLibName(libName)
obj.getLibPath(path)
obj.getLibWritePath(writePath)
obj.setLibWritePath(writePath)
obj.getLibMode()
obj.setLibMode(libMode)
obj.getLibAttributes(attrs)
obj.addLibAttribute(attrName, attrVal)
obj.removeLibAttribute(attrName)
_dm.oaLibDef.create(defList, libName, libPath, writePath="", libMode=oacSharedLibMode, libAttrs=NULL, followingMem=NULL)
_dm.oaLibDef.find(defList, libName)

方法说明

obj.getLibName(libName)

绑定状态: 已绑定

Python 调用: obj.getLibName(libName)

This function fills in the library name of the library that this libDef object defines。

参数

  • libName: output parameter - the logical name of the library。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.getLibName(libName)

obj.getLibPath(path)

绑定状态: 已绑定

Python 调用: obj.getLibPath(path)

This function fills in the library path of the library that this libDef object defines。

参数

  • path: output parameter - the physical path to the library。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.getLibPath(path)

obj.getLibWritePath(writePath)

绑定状态: 已绑定

Python 调用: obj.getLibWritePath(writePath)

This function gets the write path of the library associated with this libDef object。

参数

  • writePath: output parameter - the write path of the library associated with this libDef。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.getLibWritePath(writePath)

obj.setLibWritePath(writePath)

绑定状态: 已绑定

Python 调用: obj.setLibWritePath(writePath)

This function specifies the writePath for the library defined in this oaLibDef object。 The writePath specifies the path to a directory that the oaLib can use to create temporary files。 oaLib::getWritePath。

参数

  • writePath: The path to the directory in which to create temporary files。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.setLibWritePath(writePath)

obj.getLibMode()

绑定状态: 已绑定

Python 调用: obj.getLibMode()

This function returns the access mode of the library that this libDef object defines (see oaLibMode for further information)。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.getLibMode()

obj.setLibMode(libMode)

绑定状态: 已绑定

Python 调用: obj.setLibMode(libMode)

This function sets the mode for this oaLibDef object。

参数

  • mode: The mode indicates whether the library specified by this oaLibDef object will have shared, non-shared (only the current process can access and write to the library), or read-only mode when the library is opened during the oaLibDefList::openLibs process。 see oaLibMode for further information。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.setLibMode(libMode)

obj.getLibAttributes(attrs)

绑定状态: 已绑定

Python 调用: obj.getLibAttributes(attrs)

This function fills in the library attributes array of this libDef object。 If there are no attributes in this definition, an empty array is returned。

参数

  • attrs: output parameter - the attributes array of the library that this libDef object defines。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.getLibAttributes(attrs)

obj.addLibAttribute(attrName, attrVal)

绑定状态: 已绑定

Python 调用: obj.addLibAttribute(attrName, attrVal)

This function adds a new library attribute to this oaLibDef object。 The attribute is a name/value pair。 If an attribute with the provided name already exists, it is overwritten。

参数

  • attrName: The name for the attribute。
  • attrVal: The value for the attribute。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.addLibAttribute(attrName, attrVal)

obj.removeLibAttribute(attrName)

绑定状态: 已绑定

Python 调用: obj.removeLibAttribute(attrName)

This function removes the specified attribute from this oaLibDef object。 If the named attribute does not exist, the operation is ignored。

参数

  • attrName: The name of the attribute to be removed。

Python 示例

from oapy._oa import _dm

# assume obj is a oaLibDef
obj.removeLibAttribute(attrName)

_dm.oaLibDef.create(defList, libName, libPath, writePath="", libMode=oacSharedLibMode, libAttrs=NULL, followingMem=NULL)

绑定状态: 已绑定

Python 调用: _dm.oaLibDef.create(defList, libName, libPath, writePath="", libMode=oacSharedLibMode, libAttrs=NULL, followingMem=NULL)

This function creates an oaLibDef object and places it in the specified defList with the specified parameters。 The libDef will be positioned in the owning defList before the followingMem if it is specified; otherwise it will positioned at the end of defList。 Note that the writePath and libMode parameters as well as any attributes contained in the optional libAttrs oaDMAttrArray will be written out to the top file associated with the owning defList when a save operation is performed on the oaLibDefList 。 Each attribute will be written in the file in a separate ASSIGN statement (see oaLibDefList for more information on the format of the ASSIGN statement used in library definition files)。

参数

  • defList: - required input parameter。 The owning oaLibDefList object in which this object will be placed。
  • libName: - required input parameter。 The logical name of the library。
  • libPath: - required input parameter。 The physical path to the library。 A Relative path is supported, which should be specified relative to the path of the file associated with the owning defList。
  • writePath: - optional input parameter。 The write path of the library。 A relative path is supported, which should relative to the path of the associated with the owning defList。 When a subsequent save is performed on the owning defList, this attribute value will be saved with the "writePath" attribute name in a library definition file ASSIGN statement。
  • libMode: - optional input parameter。 The mode of the library。 The default value is oacSharedLibMode。 When a subsequent save is performed on the owning defList, this attribute value will be saved with the "libMode" attribute name in a library definition file ASSIGN statement。
  • libAttrs: - optional input parameter array。 An oaDMAttrArray of library attributes。 When a subsequent save is performed on the owning defList, each attribute name and value will be saved in the library definition file in a separate ASSIGN statement。
  • followingMem: - optional input parameter。 The member in the ordered defList that this libDef will be positioned before。 If NULL is specified, this libDef will be positioned at the end of the owning defList。

异常

  • oacLibDefExists
  • oacInvalidLibDefListMemCreate

Python 示例

from oapy._oa import _dm

_dm.oaLibDef.create(defList, libName, libPath, writePath="", libMode=oacSharedLibMode, libAttrs=NULL, followingMem=NULL)

_dm.oaLibDef.find(defList, libName)

绑定状态: 已绑定

Python 调用: _dm.oaLibDef.find(defList, libName)

This function finds the libDef object in the specified defList list with the given libName。 Users can create only one library definition in a libDefList with a library name (see oaLibDef::create )。 Note also, if oaLibDefList::openLibs() finds library definitions library definition file hierarchy with the same logical library name, it will open the last of the multiply-defined libraries。

参数

  • defList: The oaLibDefList object which this object is in。
  • libName: The logical name of the library。

Python 示例

from oapy._oa import _dm

_dm.oaLibDef.find(defList, libName)