找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 154|回复: 0

[每日一码] Xref API 文档

[复制链接]

0

主题

0

回帖

28

积分

管理员

积分
28
发表于 2024-3-14 20:18:18 | 显示全部楼层 |阅读模式
  1. 本帖最后由 LoveArx 于 2017-2-13 16:20 编辑
  2. 问题:
  3. 如何用OBJECTARX创建XREFS ?
  4. 回答:
  5. The following function have been introduced with ObjectARX 2000:
  6. acedXrefAttach()
  7. acedXrefOverlay()
  8. acedXrefUnload()
  9. acedXrefDetach()
  10. acedXrefReload()
  11. acedXrefBind()
  12. acedXrefXBind()
  13. acedXrefCreateBlockname()
  14. 下面是帮助手册没有写入的信息。
  15. The following information is not found in the ObjectARX Reference Manual because
  16. they were mistakenly excluded. Here's more information on them:
  17. Common Rules
  18. --  All Xref APIs operate on the current document only.
  19. --  The APIs provide document locking internally. If the document cannot be
  20. locked they return Acad::ErrorStatus eLockViolation.
  21. -- No input validation or range checking is done other than checking for NULL
  22. pointers or strings. Input validation is the caller's responsibility.
  23. --  Xref log file processing is available if option is enabled.
  24. --  Normal AutoCAD behavior with regards to output indicators, such as, progress
  25. meters, and msgs, may be turned off when scripts enabled && cmdecho == 0, or
  26. menu macros enabled && menuecho == 0, or menu encryption set.
  27. The attached sample application uses these functions to implement a set of very
  28. simple xref commands.  Each command uses one of the Xref API functions, and very
  29. little else, so it should be easy to see how they should be used.  Here is a
  30. list of which sample command implements which API function:
  31.    XRA uses acedXrefAttach()
  32.    XRO uses acedXrefOverlay()
  33.    XRU uses acedXrefUnload()
  34.    XRD uses acedXrefDetach()
  35.    XRR uses acedXrefReload()
  36.    XRB uses acedXrefBind()
  37.    XRI uses acedXrefBind() (with the insertBind method)
  38. -----
  39. Acad::ErrorStatus
  40. acedXrefAttach(const char* XrefPathname,
  41. const char* XrefBlockname,
  42. AcDbObjectId* pXrefBTRid = NULL,
  43. AcDbObjectId* pXrefRefid        = NULL,
  44. const AcGePoint3d* pXrefInsertPt = NULL,
  45. const AcGeScale3d*    pXrefScale = NULL,
  46. const double* pXrefRotateAngle = NULL,
  47. const Adesk::Boolean bQuiet = Adesk::kTrue);
  48. Attaches an xref file to the current document.
  49. Returns:
  50. Returns Acad::eOk if operation is successful.
  51. Parameters:
  52. const char* XrefPathname [in] Xref file pathname
  53. const char* XrefBlockname [in] Xref block name symbol to use
  54. AcDbObjectId* pXrefBTRid [out,optional] AcDbObjectId ptr for the
  55. attached/overlaid Xref block object Id
  56. AcDbObjectId* pXrefRefid [out,optional] AcDbObjectId ptr for the
  57. attached/overlaid Xref block reference object Id
  58. const AcGePoint3d* pXrefInsertPt [in,optional] AcGePoint3d ptr for Insertion Pt
  59. const AcGeScale3d* pXrefScale [in,optional] AcGeVector3d ptr for Scale factor
  60. const double* pXrefRotateAngle [in, optional] double ptr for Rotate
  61. angle(radians)
  62. const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
  63. Default behavior is as follows:
  64. Insertion Point(X,Y,Z) = 0.0, 0.0, 0.0
  65. Scale Factor(X,Y,Z) = 1.0, 1.0, 1.0
  66. Rotation Angle(radians) = 0.0
  67. -------
  68. Acad::ErrorStatus
  69. acedXrefOverlay(const char* XrefPathname,
  70. const char* XrefBlockname,
  71. AcDbObjectId* pXrefBTRid = NULL,
  72. AcDbObjectId* pXrefRefid = NULL,
  73. const AcGePoint3d* pXrefInsertPt = NULL,
  74. const AcGeScale3d* pXrefScale = NULL,
  75. const double* pXrefRotateAngle = NULL,
  76. const Adesk::Boolean bQuiet = Adesk::kTrue);
  77. Creates an xref overlay to the current document.
  78. Returns:
  79. Returns Acad::eOk if operation is successful.
  80. Parameters:
  81. const char* XrefPathname [in] Xref file pathname
  82. const char* XrefBlockname [in] Xref block name symbol to use
  83. AcDbObjectId* pXrefBTRid [out,optional] AcDbObjectId ptr for the
  84. attached/overlaid Xref block object Id
  85. AcDbObjectId* pXrefRefid [out,optional] AcDbObjectId ptr for the
  86. attached/overlaid Xref block reference object Id
  87. const AcGePoint3d* pXrefInsertPt [in,optional] AcGePoint3d ptr for Insertion Pt
  88. const AcGeScale3d* pXrefScale [in,optional] AcGeVector3d ptr for Scale factor
  89. const double* pXrefRotateAngle [in, optional] double ptr for Rotate
  90. angle(radians)
  91. const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
  92. Default behavior is as follows:
  93. Insertion Point(X,Y,Z) = 0.0, 0.0, 0.0
  94. Scale Factor(X,Y,Z) = 1.0, 1.0, 1.0
  95. Rotation Angle(radians) = 0.0
  96. -----
  97. Acad::ErrorStatus
  98. acedXrefUnload(const char* XrefBlockname,
  99. const Adesk::Boolean bQuiet = Adesk::kTrue);
  100. Unloads the Xref block by its given block name. This assumes a valid Xref block
  101. exists in the current document.
  102. Returns:
  103. Returns Acad::eOk if operation is successful.
  104. Parameters:
  105. const char* XrefBlockname [in] Xref block name symbol for unload
  106. const Adesk::Boolean bQuiet [in,optional] Flag to suppress output msgs
  107. ----
  108. Acad::ErrorStatus
  109. acedXrefDetach(const char* XrefBlockname,
  110. const Adesk::Boolean bQuiet = Adesk::kTrue);
  111. Detaches the Xref block by its given block name. This assumes a valid Xref block
  112. exists in the current document.
  113. Returns:
  114. Returns Acad::eOk if operation is successful
  115. Parameters:
  116. const char* XrefBlockname [in] Xref block name symbol for detach
  117. const Adesk::Boolean bQuiet [in,optional] Flag to suppress output msgs
  118. -------
  119. Acad::ErrorStatus
  120. acedXrefReload(const char* XrefBlockname,
  121. const Adesk::Boolean bQuiet = Adesk::kTrue);
  122. Reloads the Xref block by its given block name. This assumes a valid Xref block
  123. exists in the current document.
  124. Returns:
  125. Returns Acad::eOk if operation is successful.
  126. Parameters:
  127. const char* XrefBlockname [in] Xref block name symbol for reload
  128. const Adesk::Boolean bQuiet [in,optional] Flag to suppress output msgs
  129. -------
  130. Acad::ErrorStatus
  131. acedXrefBind(const char* XrefBlockname,
  132. const Adesk::Boolean bInsertBind = Adesk::kFalse,
  133. const Adesk::Boolean bQuiet = Adesk::kTrue);
  134. Changes the Bind type of the Xref block by its given block name. This assumes a
  135. valid Xref block exists in the current document.
  136. Returns:
  137. Returns Acad::eOk if operation is successful.
  138. Parameters:
  139. const char* XrefBlockname [in] Xref block name symbol for bind change
  140. const Adesk::Boolean bInsertBind [in, optional] Converts Xref symbols to
  141. insert-like bind names.
  142. const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
  143. -----
  144. Acad::ErrorStatus
  145. acedXrefXBind(const AcDbObjectIdArray symbolIds,
  146. const bool bQuiet = true);
  147. Binds symbols from xrefs to the current drawing.
  148. Returns:
  149. Returns Acad::eOk if operation is successful.
  150. Parameters:
  151. const AcDbObjectIdArray [in] object ids of symbol table records to be bound
  152. const Adesk::Boolean bQuiet [in, optional] Flag to suppress output msgs
  153. -----
  154. Acad::ErrorStatus
  155. acedXrefCreateBlockname(const char* XrefPathname,
  156. char*& XrefBlockname);
  157. Accepts a Xref file pathname and returns an internally allocated block name
  158. symbol string buffer which follows the AutoCAD policy rules for its creation.
  159. Typically, is composed of the filename of the Xref file. A return error will
  160. occur if the block name cannot be created. The block name string's buffer must
  161. be released via the acutDelString().
  162. Returns:
  163. Returns Acad::eOk if operation is successful.
  164. Parameters:
  165. const char* XrefPathname [in] pointer to a Xref file pathname
  166. char*& XrefBlockname [out] Returns a pointer to a copy of the block
  167. name symbol string
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|膜结构网

GMT+8, 2024-12-29 05:38 , Processed in 0.138427 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表