XREF API DOCUMENTATION
See Also: SignPost Contents SignPost Index Xrefs
Product AUTOCAD Author SZILVASY,ALBERT Date 27-AUG-99 Document ID 42357 Expiration date Attachments Keywords _XREF
Developer Consulting Group technical solution. Autodesk confidential, for ADN members only. Please read the disclaimer
Question
How can I create xrefs using ObjectARX?
Answer
The following function have been introduced with ObjectARX 2000:
acedXrefAttach() acedXrefOverlay() acedXrefUnload() acedXrefDetach() acedXrefReload() acedXrefBind() acedXrefXBind() acedXrefCreateBlockname()
The ObjectARX Reference Manual does not document these function that has been logged as documentation defect. Here’s more information on them:
Common rules: 1. All Xref APIs operate on the current document only. 2. The APIs provide document locking internally, if the document cannot be locked they return Acad::ErrorStatus eLockViolation. 3. No input validation or range checking is done other than checking for NULL pointers or strings. Input validation is the caller’s responsibility. 4. Xref log file processing is available if option is enabled. 5. Normal AutoCAD behavior with regards to output indicators, such as, progress meters, and msgs, may be turned off when scripts enabled && cmdecho == 0, or menu macros enabled && menuecho == 0, or menu encryption set.
—– Acad::ErrorStatus acedXrefAttach(const char* XrefPathname, const char* XrefBlockname, AcDbObjectId* pXrefBTRid = NULL, AcDbObjectId* pXrefRefid = NULL, const AcGePoint3d* pXrefInsertPt = NULL, const AcGeScale3d* pXrefScale = NULL, const double* pXrefRotateAngle = NULL, const Adesk::Boolean bQuiet = Adesk::kTrue);
Attaches an xref file to the current document.
Returns: Returns Acad::eOk if operation is successful.
Parameters: const char* XrefPathname [in] Xref file pathname const char* XrefBlockname [in] Xref block name symbol to use AcDbObjectId* pXrefBTRid [out,optional] AcDbObjectId ptr for the attached/overlaid Xref block object Id AcDbObjectId* pXrefRefid [out,optional] AcDbObjectId ptr for the attached/overlaid Xref block reference object Id const AcGePoint3d* pXrefInsertPt [in,optional] AcGePoint3d ptr for Insertion Pt const AcGeScale3d* pXrefScale [in,optional] AcGeVector3d ptr for Scale factor const double* pXrefRotateAngle [in, optional] double ptr for Rotate angle(radians) const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
Default behavior is as follows: Insertion Point(X,Y,Z) = 0.0, 0.0, 0.0 Scale Factor(X,Y,Z) = 1.0, 1.0, 1.0 Rotation Angle(radians) = 0.0
——- Acad::ErrorStatus acedXrefOverlay(const char* XrefPathname, const char* XrefBlockname, AcDbObjectId* pXrefBTRid = NULL, AcDbObjectId* pXrefRefid = NULL, const AcGePoint3d* pXrefInsertPt = NULL, const AcGeScale3d* pXrefScale = NULL, const double* pXrefRotateAngle = NULL, const Adesk::Boolean bQuiet = Adesk::kTrue);
Creates an xref overlay to the current document.
Returns: Returns Acad::eOk if operation is successful.
Parameters: const char* XrefPathname [in] Xref file pathname const char* XrefBlockname [in] Xref block name symbol to use AcDbObjectId* pXrefBTRid [out,optional] AcDbObjectId ptr for the attached/overlaid Xref block object Id AcDbObjectId* pXrefRefid [out,optional] AcDbObjectId ptr for the attached/overlaid Xref block reference object Id const AcGePoint3d* pXrefInsertPt [in,optional] AcGePoint3d ptr for Insertion Pt const AcGeScale3d* pXrefScale [in,optional] AcGeVector3d ptr for Scale factor const double* pXrefRotateAngle [in, optional] double ptr for Rotate angle(radians) const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
Default behavior is as follows: Insertion Point(X,Y,Z) = 0.0, 0.0, 0.0 Scale Factor(X,Y,Z) = 1.0, 1.0, 1.0 Rotation Angle(radians) = 0.0
—– Acad::ErrorStatus acedXrefUnload(const char* XrefBlockname, const Adesk::Boolean bQuiet = Adesk::kTrue);
Unloads the Xref block by its given block name. This assumes a valid Xref block exists in the current document.
Returns: Returns Acad::eOk if operation is successful.
Parameters: const char* XrefBlockname [in] Xref block name symbol for unload const Adesk::Boolean bQuiet [in,optional] Flag to suppress output msgs
—-
Acad::ErrorStatus acedXrefDetach(const char* XrefBlockname, const Adesk::Boolean bQuiet = Adesk::kTrue);
Detaches the Xref block by its given block name. This assumes a valid Xref block exists in the current document.
Returns: Returns Acad::eOk if operation is successful
Parameters: const char* XrefBlockname [in] Xref block name symbol for detach const Adesk::Boolean bQuiet [in,optional] Flag to suppress output msgs
——-
Acad::ErrorStatus acedXrefReload(const char* XrefBlockname, const Adesk::Boolean bQuiet = Adesk::kTrue);
Reloads the Xref block by its given block name. This assumes a valid Xref block exists in the current document.
Returns: Returns Acad::eOk if operation is successful.
Parameters: const char* XrefBlockname [in] Xref block name symbol for reload const Adesk::Boolean bQuiet [in,optional] Flag to suppress output msgs
——-
Acad::ErrorStatus acedXrefBind(const char* XrefBlockname, const Adesk::Boolean bInsertBind = Adesk::kFalse, const Adesk::Boolean bQuiet = Adesk::kTrue);
Changes the Bind type of the Xref block by its given block name. This assumes a valid Xref block exists in the current document.
Returns: Returns Acad::eOk if operation is successful.
Parameters: const char* XrefBlockname [in] Xref block name symbol for bind change const Adesk::Boolean bInsertBind [in, optional] Converts Xref symbols to insert-like bind names. const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
—– Acad::ErrorStatus acedXrefXBind(const AcDbObjectIdArray symbolIds, const bool bQuiet = true);
Binds symbols from xrefs to the current drawing.
Returns: Returns Acad::eOk if operation is successful.
Parameters: const AcDbObjectIdArray [in] object ids of symbol table records to be bound const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
—– Acad::ErrorStatus acedXrefCreateBlockname(const char* XrefPathname, char*& XrefBlockname);
Accepts a Xref file pathname and returns an internally allocated block name symbol string buffer which follows the AutoCAD policy rules for its creation. Typically, is composed of the filename of the Xref file. A return error will occur if the block name cannot be created. The block name string’s buffer must be released via the acutDelString().
Returns: Returns Acad::eOk if operation is successful.
Parameters: const char* XrefPathname [in] pointer to a Xref file pathname char*& XrefBlockname [out] Returns a pointer to a copy of the block name symbol string
—–
See Also: SignPost Contents SignPost Index Xrefs
Disclaimer
This information is derived from a response to a specific question sent to the Developer Consulting Group at Autodesk, and thus given its nature, is subject to change without notice. The information is provided to you on an “as is” basis, and you may use it only at your own risk. Autodesk is not responsible for its quality, nor shall it be liable for any damage or loss caused by your use of this information. – 本文出自晓东CAD家园-论坛,原文地址:http://www.xdcad.net/forum/thread-176-1-1.html


杭州格原