{"id":1149512,"date":"2025-01-13T16:50:24","date_gmt":"2025-01-13T08:50:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1149512.html"},"modified":"2025-01-13T16:50:26","modified_gmt":"2025-01-13T08:50:26","slug":"revit%e4%b8%ad%e5%a6%82%e4%bd%95%e7%94%a8python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1149512.html","title":{"rendered":"revit\u4e2d\u5982\u4f55\u7528Python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25180157\/4e583277-3883-4990-8f58-ab2cdde3dce2.webp\" alt=\"revit\u4e2d\u5982\u4f55\u7528Python\" \/><\/p>\n<p><p> <strong>\u5728Revit\u4e2d\u4f7f\u7528Python\uff0c\u53ef\u4ee5\u901a\u8fc7Dynamo\u3001RevitPythonShell\u548cpyRevit\u5b9e\u73b0\u3002<\/strong> \u5176\u4e2d\uff0c<strong>Dynamo<\/strong>\u662f\u6700\u5e38\u7528\u7684\u56fe\u5f62\u7f16\u7a0b\u5de5\u5177\uff0c<strong>RevitPythonShell<\/strong>\u53ef\u4ee5\u76f4\u63a5\u5728Revit\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u800c<strong>pyRevit<\/strong>\u5219\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u63d2\u4ef6\uff0c\u53ef\u4ee5\u6269\u5c55Revit\u7684\u529f\u80fd\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e09\u79cd\u65b9\u6cd5\uff0c\u5e76\u91cd\u70b9\u4ecb\u7ecd\u5982\u4f55\u5728Dynamo\u4e2d\u4f7f\u7528Python\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001DYNAMO\u4e2d\u4f7f\u7528PYTHON<\/p>\n<\/p>\n<p><p>1\u3001\u5b89\u88c5Dynamo<\/p>\n<p>\u8981\u5728Revit\u4e2d\u4f7f\u7528Dynamo\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Dynamo\u3002Dynamo\u901a\u5e38\u4e0eRevit\u4e00\u8d77\u5b89\u88c5\uff0c\u4f46\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u901a\u8fc7Autodesk\u5b98\u7f51\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u521b\u5efaPython\u811a\u672c\u8282\u70b9<\/p>\n<p>\u5728Dynamo\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201cAdd Node\u201d\u6309\u94ae\u6dfb\u52a0\u4e00\u4e2aPython\u811a\u672c\u8282\u70b9\u3002\u641c\u7d22\u201cPython Script\u201d\u5e76\u5c06\u5176\u62d6\u5230\u5de5\u4f5c\u533a\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u7f16\u5199Python\u811a\u672c<\/p>\n<p>\u53cc\u51fbPython\u811a\u672c\u8282\u70b9\uff0c\u4f1a\u6253\u5f00\u4e00\u4e2aPython\u7f16\u8f91\u5668\u3002\u5728\u8fd9\u91cc\u53ef\u4ee5\u7f16\u5199Python\u4ee3\u7801\u3002Dynamo\u4f7f\u7528\u7684\u662fIronPython\uff0c\u56e0\u6b64\u9700\u8981\u6ce8\u610f\u4e00\u4e9b\u7279\u6027\uff0c\u4f8b\u5982\u4e0d\u652f\u6301\u67d0\u4e9b\u6807\u51c6Python\u5e93\u3002<\/p>\n<\/p>\n<p><p>4\u3001\u8fde\u63a5\u8f93\u5165\u548c\u8f93\u51fa<\/p>\n<p>\u5728Python\u811a\u672c\u8282\u70b9\u4e2d\uff0c\u53ef\u4ee5\u5b9a\u4e49\u8f93\u5165\u548c\u8f93\u51fa\u3002\u901a\u8fc7Dynamo\u7684\u56fe\u5f62\u754c\u9762\uff0c\u53ef\u4ee5\u5c06\u5176\u4ed6\u8282\u70b9\u7684\u8f93\u51fa\u8fde\u63a5\u5230Python\u811a\u672c\u8282\u70b9\u7684\u8f93\u5165\uff0c\u5e76\u5c06Python\u811a\u672c\u8282\u70b9\u7684\u8f93\u51fa\u8fde\u63a5\u5230\u5176\u4ed6\u8282\u70b9\u3002<\/p>\n<\/p>\n<p><p>5\u3001\u8fd0\u884c\u811a\u672c<\/p>\n<p>\u7f16\u5199\u5b8c\u811a\u672c\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7Dynamo\u7684\u201cRun\u201d\u6309\u94ae\u8fd0\u884c\u811a\u672c\u3002Dynamo\u4f1a\u81ea\u52a8\u6267\u884cPython\u4ee3\u7801\uff0c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><p><strong>\u5177\u4f53\u4f8b\u5b50\uff1a<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u60f3\u8981\u5728Revit\u4e2d\u521b\u5efa\u4e00\u7cfb\u5217\u7684\u77e9\u5f62\u67f1\u5b50\uff0c\u5e76\u5e0c\u671b\u901a\u8fc7Python\u811a\u672c\u6765\u63a7\u5236\u5b83\u4eec\u7684\u4f4d\u7f6e\u548c\u5c3a\u5bf8\u3002\u6211\u4eec\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5728Dynamo\u4e2d\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c\u8282\u70b9\u3002<\/li>\n<li>\u7f16\u5199Python\u4ee3\u7801\uff0c\u5b9a\u4e49\u67f1\u5b50\u7684\u53c2\u6570\uff0c\u4f8b\u5982\u4f4d\u7f6e\u3001\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u3002<\/li>\n<li>\u8fde\u63a5\u8f93\u5165\u8282\u70b9\uff0c\u4e3aPython\u811a\u672c\u63d0\u4f9b\u53c2\u6570\u3002<\/li>\n<li>\u8fd0\u884c\u811a\u672c\uff0c\u751f\u6210\u67f1\u5b50\u3002<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<h2><strong>\u5b9a\u4e49\u67f1\u5b50\u7684\u4f4d\u7f6e\u548c\u5c3a\u5bf8<\/strong><\/h2>\n<p>base_point = XYZ(0, 0, 0)<\/p>\n<p>width = 1.0<\/p>\n<p>depth = 1.0<\/p>\n<p>height = 10.0<\/p>\n<h2><strong>\u521b\u5efa\u67f1\u5b50<\/strong><\/h2>\n<p>column_type = FilteredElementCollector(doc).OfClass(FamilySymbol).OfCategory(BuiltInCategory.OST_StructuralColumns).FirstElement()<\/p>\n<p>column = doc.Create.NewFamilyInstance(base_point, column_type, StructuralType.Column)<\/p>\n<h2><strong>\u8bbe\u7f6e\u67f1\u5b50\u7684\u5c3a\u5bf8<\/strong><\/h2>\n<p>column.LookupParameter(&#39;Width&#39;).Set(width)<\/p>\n<p>column.LookupParameter(&#39;Depth&#39;).Set(depth)<\/p>\n<p>column.LookupParameter(&#39;Height&#39;).Set(height)<\/p>\n<h2><strong>\u8f93\u51fa\u67f1\u5b50<\/strong><\/h2>\n<p>OUT = column<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Dynamo\u4e2d\u4f7f\u7528Python\u811a\u672c\u6765\u63a7\u5236Revit\u6a21\u578b\u4e2d\u7684\u5143\u7d20\uff0c\u5b9e\u73b0\u590d\u6742\u7684\u5efa\u6a21\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001REVITPYTHONSHELL\u4f7f\u7528PYTHON<\/p>\n<\/p>\n<p><p>1\u3001\u5b89\u88c5RevitPythonShell<\/p>\n<p>RevitPythonShell\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u63d2\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f1a\u5728Revit\u7684\u201cAdd-Ins\u201d\u9009\u9879\u5361\u4e2d\u663e\u793a\u4e00\u4e2a\u65b0\u7684\u9009\u9879\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u7f16\u5199\u548c\u8fd0\u884cPython\u811a\u672c<\/p>\n<p>\u5728RevitPythonShell\u4e2d\uff0c\u53ef\u4ee5\u76f4\u63a5\u7f16\u5199\u548c\u8fd0\u884cPython\u811a\u672c\u3002\u4e0eDynamo\u4e0d\u540c\uff0cRevitPythonShell\u4e0d\u9700\u8981\u901a\u8fc7\u56fe\u5f62\u754c\u9762\u8fde\u63a5\u8282\u70b9\uff0c\u800c\u662f\u76f4\u63a5\u5728Revit\u73af\u5883\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p><strong>\u5177\u4f53\u4f8b\u5b50\uff1a<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u60f3\u8981\u5728Revit\u4e2d\u6279\u91cf\u4fee\u6539\u5899\u4f53\u7684\u7c7b\u578b\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00RevitPythonShell\u3002<\/li>\n<li>\u7f16\u5199Python\u4ee3\u7801\uff0c\u83b7\u53d6\u6240\u6709\u5899\u4f53\uff0c\u5e76\u4fee\u6539\u5b83\u4eec\u7684\u7c7b\u578b\u3002<\/li>\n<li>\u8fd0\u884c\u811a\u672c\uff0c\u5e94\u7528\u4fee\u6539\u3002<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<h2><strong>\u83b7\u53d6\u6240\u6709\u5899\u4f53<\/strong><\/h2>\n<p>walls = FilteredElementCollector(doc).OfClass(Wall).ToElements()<\/p>\n<h2><strong>\u5b9a\u4e49\u65b0\u7684\u5899\u4f53\u7c7b\u578b<\/strong><\/h2>\n<p>new_wall_type = FilteredElementCollector(doc).OfClass(WallType).FirstElement()<\/p>\n<h2><strong>\u4fee\u6539\u5899\u4f53\u7c7b\u578b<\/strong><\/h2>\n<p>for wall in walls:<\/p>\n<p>    wall.WallType = new_wall_type<\/p>\n<h2><strong>\u8f93\u51fa\u4fee\u6539\u540e\u7684\u5899\u4f53\u6570\u91cf<\/strong><\/h2>\n<p>OUT = len(walls)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5728RevitPythonShell\u4e2d\u6279\u91cf\u4fee\u6539\u5899\u4f53\u7684\u7c7b\u578b\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001PYREVIT\u4f7f\u7528PYTHON<\/p>\n<\/p>\n<p><p>1\u3001\u5b89\u88c5pyRevit<\/p>\n<p>pyRevit\u662f\u4e00\u4e2a\u5f00\u6e90\u7684Revit\u63d2\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7GitHub\u4e0a\u7684pyRevit\u9879\u76ee\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4f1a\u5728Revit\u7684\u201cpyRevit\u201d\u9009\u9879\u5361\u4e2d\u663e\u793a\u4e00\u4e2a\u65b0\u7684\u9009\u9879\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u521b\u5efa\u548c\u8fd0\u884cPython\u811a\u672c<\/p>\n<p>\u5728pyRevit\u4e2d\uff0c\u53ef\u4ee5\u521b\u5efa\u81ea\u5b9a\u4e49\u7684\u6309\u94ae\uff0c\u5e76\u7ed1\u5b9aPython\u811a\u672c\u3002\u901a\u8fc7\u8fd9\u4e9b\u6309\u94ae\uff0c\u53ef\u4ee5\u5728Revit\u4e2d\u8fd0\u884c\u81ea\u5b9a\u4e49\u7684Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p><strong>\u5177\u4f53\u4f8b\u5b50\uff1a<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u60f3\u8981\u5728Revit\u4e2d\u751f\u6210\u4e00\u4e2a\u62a5\u544a\uff0c\u5217\u51fa\u6240\u6709\u623f\u95f4\u7684\u9762\u79ef\u548c\u540d\u79f0\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00pyRevit\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6309\u94ae\u3002<\/li>\n<li>\u7f16\u5199Python\u4ee3\u7801\uff0c\u83b7\u53d6\u6240\u6709\u623f\u95f4\uff0c\u5e76\u751f\u6210\u62a5\u544a\u3002<\/li>\n<li>\u8fd0\u884c\u811a\u672c\uff0c\u751f\u6210\u62a5\u544a\u3002<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<h2><strong>\u83b7\u53d6\u6240\u6709\u623f\u95f4<\/strong><\/h2>\n<p>rooms = FilteredElementCollector(doc).OfClass(SpatialElement).OfCategory(BuiltInCategory.OST_Rooms).ToElements()<\/p>\n<h2><strong>\u751f\u6210\u62a5\u544a<\/strong><\/h2>\n<p>report = []<\/p>\n<p>for room in rooms:<\/p>\n<p>    name = room.LookupParameter(&#39;Name&#39;).AsString()<\/p>\n<p>    area = room.LookupParameter(&#39;Area&#39;).AsDouble()<\/p>\n<p>    report.append(f&#39;Room: {name}, Area: {area}&#39;)<\/p>\n<h2><strong>\u8f93\u51fa\u62a5\u544a<\/strong><\/h2>\n<p>OUT = &#39;\\n&#39;.join(report)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u53ef\u4ee5\u5728pyRevit\u4e2d\u751f\u6210\u4e00\u4e2a\u62a5\u544a\uff0c\u5217\u51fa\u6240\u6709\u623f\u95f4\u7684\u9762\u79ef\u548c\u540d\u79f0\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001PYTHON\u811a\u672c\u5728REVIT\u4e2d\u7684\u5e94\u7528\u573a\u666f<\/p>\n<\/p>\n<p><p>1\u3001\u6279\u91cf\u4fee\u6539\u5143\u7d20\u5c5e\u6027<\/p>\n<p>\u5728Revit\u9879\u76ee\u4e2d\uff0c\u7ecf\u5e38\u9700\u8981\u5bf9\u5927\u91cf\u5143\u7d20\u8fdb\u884c\u5c5e\u6027\u4fee\u6539\uff0c\u4f8b\u5982\u4fee\u6539\u5899\u4f53\u7c7b\u578b\u3001\u95e8\u7a97\u5c3a\u5bf8\u7b49\u3002\u901a\u8fc7Python\u811a\u672c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6279\u91cf\u4fee\u6539\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u751f\u6210\u590d\u6742\u51e0\u4f55\u5f62\u72b6<\/p>\n<p>Revit\u672c\u8eab\u7684\u5efa\u6a21\u529f\u80fd\u867d\u7136\u5f3a\u5927\uff0c\u4f46\u5728\u4e00\u4e9b\u590d\u6742\u51e0\u4f55\u5f62\u72b6\u7684\u751f\u6210\u4e0a\u53ef\u80fd\u6709\u6240\u6b20\u7f3a\u3002\u901a\u8fc7Python\u811a\u672c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u52a0\u590d\u6742\u7684\u51e0\u4f55\u5f62\u72b6\u751f\u6210\uff0c\u4f8b\u5982\u53c2\u6570\u5316\u5efa\u7b51\u3001\u81ea\u7531\u66f2\u9762\u7b49\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u6570\u636e\u5bfc\u51fa\u548c\u5206\u6790<\/p>\n<p>\u5728\u5efa\u7b51\u8bbe\u8ba1\u8fc7\u7a0b\u4e2d\uff0c\u6570\u636e\u7684\u5bfc\u51fa\u548c\u5206\u6790\u662f\u975e\u5e38\u91cd\u8981\u7684\u73af\u8282\u3002\u901a\u8fc7Python\u811a\u672c\uff0c\u53ef\u4ee5\u5c06Revit\u6a21\u578b\u4e2d\u7684\u6570\u636e\u5bfc\u51fa\u5230Excel\u3001CSV\u7b49\u683c\u5f0f\uff0c\u5e76\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u5206\u6790\u548c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><p>4\u3001\u81ea\u52a8\u5316\u8bbe\u8ba1\u6d41\u7a0b<\/p>\n<p>\u5728\u5efa\u7b51\u8bbe\u8ba1\u8fc7\u7a0b\u4e2d\uff0c\u8bb8\u591a\u6b65\u9aa4\u662f\u91cd\u590d\u548c\u7e41\u7410\u7684\u3002\u901a\u8fc7Python\u811a\u672c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u8bbe\u8ba1\u6d41\u7a0b\uff0c\u4f8b\u5982\u81ea\u52a8\u751f\u6210\u697c\u68af\u3001\u81ea\u52a8\u5e03\u7f6e\u5bb6\u5177\u7b49\uff0c\u63d0\u9ad8\u8bbe\u8ba1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528PYTHON\u811a\u672c\u7684\u6ce8\u610f\u4e8b\u9879<\/p>\n<\/p>\n<p><p>1\u3001\u4e86\u89e3Revit API<\/p>\n<p>\u8981\u5728Revit\u4e2d\u4f7f\u7528Python\u811a\u672c\uff0c\u9996\u5148\u9700\u8981\u4e86\u89e3Revit API\u3002Revit API\u662fRevit\u7684\u7f16\u7a0b\u63a5\u53e3\uff0c\u901a\u8fc7\u5b83\u53ef\u4ee5\u8bbf\u95ee\u548c\u64cd\u4f5cRevit\u6a21\u578b\u4e2d\u7684\u5143\u7d20\u3002\u4e86\u89e3Revit API\u7684\u57fa\u672c\u6982\u5ff5\u548c\u5e38\u7528\u7c7b\u662f\u7f16\u5199Python\u811a\u672c\u7684\u57fa\u7840\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u5904\u7406\u4e8b\u52a1\u548c\u6587\u6863<\/p>\n<p>\u5728Revit\u4e2d\uff0c\u5bf9\u6a21\u578b\u7684\u6240\u6709\u4fee\u6539\u90fd\u9700\u8981\u5728\u4e8b\u52a1\u4e2d\u8fdb\u884c\u3002\u56e0\u6b64\uff0c\u5728\u7f16\u5199Python\u811a\u672c\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u6b63\u786e\u5904\u7406\u4e8b\u52a1\u548c\u6587\u6863\uff0c\u786e\u4fdd\u4fee\u6539\u80fd\u591f\u6b63\u786e\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><p>3\u3001\u6027\u80fd\u4f18\u5316<\/p>\n<p>\u5728\u5904\u7406\u5927\u91cf\u5143\u7d20\u65f6\uff0cPython\u811a\u672c\u7684\u6027\u80fd\u53ef\u80fd\u6210\u4e3a\u74f6\u9888\u3002\u56e0\u6b64\uff0c\u5728\u7f16\u5199\u811a\u672c\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u6027\u80fd\u4f18\u5316\uff0c\u4f8b\u5982\u907f\u514d\u91cd\u590d\u8ba1\u7b97\u3001\u4f7f\u7528\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u7b49\u3002<\/p>\n<\/p>\n<p><p>4\u3001\u8c03\u8bd5\u548c\u9519\u8bef\u5904\u7406<\/p>\n<p>\u5728\u7f16\u5199Python\u811a\u672c\u65f6\uff0c\u96be\u514d\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u548c\u95ee\u9898\u3002\u901a\u8fc7\u9002\u5f53\u7684\u8c03\u8bd5\u548c\u9519\u8bef\u5904\u7406\uff0c\u53ef\u4ee5\u63d0\u9ad8\u811a\u672c\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u901a\u8fc7\u65e5\u5fd7\u8bb0\u5f55\u811a\u672c\u7684\u8fd0\u884c\u8fc7\u7a0b\uff0c\u6355\u83b7\u548c\u5904\u7406\u5f02\u5e38\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u5b9e\u4f8b\u5206\u6790<\/p>\n<\/p>\n<p><p><strong>\u5b9e\u4f8b1\uff1a\u81ea\u52a8\u751f\u6210\u697c\u68af<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728Revit\u4e2d\u751f\u6210\u4e00\u4e2a\u697c\u68af\uff0c\u5e76\u5e0c\u671b\u901a\u8fc7Python\u811a\u672c\u6765\u63a7\u5236\u697c\u68af\u7684\u53c2\u6570\uff0c\u4f8b\u5982\u8e0f\u6b65\u9ad8\u5ea6\u3001\u8e0f\u6b65\u6df1\u5ea6\u3001\u697c\u68af\u5bbd\u5ea6\u7b49\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u4e8b\u52a1<\/li>\n<li>\u5b9a\u4e49\u697c\u68af\u7684\u53c2\u6570<\/li>\n<li>\u521b\u5efa\u697c\u68af\u5143\u7d20<\/li>\n<li>\u8bbe\u7f6e\u697c\u68af\u7684\u53c2\u6570<\/li>\n<li>\u63d0\u4ea4\u4e8b\u52a1<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u4e8b\u52a1<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<p>transaction = Transaction(doc, &#39;Create St<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>r&#39;)<\/p>\n<p>transaction.Start()<\/p>\n<h2><strong>\u5b9a\u4e49\u697c\u68af\u7684\u53c2\u6570<\/strong><\/h2>\n<p>base_point = XYZ(0, 0, 0)<\/p>\n<p>width = 1.0<\/p>\n<p>riser_height = 0.18<\/p>\n<p>tread_depth = 0.25<\/p>\n<p>num_steps = 10<\/p>\n<h2><strong>\u521b\u5efa\u697c\u68af\u5143\u7d20<\/strong><\/h2>\n<p>stair_type = FilteredElementCollector(doc).OfClass(StairsType).FirstElement()<\/p>\n<p>stairs = Stairs.Create(doc, stair_type.Id, base_point, width, riser_height, tread_depth, num_steps)<\/p>\n<h2><strong>\u63d0\u4ea4\u4e8b\u52a1<\/strong><\/h2>\n<p>transaction.Commit()<\/p>\n<h2><strong>\u8f93\u51fa\u697c\u68af<\/strong><\/h2>\n<p>OUT = stairs<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Revit\u4e2d\u81ea\u52a8\u751f\u6210\u697c\u68af\uff0c\u5e76\u901a\u8fc7Python\u811a\u672c\u63a7\u5236\u697c\u68af\u7684\u53c2\u6570\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b9e\u4f8b2\uff1a\u81ea\u52a8\u5e03\u7f6e\u5bb6\u5177<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728Revit\u4e2d\u81ea\u52a8\u5e03\u7f6e\u5bb6\u5177\uff0c\u5e76\u5e0c\u671b\u901a\u8fc7Python\u811a\u672c\u6765\u63a7\u5236\u5bb6\u5177\u7684\u4f4d\u7f6e\u548c\u7c7b\u578b\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u4e8b\u52a1<\/li>\n<li>\u5b9a\u4e49\u5bb6\u5177\u7684\u4f4d\u7f6e\u548c\u7c7b\u578b<\/li>\n<li>\u521b\u5efa\u5bb6\u5177\u5143\u7d20<\/li>\n<li>\u63d0\u4ea4\u4e8b\u52a1<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u4e8b\u52a1<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<p>transaction = Transaction(doc, &#39;Place Furniture&#39;)<\/p>\n<p>transaction.Start()<\/p>\n<h2><strong>\u5b9a\u4e49\u5bb6\u5177\u7684\u4f4d\u7f6e\u548c\u7c7b\u578b<\/strong><\/h2>\n<p>furniture_positions = [XYZ(0, 0, 0), XYZ(2, 0, 0), XYZ(4, 0, 0)]<\/p>\n<p>furniture_type = FilteredElementCollector(doc).OfClass(FamilySymbol).OfCategory(BuiltInCategory.OST_Furniture).FirstElement()<\/p>\n<h2><strong>\u521b\u5efa\u5bb6\u5177\u5143\u7d20<\/strong><\/h2>\n<p>furniture_elements = []<\/p>\n<p>for position in furniture_positions:<\/p>\n<p>    furniture = doc.Create.NewFamilyInstance(position, furniture_type, StructuralType.NonStructural)<\/p>\n<p>    furniture_elements.append(furniture)<\/p>\n<h2><strong>\u63d0\u4ea4\u4e8b\u52a1<\/strong><\/h2>\n<p>transaction.Commit()<\/p>\n<h2><strong>\u8f93\u51fa\u5bb6\u5177\u5143\u7d20<\/strong><\/h2>\n<p>OUT = furniture_elements<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Revit\u4e2d\u81ea\u52a8\u5e03\u7f6e\u5bb6\u5177\uff0c\u5e76\u901a\u8fc7Python\u811a\u672c\u63a7\u5236\u5bb6\u5177\u7684\u4f4d\u7f6e\u548c\u7c7b\u578b\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b9e\u4f8b3\uff1a\u6570\u636e\u5bfc\u51fa\u548c\u5206\u6790<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5c06Revit\u6a21\u578b\u4e2d\u7684\u623f\u95f4\u6570\u636e\u5bfc\u51fa\u5230Excel\uff0c\u5e76\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u5206\u6790\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u623f\u95f4\u6570\u636e<\/li>\n<li>\u521b\u5efaExcel\u6587\u4ef6\u5e76\u5199\u5165\u6570\u636e<\/li>\n<li>\u4fdd\u5b58\u548c\u5173\u95edExcel\u6587\u4ef6<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<p>import openpyxl<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u623f\u95f4\u6570\u636e<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<p>rooms = FilteredElementCollector(doc).OfClass(SpatialElement).OfCategory(BuiltInCategory.OST_Rooms).ToElements()<\/p>\n<h2><strong>\u521b\u5efaExcel\u6587\u4ef6\u5e76\u5199\u5165\u6570\u636e<\/strong><\/h2>\n<p>wb = openpyxl.Workbook()<\/p>\n<p>ws = wb.active<\/p>\n<p>ws.append([&#39;Room Name&#39;, &#39;Area&#39;])<\/p>\n<p>for room in rooms:<\/p>\n<p>    name = room.LookupParameter(&#39;Name&#39;).AsString()<\/p>\n<p>    area = room.LookupParameter(&#39;Area&#39;).AsDouble()<\/p>\n<p>    ws.append([name, area])<\/p>\n<h2><strong>\u4fdd\u5b58\u548c\u5173\u95edExcel\u6587\u4ef6<\/strong><\/h2>\n<p>wb.save(&#39;room_data.xlsx&#39;)<\/p>\n<p>wb.close()<\/p>\n<h2><strong>\u8f93\u51faExcel\u6587\u4ef6\u8def\u5f84<\/strong><\/h2>\n<p>OUT = &#39;room_data.xlsx&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06Revit\u6a21\u578b\u4e2d\u7684\u623f\u95f4\u6570\u636e\u5bfc\u51fa\u5230Excel\uff0c\u5e76\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u5206\u6790\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b9e\u4f8b4\uff1a\u81ea\u52a8\u751f\u6210\u62a5\u544a<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728Revit\u4e2d\u751f\u6210\u4e00\u4e2a\u62a5\u544a\uff0c\u5217\u51fa\u6240\u6709\u623f\u95f4\u7684\u9762\u79ef\u548c\u540d\u79f0\uff0c\u5e76\u5c06\u62a5\u544a\u4fdd\u5b58\u4e3aPDF\u6587\u4ef6\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u623f\u95f4\u6570\u636e<\/li>\n<li>\u521b\u5efa\u62a5\u544a\u5e76\u5199\u5165\u6570\u636e<\/li>\n<li>\u4fdd\u5b58\u62a5\u544a\u4e3aPDF\u6587\u4ef6<\/li>\n<\/ol>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import clr<\/p>\n<p>clr.AddReference(&#39;RevitServices&#39;)<\/p>\n<p>from RevitServices.Persistence import DocumentManager<\/p>\n<p>clr.AddReference(&#39;RevitAPI&#39;)<\/p>\n<p>from Autodesk.Revit.DB import *<\/p>\n<p>import fpdf<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u6587\u6863\u548c\u623f\u95f4\u6570\u636e<\/strong><\/h2>\n<p>doc = DocumentManager.Instance.CurrentDBDocument<\/p>\n<p>rooms = FilteredElementCollector(doc).OfClass(SpatialElement).OfCategory(BuiltInCategory.OST_Rooms).ToElements()<\/p>\n<h2><strong>\u521b\u5efa\u62a5\u544a\u5e76\u5199\u5165\u6570\u636e<\/strong><\/h2>\n<p>pdf = fpdf.FPDF()<\/p>\n<p>pdf.add_page()<\/p>\n<p>pdf.set_font(&#39;Arial&#39;, size=12)<\/p>\n<p>pdf.cell(200, 10, txt=&#39;Room Report&#39;, ln=True, align=&#39;C&#39;)<\/p>\n<p>pdf.cell(200, 10, txt=&#39;Room Name\\tArea&#39;, ln=True, align=&#39;L&#39;)<\/p>\n<p>for room in rooms:<\/p>\n<p>    name = room.LookupParameter(&#39;Name&#39;).AsString()<\/p>\n<p>    area = room.LookupParameter(&#39;Area&#39;).AsDouble()<\/p>\n<p>    pdf.cell(200, 10, txt=f&#39;{name}\\t{area}&#39;, ln=True, align=&#39;L&#39;)<\/p>\n<h2><strong>\u4fdd\u5b58\u62a5\u544a\u4e3aPDF\u6587\u4ef6<\/strong><\/h2>\n<p>pdf.output(&#39;room_report.pdf&#39;)<\/p>\n<h2><strong>\u8f93\u51faPDF\u6587\u4ef6\u8def\u5f84<\/strong><\/h2>\n<p>OUT = &#39;room_report.pdf&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Revit\u4e2d\u751f\u6210\u4e00\u4e2a\u62a5\u544a\uff0c\u5217\u51fa\u6240\u6709\u623f\u95f4\u7684\u9762\u79ef\u548c\u540d\u79f0\uff0c\u5e76\u5c06\u62a5\u544a\u4fdd\u5b58\u4e3aPDF\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\uff0c\u5728Revit\u4e2d\u4f7f\u7528Python\uff0c\u53ef\u4ee5\u901a\u8fc7Dynamo\u3001RevitPythonShell\u548cpyRevit\u5b9e\u73b0\u3002\u901a\u8fc7\u8fd9\u4e9b\u5de5\u5177\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6279\u91cf\u4fee\u6539\u5143\u7d20\u5c5e\u6027\u3001\u751f\u6210\u590d\u6742\u51e0\u4f55\u5f62\u72b6\u3001\u6570\u636e\u5bfc\u51fa\u548c\u5206\u6790\u3001\u81ea\u52a8\u5316\u8bbe\u8ba1\u6d41\u7a0b\u7b49\u591a\u79cd\u529f\u80fd\u3002\u901a\u8fc7\u5b9e\u4f8b\u5206\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230Python\u5728Revit\u4e2d\u7684\u5f3a\u5927\u5e94\u7528\u6f5c\u529b\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u8bfb\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u638c\u63e1\u5728Revit\u4e2d\u4f7f\u7528Python\u7684\u65b9\u6cd5\u548c\u6280\u5de7\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Revit\u4e2d\u4f7f\u7528Python\u9700\u8981\u54ea\u4e9b\u57fa\u672c\u77e5\u8bc6\u548c\u6280\u80fd\uff1f<\/strong><br \/>\u8981\u5728Revit\u4e2d\u4f7f\u7528Python\uff0c\u7528\u6237\u9700\u638c\u63e1\u57fa\u672c\u7684\u7f16\u7a0b\u6982\u5ff5\u4ee5\u53caPython\u8bed\u8a00\u7684\u57fa\u7840\u77e5\u8bc6\u3002\u6b64\u5916\uff0c\u4e86\u89e3Revit API\u7684\u7ed3\u6784\u548c\u529f\u80fd\u4e5f\u81f3\u5173\u91cd\u8981\u3002\u901a\u8fc7\u5b66\u4e60\u5982\u4f55\u901a\u8fc7Python\u8bbf\u95ee\u548c\u64cd\u4f5cRevit\u7684\u5143\u7d20\uff0c\u7528\u6237\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u4efb\u52a1\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Revit\u4e2d\u8bbe\u7f6ePython\u811a\u672c\u7684\u8fd0\u884c\u73af\u5883\uff1f<\/strong><br \/>\u5728Revit\u4e2d\u8fd0\u884cPython\u811a\u672c\u901a\u5e38\u9700\u8981\u5b89\u88c5RevitPythonShell\u6216Dynamo\u3002RevitPythonShell\u662f\u4e00\u4e2a\u63d2\u4ef6\uff0c\u5141\u8bb8\u7528\u6237\u5728Revit\u5185\u90e8\u76f4\u63a5\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u3002Dynamo\u5219\u662f\u4e00\u4e2a\u53ef\u89c6\u5316\u7f16\u7a0b\u5de5\u5177\uff0c\u4e5f\u652f\u6301Python\u811a\u672c\u7684\u5d4c\u5165\u3002\u7528\u6237\u9700\u786e\u4fdd\u5c06\u76f8\u5e94\u7684\u63d2\u4ef6\u5b89\u88c5\u5230Revit\u4e2d\uff0c\u5e76\u4e86\u89e3\u5176\u57fa\u672c\u64cd\u4f5c\u754c\u9762\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u901a\u8fc7Python\u811a\u672c\u6765\u81ea\u52a8\u5316Revit\u4e2d\u7684\u7279\u5b9a\u4efb\u52a1\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u901a\u8fc7\u7f16\u5199Python\u811a\u672c\uff0c\u7528\u6237\u53ef\u4ee5\u81ea\u52a8\u5316\u8bb8\u591aRevit\u4e2d\u7684\u91cd\u590d\u6027\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u7528\u6237\u53ef\u4ee5\u4f7f\u7528Python\u81ea\u52a8\u751f\u6210\u56fe\u7eb8\u3001\u4fee\u6539\u5143\u7d20\u5c5e\u6027\u3001\u6279\u91cf\u5904\u7406\u65cf\u7b49\u3002\u8fd9\u4e0d\u4ec5\u8282\u7701\u4e86\u65f6\u95f4\uff0c\u8fd8\u51cf\u5c11\u4e86\u4eba\u4e3a\u9519\u8bef\u7684\u53d1\u751f\u3002\u5b66\u4e60\u5982\u4f55\u4f7f\u7528Revit API\u4e2d\u7684\u529f\u80fd\u662f\u5b9e\u73b0\u8fd9\u4e9b\u81ea\u52a8\u5316\u4efb\u52a1\u7684\u5173\u952e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Revit\u4e2d\u4f7f\u7528Python\uff0c\u53ef\u4ee5\u901a\u8fc7Dynamo\u3001RevitPythonShell\u548cpyRevit\u5b9e\u73b0\u3002 [&hellip;]","protected":false},"author":3,"featured_media":1149516,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1149512"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1149512"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1149512\/revisions"}],"predecessor-version":[{"id":1149517,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1149512\/revisions\/1149517"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1149516"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1149512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1149512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1149512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}