Class ConnectionSite
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
详细文档
getIndex()
返回连接站点的索引。该索引在同一页面元素的所有连接位置中是唯一的。
在大多数情况下,它对应于 ECMA-376 标准中的预定义连接位置索引。如需详细了解这些连接网站,请参阅第 20.1.9.9 节和附录 H 中“cnx”属性的说明。
ECMA-376 第 5 版第 1 部分“Office Open XML 文件格式 - 基础知识和标记语言参考”中的“预定义的 DrawingML 形状和文本几何图形”。
返回
Integer
- 连接站点的索引。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getPageElement()
返回连接网站所在的 PageElement
。
返回
PageElement
- 连接网站的网页元素。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[[["\u003cp\u003eA connection site is a point on a PageElement where a connector can be attached.\u003c/p\u003e\n"],["\u003cp\u003eYou can get the index of a connection site, which is unique within its PageElement, using \u003ccode\u003egetIndex()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetPageElement()\u003c/code\u003e allows you to retrieve the PageElement associated with a specific connection site.\u003c/p\u003e\n"],["\u003cp\u003eConnection sites often correspond to the ECMA-376 standard, allowing compatibility with various applications.\u003c/p\u003e\n"]]],["A `ConnectionSite` on a `PageElement` can connect to a connector. It offers two methods: `getIndex()` and `getPageElement()`. `getIndex()` returns the site's unique index as an `Integer`, corresponding to the ECMA-376 standard. `getPageElement()` returns the `PageElement` the connection site belongs to. Both methods require specific authorization scopes like `presentations.currentonly` or `presentations`. The index is unique within the element's connection sites.\n"],null,["# Class ConnectionSite\n\nConnectionSite\n\nThe connection site on a `Page``Element` that can connect to a [connector](/apps-script/reference/slides/line#isConnector()). \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------|-----------------------------------------------------------|-------------------------------------------------------------|\n| [getIndex()](#getIndex()) | `Integer` | Returns the index of the connection site. |\n| [getPageElement()](#getPageElement()) | [PageElement](/apps-script/reference/slides/page-element) | Returns the `Page``Element` that the connection site is on. |\n\nDetailed documentation\n----------------------\n\n### `get``Index()`\n\nReturns the index of the connection site. The index is unique among all the connection sites on\nthe same page element.\n\nIn most cases, it corresponds to the predefined connection site index from the ECMA-376\nstandard. More information on those connection sites can be found in the description of the\n\"cnx\" attribute in section 20.1.9.9 and Annex H. \"Predefined DrawingML Shape and Text\nGeometries\" of \"Office Open XML File Formats-Fundamentals and Markup Language Reference\", part\n1 of [ECMA-376 5th edition](https://ecma-international.org/publications-and-standards/standards/ecma-376/).\n\n#### Return\n\n\n`Integer` --- The index of the connection site.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Page``Element()`\n\nReturns the `Page``Element` that the connection site is on.\n\n#### Return\n\n\n[PageElement](/apps-script/reference/slides/page-element) --- The page element of the connection site.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`"]]