{"id":22732,"date":"2025-11-13T00:11:39","date_gmt":"2025-11-12T16:11:39","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=22732"},"modified":"2026-04-07T15:09:19","modified_gmt":"2026-04-07T07:09:19","slug":"siemens-nx%ef%bc%88ug%ef%bc%89python-%e5%bc%80%e5%8f%91-%e5%88%b6%e5%9b%be%e9%a6%96%e9%80%89%e9%a1%b9%ef%bc%88%e7%a0%94%e7%a9%b6%e4%b8%ad%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=22732","title":{"rendered":"Siemens NX\uff08UG\uff09Python \u5f00\u53d1 &#8211; \u5236\u56fe\u9996\u9009\u9879"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%89%8D%E8%A8%80\" >\u524d\u8a00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83\" >\u6d4b\u8bd5\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E6%B5%8B%E8%AF%95%E7%94%A8%E9%80%9A%E7%94%A8%E4%BB%A3%E7%A0%81\" >\u6d4b\u8bd5\u7528\u901a\u7528\u4ee3\u7801<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%85%AC%E5%85%B1\" >\u516c\u5171<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E6%96%87%E5%AD%97\" >\u6587\u5b57<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E7%9B%B4%E7%BA%BF%E7%AE%AD%E5%A4%B4\" >\u76f4\u7ebf\/\u7bad\u5934<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%8E%9F%E7%82%B9\" >\u539f\u70b9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%89%8D%E7%BC%80%E5%90%8E%E7%BC%80%EF%BC%88%E4%B8%8D%E5%AE%8C%E5%96%84%EF%BC%89\" >\u524d\u7f00\/\u540e\u7f00\uff08\u4e0d\u5b8c\u5584\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E4%BF%9D%E7%95%99%E7%9A%84%E6%B3%A8%E9%87%8A\" >\u4fdd\u7559\u7684\u6ce8\u91ca<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%B1%82%E5%8F%A0\" >\u5c42\u53e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E6%A0%87%E5%87%86\" >\u6807\u51c6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E7%AC%A6%E5%8F%B7\" >\u7b26\u53f7<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%B0%BA%E5%AF%B8\" >\u5c3a\u5bf8<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B\" >\u5de5\u4f5c\u6d41\u7a0b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%8E%9F%E7%82%B9-2\" >\u539f\u70b9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%85%AC%E5%B7%AE%EF%BC%88%E7%A9%BA%EF%BC%89\" >\u516c\u5dee\uff08\u7a7a\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%8F%8C%E5%B0%BA%E5%AF%B8\" >\u53cc\u5c3a\u5bf8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E6%8A%98%E7%BA%BF\" >\u6298\u7ebf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E7%AA%84%E5%B0%BA%E5%AF%B8\" >\u7a84\u5c3a\u5bf8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%8D%95%E4%BE%A7%E5%B0%BA%E5%AF%B8\" >\u5355\u4fa7\u5c3a\u5bf8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%B0%BA%E5%AF%B8%E9%9B%86\" >\u5c3a\u5bf8\u96c6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%80%92%E6%96%9C%E8%A7%92\" >\u5012\u659c\u89d2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%B0%BA%E5%AF%B8%E7%BA%BF\" >\u5c3a\u5bf8\u7ebf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%BE%84%E5%90%91\" >\u5f84\u5411<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/blog.iyatt.com\/?p=22732\/#%E5%9D%90%E6%A0%87\" >\u5750\u6807<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E5%89%8D%E8%A8%80\"><\/span>\u524d\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>2025\/11\/12<br \/>\n\u6211\u7814\u7a76\u5236\u56fe\u9996\u9009\u9879\u901a\u8fc7\u7f16\u7a0b\u8bbe\u7f6e\u7684\u76ee\u7684\u662f\uff1a\u5b9e\u73b0\u5c06\u4e00\u4e2a\u6a21\u677f\u7684\u5236\u56fe\u9996\u9009\u9879\u590d\u5236\u7ed9\u53e6\u5916\u4e00\u4e2a\u90e8\u4ef6\uff0c\u505a\u5230\u4e00\u952e\u8bbe\u7f6e\u5236\u56fe\u9996\u9009\u9879\uff08\u5173\u7cfb\u5230\u51fa\u56fe\u7eb8\u65f6\u7684\u5b57\u4f53\u3001\u6807\u6ce8\u3001\u8868\u7b49\u8bbe\u7f6e\u5185\u5bb9\uff09\u3002<br \/>\n\u5728\u96f6\u4ef6\u5185\u63d2\u5165\u56fe\u7eb8\u9875\u7684\u65f6\u5019\uff0c\u5236\u56fe\u9996\u9009\u9879\u7684\u8bbe\u7f6e\u5185\u5bb9\u4e0d\u662f\u6765\u6e90\u4e8e\u56fe\u7eb8\u6a21\u677f\uff0c\u800c\u662f\u96f6\u4ef6\u6a21\u677f\u3002\u7136\u800c\u96f6\u4ef6\u6a21\u677f\u6709\u5f88\u591a\uff0c\u65b0\u5efa\u6a21\u578b\u3001\u65b0\u5efa\u88c5\u914d\u3001\u5bfc\u5165step\u3001\u5bfc\u5165x_t\u3001\u5bfc\u5165sldprt\u3001\u5bfc\u5165sldasm \u7b49\u7b49\u90fd\u662f\u4e0d\u540c\u7684\u6a21\u677f\uff0c\u5206\u522b\u53bb\u8bbe\u7f6e\u6a21\u677f\u5de5\u4f5c\u91cf\u5927\uff0c\u53bb\u627e\u8fd9\u4e9b\u6a21\u677f\u6587\u4ef6\u5728\u4ec0\u4e48\u4f4d\u7f6e\u4e5f\u6709\u70b9\u70e6\u4eba\u3002\u56e0\u6b64\u6211\u60f3\u901a\u8fc7\u7a0b\u5e8f\u8bfb\u53d6\u6a21\u677f\u7684\u5236\u56fe\u9996\u9009\u9879\uff0c\u518d\u628a\u503c\u8bbe\u7f6e\u7ed9\u90e8\u4ef6\uff0c\u8fd9\u6837\u53ea\u9700\u8981\u8bbe\u7f6e\u597d\u4e00\u4e2a\u6a21\u677f\u6587\u4ef6\uff0c\u4f7f\u7528\u65f6\u540c\u6b65\u5230\u5de5\u4f5c\u90e8\u4ef6\u5c31\u884c\u3002<\/p>\n<p>2026\/4\/7<br \/>\n\u4e0a\u4e00\u6b21\u66f4\u65b0\u662f 2025\/12\/2\uff0c\u505c\u4e86 4 \u4e2a\u6708\u4e86\u3002\u4eca\u5929\u6211\u7a81\u7136\u53d1\u73b0\u53ef\u4ee5\u4e0d\u7528\u8fd9\u4e48\u9ebb\u70e6\u7684\u5199\u4ee3\u7801\u8bbe\u7f6e\u8fd9\u4e00\u5806\u4e1c\u897f\uff0c\u5728\u7528\u6237\u9ed8\u8ba4\u8bbe\u7f6e\u91cc\u81ea\u5b9a\u4e49\u5236\u56fe\u6807\u51c6\uff0c\u7136\u540e\u5728\u5236\u56fe\u9996\u9009\u9879\u91cc\u4ece\u7528\u6237\u9ed8\u8ba4\u8bbe\u7f6e\u7ee7\u627f\u5373\u53ef\u3002\u56e0\u6b64\u672c\u6587\u7ec8\u6b62\u3002<br \/>\n\u4ece<strong>\u7528\u6237\u9ed8\u8ba4\u8bbe\u7f6e<\/strong>\u7ee7\u627f<strong>\u5236\u56fe\u9996\u9009\u9879<\/strong>\u53ef\u53c2\u8003\uff1a<a href=\"https:\/\/blog.iyatt.com\/?p=22282\">https:\/\/blog.iyatt.com\/?p=22282<\/a><\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83\"><\/span>\u6d4b\u8bd5\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<ul>\n<li>Windows 11 25H2<\/li>\n<li>NX 2506<\/li>\n<li>\u5185\u7f6e Python 3.12.8<\/li>\n<\/ul>\n<h1><span class=\"ez-toc-section\" id=\"%E6%B5%8B%E8%AF%95%E7%94%A8%E9%80%9A%E7%94%A8%E4%BB%A3%E7%A0%81\"><\/span>\u6d4b\u8bd5\u7528\u901a\u7528\u4ee3\u7801<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>\u540e\u7eed\u7684\u6d4b\u8bd5\u9879\u90fd\u4ee5 DraftingPreferencesTest \u7c7b\u65b9\u6cd5\u5448\u73b0\uff0c\u53ea\u9700\u8981\u4e3a DraftingPreferencesTest \u7c7b\u6dfb\u52a0\u65b9\u6cd5\u5373\u53ef\uff0c\u8fd0\u884c\u4ee3\u7801\u65f6\u4f1a\u81ea\u52a8\u904d\u5386 DraftingPreferencesTest \u7c7b\u65b9\u6cd5\u6267\u884c<\/p>\n<pre><code class=\"language-python\">import NXOpen\nfrom NXOpen import Annotations, Drafting, DisplayableObject, LineFontBuilder\n\nimport inspect\n\nclass DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def common(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u793a\u4f8b\n        &quot;&quot;&quot;\n        lw.WriteLine(&#039;\u8fd9\u662f\u793a\u4f8b\u7a0b\u5e8f&#039;)\n        lw.WriteLine(&#039;\u53ea\u9700\u8981\u5c06\u6d4b\u8bd5\u65b9\u6cd5\u653e\u7f6e\u4e8e DraftingPreferencesTest \u7c7b\u4e2d\uff0c\u6267\u884c\u65f6\u4f1a\u81ea\u52a8\u8c03\u7528&#039;)\n\ndef getEnumName(enumClass, value) -&gt; str | None:\n    &quot;&quot;&quot;\n    \u83b7\u53d6\u679a\u4e3e\u7c7b\u4e2d\u5bf9\u5e94\u503c\u7684\u540d\u79f0\n\n    Args:\n        enumClass (enum): \u679a\u4e3e\u7c7b\n        value (int): \u679a\u4e3e\u503c\n\n    Returns:\n        str: \u679a\u4e3e\u540d\u79f0\n    &quot;&quot;&quot;\n    for attrName in dir(enumClass):\n        # \u6392\u9664\u7279\u6b8a\u5c5e\u6027\n        if attrName.startswith(&quot;__&quot;):\n            continue\n        # \u83b7\u53d6\u5c5e\u6027\u503c\n        attrValue = getattr(enumClass, attrName)\n        if attrValue == value:\n            return attrName\n    return None\n\ndef getPartDraftingPreferences(part: NXOpen.Part) -&gt; Drafting.PreferencesBuilder:\n    &quot;&quot;&quot;\n    \u83b7\u53d6\u90e8\u4ef6\u5236\u56fe\u9996\u9009\u9879\n\n    Args:\n        part (NXOpen.Part): \u90e8\u4ef6\n\n    Returns:\n        Drafting.PreferencesBuilder: \u5236\u56fe\u9996\u9009\u9879\u5bf9\u8c61\n    &quot;&quot;&quot;\n    preferences = part.SettingsManager.CreatePreferencesBuilder()\n    preferences.TableSection.ApplyToAllSections = True # \u5e94\u7528\u5230\u6240\u6709\u8868\u683c\u533a\u6bb5\n    return preferences\n\ndef callUserDefinedMethods(obj: object, part: NXOpen.Part, lw: NXOpen.ListingWindow):\n    &quot;&quot;&quot;\n    \u8c03\u7528\u7528\u6237\u5b9a\u4e49\u7684\u65b9\u6cd5\n\n    Args:\n        obj (object): \u88ab\u8c03\u7528\u65b9\u6cd5\u6240\u5c5e\u7c7b\u5bf9\u8c61\n        part (NXOpen.Part): \u90e8\u4ef6\n        lw (NXOpen.ListingWindow): \u5217\u8868\u7a97\u53e3\n    &quot;&quot;&quot;\n    # \u83b7\u53d6\u7c7b\n    cls = obj.__class__\n    # \u904d\u5386\u7528\u6237\u5b9a\u4e49\u65b9\u6cd5\n    for name, func in inspect.getmembers(cls, predicate=inspect.isfunction):\n        # \u6392\u9664\u9b54\u672f\u65b9\u6cd5\u548c\u7279\u6b8a\u65b9\u6cd5\n        if name.startswith(&quot;__&quot;) or name.startswith(&quot;_&quot;):\n            continue\n\n        # \u83b7\u53d6\u51fd\u6570\u7b7e\u540d\uff0c\u68c0\u67e5\u53c2\u6570\u6570\u91cf\n        sig = inspect.signature(func)\n        expectedParams = list(sig.parameters.keys())\n\n        if len(expectedParams) == 2:\n            getattr(obj, name)(part, lw)\n        else:\n            lw.WriteLine(f&#039;\u65b9\u6cd5 {name} \u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u672a\u8c03\u7528&#039;)\n\ndef main():\n    # \u83b7\u53d6\u4f1a\u8bdd\n    session = NXOpen.Session.GetSession()\n    # \u5217\u8868\u7a97\u53e3\n    lw = session.ListingWindow\n    if not lw.IsOpen:\n        lw.Open()\n    # \u5de5\u4f5c\u90e8\u4ef6\n    workPart = session.Parts.Work\n    # \u8c03\u7528\u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    callUserDefinedMethods(DraftingPreferencesTest(), workPart, lw)\n\nif __name__ == &#039;__main__&#039;:\n    main()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763181804085.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 546px; --smush-placeholder-aspect-ratio: 546\/139;\" \/><\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E5%85%AC%E5%85%B1\"><\/span>\u516c\u5171<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2><span class=\"ez-toc-section\" id=\"%E6%96%87%E5%AD%97\"><\/span>\u6587\u5b57<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1762961138914.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 602px; --smush-placeholder-aspect-ratio: 602\/586;\" \/><\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1762961148915.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/165;\" \/><\/p>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def commonText(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u516c\u5171 - \u6587\u5b57\n        &quot;&quot;&quot;\n        # \u7b2c\u4e00\u6b21\u83b7\u53d6\u9996\u9009\u9879\n        preferences1 = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u5bf9\u9f50\u4f4d\u7f6e #\n        # \u8bfb\u53d6\n        alignPosition = preferences1.AnnotationStyle.LetteringStyle.AlignPosition\n        alignPositionName = getEnumName(Annotations.AlignmentPosition, alignPosition)\n        lw.WriteLine(f&#039;\u521d\u59cb\u5bf9\u9f50\u4f4d\u7f6e\uff1a{alignPositionName}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.AlignPosition = Annotations.AlignmentPosition.BottomCenter\n\n        # \u30102\u3011\u6587\u5b57\u5bf9\u6b63 #\n        # \u8bfb\u53d6\n        horizontalTextJustification = preferences1.AnnotationStyle.LetteringStyle.HorizontalTextJustification\n        horizontalTextJustificationName = getEnumName(Annotations.TextJustification, horizontalTextJustification)\n        lw.WriteLine(f&#039;\u521d\u59cb\u6587\u5b57\u5bf9\u6b63\uff1a{horizontalTextJustificationName}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.HorizontalTextJustification = Annotations.TextJustification.Center\n\n        # \u30103\u3011\u5b57\u4f53 #\n        # \u8bfb\u53d6\n        fontIndex = preferences1.AnnotationStyle.LetteringStyle.GeneralTextFont\n        fontName = part.Fonts.GetFontName(fontIndex)\n        lw.WriteLine(f&#039;\u521d\u59cb\u5b57\u4f53\uff1a{fontName}&#039;)\n        # \u4fee\u6539\n        fontIndex = part.Fonts.AddFont(&#039;\u9ed1\u4f53&#039;, NXOpen.FontCollection.Type.Standard)\n        preferences1.AnnotationStyle.LetteringStyle.GeneralTextFont = fontIndex\n\n        # \u30104\u3011\u9ad8\u5ea6\n        # \u8bfb\u53d6\n        generalTextSize = preferences1.AnnotationStyle.LetteringStyle.GeneralTextSize\n        lw.WriteLine(f&#039;\u521d\u59cb\u9ad8\u5ea6\uff1a{generalTextSize}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GeneralTextSize = 1.0\n\n        #\u30105\u3011NX \u5b57\u4f53\u95f4\u9699\u56e0\u5b50\n        # \u8bfb\u53d6\n        generalNxTextCharacterSpaceFactor = preferences1.AnnotationStyle.LetteringStyle.GeneralNxTextCharacterSpaceFactor\n        lw.WriteLine(f&#039;\u521d\u59cb NX \u5b57\u4f53\u95f4\u9699\u56e0\u5b50\uff1a{generalNxTextCharacterSpaceFactor}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GeneralNxTextCharacterSpaceFactor = 2.0\n\n        #\u30106\u3011\u6807\u51c6\u5b57\u4f53\u95f4\u9699\u56e0\u5b50\n        # \u8bfb\u53d6\n        generalStandardTextCharacterSpaceFactor = preferences1.AnnotationStyle.LetteringStyle.GeneralStandardTextCharacterSpaceFactor\n        lw.WriteLine(f&#039;\u521d\u59cb\u6807\u51c6\u5b57\u4f53\u95f4\u9699\u56e0\u5b50\uff1a{generalStandardTextCharacterSpaceFactor}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GeneralStandardTextCharacterSpaceFactor = 3.0\n\n        # \u30107\u3011\u6587\u672c\u5bbd\u9ad8\u6bd4\n        # \u8bfb\u53d6\n        generalTextAspectRatio = preferences1.AnnotationStyle.LetteringStyle.GeneralTextAspectRatio\n        lw.WriteLine(f&#039;\u521d\u59cb\u6587\u672c\u5bbd\u9ad8\u6bd4\uff1a{generalTextAspectRatio}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GeneralTextAspectRatio = 4.0\n\n        # \u30108\u3011\u7b26\u53f7\u5bbd\u9ad8\u6bd4\n        # \u8bfb\u53d6\n        generalTextSymbolAspectRatio = preferences1.AnnotationStyle.LetteringStyle.GeneralTextSymbolAspectRatio\n        lw.WriteLine(f&#039;\u521d\u59cb\u7b26\u53f7\u5bbd\u9ad8\u6bd4\uff1a{generalTextSymbolAspectRatio}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GeneralTextSymbolAspectRatio = 5.0\n\n        # \u30109\u3011\u884c\u95f4\u9699\u56e0\u5b50\n        # \u8bfb\u53d6\n        generalTextLineSpaceFactor = preferences1.AnnotationStyle.LetteringStyle.GeneralTextLineSpaceFactor\n        lw.WriteLine(f&#039;\u521d\u59cb\u884c\u95f4\u9699\u56e0\u5b50\uff1a{generalTextLineSpaceFactor}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GeneralTextLineSpaceFactor = 6.0\n\n        # \u301010\u3011\u6587\u672c\u89d2\u5ea6\n        angle = preferences1.AnnotationStyle.LetteringStyle.Angle\n        lw.WriteLine(f&#039;\u521d\u59cb\u6587\u672c\u89d2\u5ea6\uff1a{angle}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.Angle = 90.0\n\n        # \u301011\u3011\u9ad8\u5ea6\u56e0\u5b50\n        gdtFrameHeightFactor = preferences1.AnnotationStyle.LetteringStyle.GdtFrameHeightFactor\n        lw.WriteLine(f&#039;\u521d\u59cb\u9ad8\u5ea6\u56e0\u5b50\uff1a{gdtFrameHeightFactor}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.GdtFrameHeightFactor = 3.0\n\n        # \u301012\u3011\u7b26\u53f7\u5b57\u4f53\u6587\u4ef6\n        symbolFontFile = preferences1.AnnotationStyle.LetteringStyle.SymbolFontFile\n        lw.WriteLine(f&#039;\u521d\u59cb\u7b26\u53f7\u5b57\u4f53\u6587\u4ef6\uff1a{symbolFontFile}&#039;)\n        # \u4fee\u6539\n        preferences1.AnnotationStyle.LetteringStyle.SymbolFontFile = &#039;NX ISO Symbols&#039;\n\n        # \u63d0\u4ea4\u4fee\u6539\n        preferences1.Commit()\n        # \u9500\u6bc1\n        preferences1.Destroy()\n\n        ###########################################################################################\n        lw.WriteLine(&#039;-&#039; * 100)\n\n        # \u7b2c\u4e8c\u6b21\u83b7\u53d6\u9996\u9009\u9879\n        preferences2 = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u8bfb\u53d6\u5bf9\u9f50\u4f4d\u7f6e\n        alignPosition = preferences2.AnnotationStyle.LetteringStyle.AlignPosition\n        alignPositionName = getEnumName(Annotations.AlignmentPosition, alignPosition)\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u5bf9\u9f50\u4f4d\u7f6e\uff1a{alignPositionName}&#039;)\n\n        # \u30102\u3011\u8bfb\u53d6\u6587\u5b57\u5bf9\u6b63\n        horizontalTextJustification = preferences2.AnnotationStyle.LetteringStyle.HorizontalTextJustification\n        horizontalTextJustificationName = getEnumName(Annotations.TextJustification, horizontalTextJustification)\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u6587\u5b57\u5bf9\u6b63\uff1a{horizontalTextJustificationName}&#039;)\n\n        # \u30103\u3011\u8bfb\u53d6\u5b57\u4f53\n        fontIndex = preferences2.AnnotationStyle.LetteringStyle.GeneralTextFont\n        fontName = part.Fonts.GetFontName(fontIndex)\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u5b57\u4f53\uff1a{fontName}&#039;)\n\n        # \u30104\u3011\u8bfb\u53d6\u9ad8\u5ea6\n        generalTextSize = preferences2.AnnotationStyle.LetteringStyle.GeneralTextSize\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u9ad8\u5ea6\uff1a{generalTextSize}&#039;)\n\n        # \u30105\u3011\u8bfb\u53d6 NX \u5b57\u4f53\u95f4\u9699\u56e0\u5b50\n        generalNxTextCharacterSpaceFactor = preferences2.AnnotationStyle.LetteringStyle.GeneralNxTextCharacterSpaceFactor\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e NX \u5b57\u4f53\u95f4\u9699\u56e0\u5b50\uff1a{generalNxTextCharacterSpaceFactor}&#039;)\n\n        # \u30106\u3011\u8bfb\u53d6\u6807\u51c6\u5b57\u4f53\u95f4\u9699\u56e0\u5b50\n        generalStandardTextCharacterSpaceFactor = preferences2.AnnotationStyle.LetteringStyle.GeneralStandardTextCharacterSpaceFactor\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u6807\u51c6\u5b57\u4f53\u95f4\u9699\u56e0\u5b50\uff1a{generalStandardTextCharacterSpaceFactor}&#039;)\n\n        # \u30107\u3011\u8bfb\u53d6\u6587\u672c\u5bbd\u9ad8\u6bd4\n        generalTextAspectRatio = preferences2.AnnotationStyle.LetteringStyle.GeneralTextAspectRatio\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u6587\u672c\u5bbd\u9ad8\u6bd4\uff1a{generalTextAspectRatio}&#039;)\n\n        # \u30108\u3011\u8bfb\u53d6\u7b26\u53f7\u5bbd\u9ad8\u6bd4\n        generalTextSymbolAspectRatio = preferences2.AnnotationStyle.LetteringStyle.GeneralTextSymbolAspectRatio\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u7b26\u53f7\u5bbd\u9ad8\u6bd4\uff1a{generalTextSymbolAspectRatio}&#039;)\n\n        # \u30109\u3011\u8bfb\u53d6\u884c\u95f4\u9699\u56e0\u5b50\n        generalTextLineSpaceFactor = preferences2.AnnotationStyle.LetteringStyle.GeneralTextLineSpaceFactor\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u884c\u95f4\u9699\u56e0\u5b50\uff1a{generalTextLineSpaceFactor}&#039;)\n\n        # \u301010\u3011\u8bfb\u53d6\u6587\u672c\u89d2\u5ea6\n        angle = preferences2.AnnotationStyle.LetteringStyle.Angle\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u6587\u672c\u89d2\u5ea6\uff1a{angle}&#039;)\n\n        # \u301011\u3011\u8bfb\u53d6\u9ad8\u5ea6\u56e0\u5b50\n        gdtFrameHeightFactor = preferences2.AnnotationStyle.LetteringStyle.GdtFrameHeightFactor\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u9ad8\u5ea6\u56e0\u5b50\uff1a{gdtFrameHeightFactor}&#039;)\n\n        # \u301012\u3011\u8bfb\u53d6\u7b26\u53f7\u5b57\u4f53\u6587\u4ef6\n        symbolFontFile = preferences2.AnnotationStyle.LetteringStyle.SymbolFontFile\n        lw.WriteLine(f&#039;\u4fee\u6539\u540e\u7b26\u53f7\u5b57\u4f53\u6587\u4ef6\uff1a{symbolFontFile}&#039;)\n\n        # \u9500\u6bc1\n        preferences2.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763041642603.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 370px; --smush-placeholder-aspect-ratio: 370\/466;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%9B%B4%E7%BA%BF%E7%AE%AD%E5%A4%B4\"><\/span>\u76f4\u7ebf\/\u7bad\u5934<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def line_arrow(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u516c\u5171 - \u76f4\u7ebf\/\u7bad\u5934\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u3010\u4e00\u3011 \u7bad\u5934\n        # \u30101\u3011\u5de5\u4f5c\u6d41\u7a0b - \u81ea\u52a8\u5b9a\u4f4d\n        # preference.AnnotationStyle.DimensionStyle.TextArrowPlacement = Annotations.TextPlacement.Automatic # \u81ea\u52a8\u5b9a\u4f4d\n        preference.AnnotationStyle.DimensionStyle.TextArrowPlacement = Annotations.TextPlacement.ManualArrowsIn # \u624b\u52a8\uff0c\u7bad\u5934\u5411\u5185\n        # preference.AnnotationStyle.DimensionStyle.TextArrowPlacement = Annotations.TextPlacement.ManualArrowsOut # \u624b\u52a8\uff0c\u7bad\u5934\u5411\u5916\n        # preference.AnnotationStyle.DimensionStyle.TextArrowPlacement = Annotations.TextPlacement.ManualArrowsInSameDirection # \u624b\u52a8\uff0c\u7bad\u5934\u540c\u5411\n\n        # \u30102\u3011\u7bad\u5934\u7c7b\u578b\n        arrowType = Annotations.ArrowheadType.FilledArrow\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowType = arrowType # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowType = arrowType # \u7b2c\u4e8c\u4fa7\n\n        # \u30103\u3011\u7bad\u5934\u989c\u8272\n        arrowheadColor = part.Colors.Find(&#039;Red&#039;)\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowheadColor = arrowheadColor # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowheadColor = arrowheadColor # \u7b2c\u4e8c\u4fa7\n\n        # \u30104\u3011 \u7bad\u5934\u6837\u5f0f\n        arrowheadFont = DisplayableObject.ObjectFont.Dotted\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowheadFont = arrowheadFont # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowheadFont = arrowheadFont # \u7b2c\u4e8c\u4fa7\n\n        # \u30105\u3011 \u7bad\u5934\u5bbd\u5ea6\n        arrowheadWidth = Annotations.LineWidth.One # 1-9 \u79cd\u7ebf\u5bbd\u5bf9\u5e94\uff1a\u7528\u6237\u9ed8\u8ba4\u8bbe\u7f6e - \u57fa\u672c\u73af\u5883 - \u7ebf\u5bbd\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowheadWidth = arrowheadWidth # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowheadWidth = arrowheadWidth # \u7b2c\u4e8c\u4fa7\n\n        # \u30106\u3011 \u7bad\u5934\u957f\u5ea6\n        preference.AnnotationStyle.LineArrowStyle.ArrowheadLength = 4.0\n\n        # \u30107\u3011\u7bad\u5934\u89d2\u5ea6\n        preference.AnnotationStyle.LineArrowStyle.ArrowheadIncludedAngle = 30.0\n\n        # \u30108\u3011\u5706\u70b9\u76f4\u5f84\n        preference.AnnotationStyle.LineArrowStyle.DotArrowheadDiameter = 3.0\n\n        # \u30109\u3011\u663e\u793a\u7bad\u5934\/\u7bad\u5934\u7ebf\n        preference.AnnotationStyle.DimensionStyle.DimArrowDisplay = Annotations.ArrowDisplay.Two # \u4e24\u4e2a\u90fd\u663e\u793a\n\n        # \u3010\u4e8c\u3011\u7bad\u5934\u7ebf\n        # \u30101\u3011 \u7bad\u5934\u7ebf\u989c\u8272\n        arrowLineColor = part.Colors.Find(&#039;Blue&#039;)\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowLineColor = arrowLineColor # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowLineColor = arrowLineColor # \u7b2c\u4e8c\u4fa7\n\n        # \u30102\u3011 \u7bad\u5934\u7ebf\u6837\u5f0f\n        arrowLineFont = DisplayableObject.ObjectFont.DottedDashed\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowLineFont = arrowLineFont # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowLineFont = arrowLineFont # \u7b2c\u4e8c\u4fa7\n\n        # \u30103\u3011 \u7bad\u5934\u7ebf\u5bbd\u5ea6\n        arrowLineWidth = Annotations.LineWidth.Three\n        preference.AnnotationStyle.LineArrowStyle.FirstArrowLineWidth = arrowLineWidth # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondArrowLineWidth = arrowLineWidth # \u7b2c\u4e8c\u4fa7\n\n        # \u30104\u3011\u6587\u672c\u4e0e\u7ebf\u7684\u95f4\u9699\n        preference.AnnotationStyle.LineArrowStyle.TextToLineDistance = 2.0\n\n        # \u30105\u3011\u526a\u5207\u5750\u6807\u5c3a\u5bf8\u7ebf\n        preference.AnnotationStyle.LineArrowStyle.ClipOrdinateDimensionLine = True\n\n        # \u30106\u3011\u77ed\u5212\u7ebf\u957f\u5ea6\n        preference.AnnotationStyle.LineArrowStyle.StubLength = 0.15\n\n        # \u30107\u3011\u77ed\u5212\u7ebf\u4e0a\u6587\u672c\u95f4\u9699\u56e0\u5b50\n        preference.AnnotationStyle.LineArrowStyle.TextOverStubFactor = 0.22\n\n        # \u30108\u3011\u77ed\u5212\u7ebf\u663e\u793a\u7b26\u53f7\n        preference.AnnotationStyle.LineArrowStyle.StubSymbolType = Annotations.StubSymbolType.AllAround\n\n        # \u30109\u3011\u5168\u5706\u7b26\u53f7\u5927\u5c0f\n        preference.AnnotationStyle.LineArrowStyle.AllAroundSymbolSize = 3.3\n\n        # \u301010\u3011\u6307\u5f15\u7ebf\u7ad6\u76f4\u5bf9\u9f50\n        preference.AnnotationStyle.LineArrowStyle.LeaderLocation = Annotations.VerticalTextJustification.Bottom\n\n        # \u301011\u3011\u6307\u5f15\u7ebf\u4e0a\u6587\u672c\u95f4\u9699\u56e0\u5b50\n        preference.AnnotationStyle.LineArrowStyle.TextOverLeaderGapFactor = 0.45\n\n        # \u3010\u4e09\u3011\u5ef6\u4f38\u7ebf\n        # \u30101\u3011\u663e\u793a\u5ef6\u4f38\u7ebf\n        preference.AnnotationStyle.DimensionStyle.ExtensionLineDisplay = Annotations.ExtensionLineDisplay.NotSet # \u90fd\u4e0d\u663e\u793a\n\n        # \u30102\u3011\u5ef6\u4f38\u7ebf\u989c\u8272\n        extensionLineColor = part.Colors.Find(&#039;Green&#039;)\n        preference.AnnotationStyle.LineArrowStyle.FirstExtensionLineColor = extensionLineColor # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondExtensionLineColor = extensionLineColor # \u7b2c\u4e8c\u4fa7\n\n        # \u30103\u3011\u5ef6\u4f38\u7ebf\u6837\u5f0f\n        extensionLineFont = DisplayableObject.ObjectFont.DottedDashed\n        preference.AnnotationStyle.LineArrowStyle.FirstExtensionLineFont = extensionLineFont # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondExtensionLineFont = extensionLineFont # \u7b2c\u4e8c\u4fa7\n\n        # \u30104\u3011\u5ef6\u4f38\u7ebf\u5bbd\u5ea6\n        extensionLineWidth = Annotations.LineWidth.Eight\n        preference.AnnotationStyle.LineArrowStyle.FirstExtensionLineWidth = extensionLineWidth # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondExtensionLineWidth = extensionLineWidth # \u7b2c\u4e8c\u4fa7\n\n        # \u30105\u3011\u5ef6\u4f38\u7ebf\u95f4\u9699\n        posToExtensionLineDistance = 0.11\n        preference.AnnotationStyle.LineArrowStyle.FirstPosToExtensionLineDistance = posToExtensionLineDistance # \u7b2c\u4e00\u4fa7\n        preference.AnnotationStyle.LineArrowStyle.SecondPosToExtensionLineDistance = posToExtensionLineDistance # \u7b2c\u4e8c\u4fa7\n\n        # \u30106\u3011\u5ef6\u4f38\u7ebf\u5ef6\u5c55\n        preference.AnnotationStyle.LineArrowStyle.LinePastArrowDistance = 33.0\n\n        # \u30107\u3011\u5ef6\u4f38\u7ebf\u89d2\u5ea6\n        preference.AnnotationStyle.LineArrowStyle.ObliqueExtensionLineAngle = 45.0\n\n        # \u30108\u3011\u6307\u5f15\u7ebf\u9644\u7740\u5ef6\u4f38\n        preference.AnnotationStyle.LineArrowStyle.DatumLengthPastArrow = 55.0\n\n        # \u3010\u56db\u3011\u65ad\u5f00\n        # \u30101\u3011\u521b\u5efa\u65ad\u5f00\n        preference.AnnotationStyle.BreakSettings.CreateBreaks = True\n\n        # \u30102\u3011\u65ad\u5f00\u5927\u5c0f\n        preference.AnnotationStyle.BreakSettings.BreakSize = 1.0\n\n        # \u3010\u4e94\u3011\u900f\u89c6\u7f29\u77ed\u7b26\u53f7\n        # \u30101\u3011\u7c7b\u578b\n        preference.AnnotationStyle.ForeshorteningSymbolSettings.ForeshorteningSymbolType = Annotations.ForeshorteningSymbolSettingsBuilder.SymbolType.Regular\n\n        # \u30102\u3011\u65b9\u6cd5\n        preference.AnnotationStyle.ForeshorteningSymbolSettings.ForeshorteningSymbolMethodType = Annotations.ForeshorteningSymbolSettingsBuilder.MethodType.WidthAndAngle\n\n        # \u30103\u3011\u5bbd\u5ea6\n        preference.AnnotationStyle.ForeshorteningSymbolSettings.Width = 1.1\n\n        # \u30104\u3011\u9ad8\u5ea6\n        preference.AnnotationStyle.ForeshorteningSymbolSettings.Height = 2.2\n\n        # \u30105\u3011\u89d2\u5ea6\n        preference.AnnotationStyle.ForeshorteningSymbolSettings.Angle = 45.0\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763131133617.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 595px; --smush-placeholder-aspect-ratio: 595\/595;\" \/><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763134305538.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 597px; --smush-placeholder-aspect-ratio: 597\/587;\" \/><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763181622255.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 595px; --smush-placeholder-aspect-ratio: 595\/585;\" \/><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763193225926.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 590px; --smush-placeholder-aspect-ratio: 590\/581;\" \/><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763193235423.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 591px; --smush-placeholder-aspect-ratio: 591\/570;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E7%82%B9\"><\/span>\u539f\u70b9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def origin(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u516c\u5171 - \u539f\u70b9\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u7b2c\u4e00\u504f\u7f6e\n        preference.AnnotationStyle.OrdinateStyle.MarginFirstOffset = 1.1\n\n        # \u30102\u3011\u95f4\u8ddd\n        preference.AnnotationStyle.OrdinateStyle.MarginSpacing = 2.2\n\n        # \u30103\u3011\u5168\u5c40\u9009\u62e9\u4e2d\u52a8\u6001\u5bf9\u9f50\n        preference.CommonWorkflow.DynamicAlignmentInGlobalSelection = True\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763194003885.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 596px; --smush-placeholder-aspect-ratio: 596\/593;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%89%8D%E7%BC%80%E5%90%8E%E7%BC%80%EF%BC%88%E4%B8%8D%E5%AE%8C%E5%96%84%EF%BC%89\"><\/span>\u524d\u7f00\/\u540e\u7f00\uff08\u4e0d\u5b8c\u5584\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def origin(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u516c\u5171 - \u539f\u70b9\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u3010\u4e00\u3011\u534a\u5f84\u5c3a\u5bf8\n        # \u30101\u3011\u4f4d\u7f6e\n        preference.AnnotationStyle.RadialStyle.DiameterRadiusPlacement = Annotations.DiameterRadiusSymbolPlacement.Before\n\n        # \u30102\u3011\u76f4\u5f84\u7b26\u53f7\n        preference.AnnotationStyle.RadialStyle.DiameterSymbolType = Annotations.DiameterSymbol.Standard\n\n        # \u30103\u3011\u534a\u5f84\u7b26\u53f7\n        preference.AnnotationStyle.RadialStyle.RadiusSymbolType = Annotations.RadiusSymbol.R\n\n        # \u30104\u3011\u6587\u672c\u95f4\u9699\n        preference.AnnotationStyle.RadialStyle.SymbolToDimensionTextDistance = 2.2\n\n        # \u3010\u4e8c\u3011\u7ebf\u6027\u5c3a\u5bf8\n        # \u30101\u3011\u771f\u5b9e\u957f\u5ea6\u4f4d\u7f6e\n        preference.AnnotationStyle.DimensionStyle.TrueLengthTextPosition = Annotations.TrueLengthTextPosition.Prefix\n\n        # \u30102\u3011\u6587\u672c\n        preference.AnnotationStyle.DimensionStyle.TrueLengthText = &#039;T.L.&#039;\n\n        # \u3010\u4e09\u3011\u5012\u659c\u89d2\u5c3a\u5bf8\n        # \u30101\u3011\u4f4d\u7f6e\n        preference.AnnotationStyle.DimensionStyle.ChamferSymbolType = Annotations.ChamferSymbolPlacement.Prefix\n\n        # \u30102\u3011\u6587\u672c\n        preference.AnnotationStyle.DimensionStyle.ChamferSymbolName = &#039;AAA&#039;\n\n        # \u3010\u56db\u3011\u5b54\u548c\u87ba\u7eb9\u6807\u6ce8\n        # \u7279\u5f81\n        featureTypes = preference.AnnotationStyle.HoleCalloutSettings.GetListOfFeatures()\n        # \u904d\u5386\u7279\u5f81\n        text = &#039;&#039;\n        for featureType in featureTypes:\n            # \u83b7\u53d6\u5bf9\u5e94\u7279\u5f81\u7684\u53c2\u6570\n            parameters = preference.AnnotationStyle.HoleCalloutSettings.GetListOfParameters(featureType)\n            # \u83b7\u53d6\u7279\u5f81\u540d\n            featureTypeName = getEnumName(Annotations.HoleCalloutSettingsBuilder.Featuretype, featureType)\n            for nth, parameter in enumerate(parameters):\n                # \u83b7\u53d6\u53c2\u6570\u540d\n                parameterName = getEnumName(Annotations.HoleCalloutSettingsBuilder.Parametertype, parameter)\n                # 2025\/11\/16 \u65e0\u6cd5\u89e3\u51b3\uff0c\u6211\u5df2\u7ecf\u6298\u817e\u4e86\u597d\u51e0\u4e2a\u5c0f\u65f6\uff0c\u65e0\u6cd5\u641e\u5b9a\n                # nth \u8868\u793a\u67d0\u4e2a\u7279\u5f81\u7684\u7b2c nth \u4e2a\u53c2\u6570\uff0c\u4f46\u662f\u53c2\u6570\u5217\u8868\u83b7\u53d6\u5230\u7684\u53c2\u6570\u4e2d\u6709\u4e9b\u4e0d\u80fd\u8bfb\u53d6\uff08\u6216\u5199\u5165\uff09\u524d\u7f00\u6216\u540e\u7f00\uff0c\u76f4\u63a5\u8bfb\u53d6\u4f1a\u51fa\u73b0 C++ \u5c42\u9762\u7684\u5f02\u5e38\uff0cPython \u65e0\u6cd5\u6355\u83b7\uff0c\u4f1a\u5bfc\u81f4 NX \u5d29\u6e83\n\n        # \u3010\u4e94\u3011\u8868\u5355\u5143\u683c\n        # \u30101\u3011\u524d\u7f00\n        preference.TableCellStyle.Prefix = &#039;pp&#039;\n\n        # \u30102\u3011\u540e\u7f00\n        preference.TableCellStyle.Suffix = &#039;uu&#039;\n\n        # \u3010\u516d\u3011\u96f6\u4ef6\u660e\u7ec6\u8868\n        # \u30101\u3011\u663e\u793a\u53c2\u8003\u6807\u6ce8\u540e\u7f00\n        preference.PartsList.ShowReferenceCalloutSuffix = True\n\n        # \u30102\u3011\u6587\u672c\n        preference.PartsList.CalloutSuffix = &#039;(REF)&#039;\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763298445866.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 597px; --smush-placeholder-aspect-ratio: 597\/590;\" \/><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763298456495.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 399px; --smush-placeholder-aspect-ratio: 399\/196;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BF%9D%E7%95%99%E7%9A%84%E6%B3%A8%E9%87%8A\"><\/span>\u4fdd\u7559\u7684\u6ce8\u91ca<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def retainedAnnotations(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u4fdd\u7559\u7684\u6ce8\u91ca\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u663e\u793a\u4fdd\u7559\u7684\u6ce8\u91ca\n        preference.RetainedAnnotations.ShowRetainedAnnotations = False\n\n        # \u30102\u3011\u989c\u8272\n        preference.RetainedAnnotations.LineColorFontWidth.LineColor = part.Colors.Find(&#039;Yellow&#039;)\n\n        # \u30103\u3011\u7ebf\u578b\n        preference.RetainedAnnotations.LineColorFontWidth.LineFont.LineFont = LineFontBuilder.LineFontType.Dotted\n\n        # \u30104\u3011\u7ebf\u5bbd\n        preference.RetainedAnnotations.LineColorFontWidth.LineWidth = DisplayableObject.ObjectWidth.Five\n\n        # \u30105\u3011\u5220\u9664\u4fdd\u7559\u7684\u6ce8\u91ca\n        part.DeleteRetainedDraftingObjectsInCurrentLayout()\n\n        # \u30106\u3011\u5e94\u7528\u975e\u5173\u8054\u539f\u70b9\n        preference.RetainedAnnotations.ApplyNonAssociativeOrigins()\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763303122965.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 599px; --smush-placeholder-aspect-ratio: 599\/584;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B1%82%E5%8F%A0\"><\/span>\u5c42\u53e0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def stack(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5c42\u53e0\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u6c34\u5e73\u5bf9\u9f50\n        preference.AnnotationStyle.LetteringStyle.StackHorizontalAlignment = Annotations.StackHorizontalAlignment.Bottom\n\n        # \u30102\u3011\u524d\u95f4\u9699\u56e0\u5b50\n        preference.AnnotationStyle.LetteringStyle.StackLeftSpaceFactor = 0.555\n\n        # \u30103\u3011\u540e\u95f4\u9699\u56e0\u5b50\n        preference.AnnotationStyle.LetteringStyle.StackRightSpaceFactor = 0.666\n\n        # \u30104\u3011\u7ad6\u76f4\u5bf9\u9f50\n        preference.AnnotationStyle.LetteringStyle.StackVerticalAlignment = Annotations.StackVerticalAlignment.Right\n\n        # \u30105\u3011\u4e0a\u95f4\u9699\u56e0\u5b50\n        preference.AnnotationStyle.LetteringStyle.StackAboveSpaceFactor = 0.777\n\n        # \u30106\u3011\u4e0b\u95f4\u9699\u56e0\u5b50\n        preference.AnnotationStyle.LetteringStyle.StackBelowSpaceFactor = 0.888\n\n        # \u30107\u3011\u81ea\u52a8\u95f4\u8ddd\u5806\u53e0\u7b26\u53f7\n        preference.AnnotationStyle.LetteringStyle.StackAutospace = False\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763353568047.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 599px; --smush-placeholder-aspect-ratio: 599\/586;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%A0%87%E5%87%86\"><\/span>\u6807\u51c6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def standard(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u6807\u51c6\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u56fe\u7eb8\u9875\u8fb9\u754c\n        # 2025\/11\/17 \u6211\u6ca1\u627e\u5230\u679a\u4e3e\u5b9a\u4e49\uff0c\u4e0d\u5f97\u4e0d\u7528\u9b54\u6cd5\u503c\u4e86\uff0c\u4e0d\u5c1d\u8bd5\u90fd\u4e0d\u77e5\u9053\u6570\u503c\u4ec0\u4e48\u542b\u4e49\n        # 0 ASME\uff1b1 ISO\uff1b2 DIN\uff1b3 JIS\uff1b4 ESKD\uff1b5 GB\uff1b6 \u8239\u8236\u8bbe\u8ba1\n        preference.BorderAndZoneStyle.BorderAndZoneStandard = 6\n\n        # \u30102\u3011\u8868\u9762\u7c97\u7cd9\u5ea6\uff08\u542b\u7248\u672c\uff09\n        preference.AnnotationStyle.SymbolStyle.DraftingSurfaceFinishStandard = Annotations.SurfaceFinishStandard.Iso25178\n\n        # \u30103\u3011\u710a\u63a5\n        preference.AnnotationStyle.SymbolStyle.WeldSymbolStandard = Annotations.WeldStandard.Gb\n\n        preference.Commit()\n        preference.Destroy() <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763386121732.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 594px; --smush-placeholder-aspect-ratio: 594\/581;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%AC%A6%E5%8F%B7\"><\/span>\u7b26\u53f7<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def symbolStyle(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u7b26\u53f7\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u989c\u8272\n        preference.AnnotationStyle.SymbolStyle.UserDefinedSymbolColor = part.Colors.Find(&#039;Purple&#039;)\n\n        # \u30102\u3011\u7ebf\u578b\n        preference.AnnotationStyle.SymbolStyle.UserDefinedSymbolFont = DisplayableObject.ObjectFont.Eight\n\n        # \u30103\u3011 \u7ebf\u5bbd\n        preference.AnnotationStyle.SymbolStyle.UserDefinedSymbolWidth = Annotations.LineWidth.Six\n\n        preference.Commit()\n        preference.Destroy()   <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763388037352.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 593px; --smush-placeholder-aspect-ratio: 593\/591;\" \/><\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E5%B0%BA%E5%AF%B8\"><\/span>\u5c3a\u5bf8<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B\"><\/span>\u5de5\u4f5c\u6d41\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def dimensionWorkflow(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5c3a\u5bf8\u5de5\u4f5c\u6d41\u7a0b\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u5b9a\u5411\u5c3a\u5bf8\n        preference.DimensionWorkflow.EnableDirectedDimension = True\n\n        # \u30102\u3011\u6682\u505c\u5c4f\u663e\u5bf9\u8bdd\u6846\u5ef6\u8fdf\n        preference.DimensionWorkflow.HoverSceneDialogDelay = 2\n\n        # \u30102\u3011\u81ea\u52a8\u521b\u5efa\u76f8\u4ea4\u7b26\u53f7\n        preference.DimensionWorkflow.AutomaticCreationIntersectionSymbol = True\n\n        preference.Commit()\n        preference.Destroy()   <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763477912006.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 603px; --smush-placeholder-aspect-ratio: 603\/589;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E7%82%B9-2\"><\/span>\u539f\u70b9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def dimensionOriginAlignment(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5c3a\u5bf8\u539f\u70b9\u5bf9\u9f50\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u81ea\u52a8\u5bf9\u9f50\n        preference.DimensionOriginAlignment.AutoAlignment = Annotations.OriginAlignmentBuilder.AutoAlignmentType.NonAssociative\n\n        # \u30102\u3011\u4e0e\u5c3a\u5bf8\u7ebf\u5bf9\u9f50\n        preference.DimensionOriginAlignment.AlignToDimensionLine = False\n\n        # \u30103\u3011\u5806\u53e0\u6ce8\u91ca\n        preference.DimensionOriginAlignment.StackAnnotation = True\n\n        # \u30104\u3011\u6c34\u5e73\u6216\u7ad6\u76f4\u5bf9\u9f50\n        preference.DimensionOriginAlignment.AlignHorizontalVertical = True\n\n        # \u30105\u3011\u76f8\u5bf9\u4e8e\u51e0\u4f55\u4f53\u7684\u4f4d\u7f6e\n        preference.DimensionOriginAlignment.PositionRelativeToGeom = True\n\n        # \u30106\u3011\u6355\u6349\u70b9\u5904\u7684\u4f4d\u7f6e\n        preference.DimensionOriginAlignment.PositionAtSnapPoint = True\n\n        # \u30107\u3011\u7a7a\u767d\u5904\u7684\u4f4d\u7f6e\n        preference.DimensionOriginAlignment.PositionOnMargin = False\n\n        preference.Commit()\n        preference.Destroy()  <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763478362497.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 597px; --smush-placeholder-aspect-ratio: 597\/587;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%85%AC%E5%B7%AE%EF%BC%88%E7%A9%BA%EF%BC%89\"><\/span>\u516c\u5dee\uff08\u7a7a\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8F%8C%E5%B0%BA%E5%AF%B8\"><\/span>\u53cc\u5c3a\u5bf8<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def dualDimension(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u53cc\u5c3a\u5bf8\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u30101\u3011\u53cc\u5c3a\u5bf8\u4f4d\u7f6e\n        preference.AnnotationStyle.UnitsStyle.DualDimensionFormat = Annotations.DualDimensionPlacement.NotSet # \u4e0d\u52fe\u9009\u663e\u793a\u53cc\u5c3a\u5bf8\n\n        # \u30102\u3011\u5355\u4f4d\n        preference.AnnotationStyle.UnitsStyle.DualDimensionUnits = Annotations.DimensionUnit.Micrometers\n\n        # \u30103\u3011\u6570\u5b57\u663e\u793a\n        preference.AnnotationStyle.UnitsStyle.DualFractionType = Annotations.DimensionTextFormat.Decimal\n\n        # \u30104\u3011\u5c0f\u6570\u4f4d\u6570\n        preference.AnnotationStyle.DimensionStyle.DualDimensionValuePrecision = 4\n\n        # \u30105\u3011\u5206\u6570\u5206\u6bcd\n        preference.AnnotationStyle.DimensionStyle.DualDimensionFractionDenominator = Annotations.FractionDenominatorFormat.ThirtyTwo\n\n        # \u30106\u3011\u5c3a\u5bf8\u7ebf\u5c45\u4e2d\n        preference.AnnotationStyle.UnitsStyle.DualDimensionCenterDimensionLine = True\n\n        # \u30107\u3011\u516c\u5dee\u5c0f\u6570\u4f4d\u6570\n        preference.AnnotationStyle.DimensionStyle.DualToleranceValuePrecision = 3\n\n        # \u30108\u3011\u516c\u5dee\u4e0a\u9650\n        preference.AnnotationStyle.DimensionStyle.UpperToleranceMetric = 0.11\n\n        # \u30109\u3011\u516c\u5dee\u4e0b\u9650\n        preference.AnnotationStyle.DimensionStyle.LowerToleranceMetric = -0.12\n\n        # \u301010\u3011\u5355\u9650\u5236\u504f\u7f6e\n        preference.AnnotationStyle.DimensionStyle.SingleLimitOffsetValueMetric = 0.13\n\n        preference.Commit()\n        preference.Destroy()    <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763479350773.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 601px; --smush-placeholder-aspect-ratio: 601\/592;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%8A%98%E7%BA%BF\"><\/span>\u6298\u7ebf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def ordinateStyle(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5750\u6807\u6807\u6ce8\u6837\u5f0f\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u6837\u5f0f\n        preference.AnnotationStyle.OrdinateStyle.DoglegCreationOption = Annotations.OrdinateDoglegCreationOption.Infer\n\n        # \u65b9\u6cd5\n        preference.AnnotationStyle.OrdinateStyle.DoglegSetting = Annotations.OrdinateDoglegDefinition.StartAngle\n\n        # \u5f00\u59cb\u504f\u7f6e\n        preference.AnnotationStyle.OrdinateStyle.DoglegStartOffset = 6.0\n\n        # \u7ed3\u675f\u504f\u7f6e\n        preference.AnnotationStyle.OrdinateStyle.DoglegEndOffset = 3.0\n\n        # \u89d2\u5ea6\n        preference.AnnotationStyle.OrdinateStyle.DoglegAngle = 44 * math.pi \/ 180 # \u5f27\u5ea6\n\n        # \u7b2c\u4e00\u4fa7\u65b9\u4f4d\n        preference.AnnotationStyle.LineArrowStyle.FirstJogOrientation = Annotations.JogOrientation.JogIn\n\n        # \u7b2c\u4e00\u4fa7\u5f00\u59cb\u504f\u7f6e\n        preference.AnnotationStyle.LineArrowStyle.FirstJogStartOffset = 6.0\n\n        # \u7b2c\u4e00\u4fa7\u7ed3\u675f\u504f\u7f6e\n        preference.AnnotationStyle.LineArrowStyle.FirstJogEndOffset = 3.0\n\n        # \u7b2c\u4e00\u4fa7\u89d2\u5ea6\n        preference.AnnotationStyle.LineArrowStyle.FirstJogAngle = 44.0 # \u89d2\u5ea6\n\n        # \u7b2c\u4e8c\u4fa7\u65b9\u4f4d\n        preference.AnnotationStyle.LineArrowStyle.SecondJogOrientation = Annotations.JogOrientation.JogIn\n\n        # \u7b2c\u4e8c\u4fa7\u5f00\u59cb\u504f\u7f6e\n        preference.AnnotationStyle.LineArrowStyle.SecondJogStartOffset = 6.0\n\n        # \u7b2c\u4e8c\u4fa7\u7ed3\u675f\u504f\u7f6e\n        preference.AnnotationStyle.LineArrowStyle.SecondJogEndOffset = 3.0\n\n        # \u7b2c\u4e8c\u4fa7\u89d2\u5ea6\n        preference.AnnotationStyle.LineArrowStyle.SecondJogAngle = 44.0 # \u89d2\u5ea6\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763561626214.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 598px; --smush-placeholder-aspect-ratio: 598\/587;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%AA%84%E5%B0%BA%E5%AF%B8\"><\/span>\u7a84\u5c3a\u5bf8<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def narrowDimension(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u7a84\u5c3a\u5bf8\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u6837\u5f0f\n        preference.AnnotationStyle.DimensionStyle.NarrowDisplayType = Annotations.NarrowDisplayOption.AfterStub\n\n        # \u6587\u672c\u65b9\u4f4d\n        preference.AnnotationStyle.DimensionStyle.NarrowTextOrientation = Annotations.NarrowTextOrientation.Horizontal\n\n        # \u7bad\u5934\n        preference.AnnotationStyle.DimensionStyle.NarrowArrowType = Annotations.ArrowheadType.FilledDot\n\n        # \u6587\u672c\u504f\u7f6e\n        preference.AnnotationStyle.DimensionStyle.NarrowTextOffset = 11.0\n\n        # \u6307\u5f15\u7ebf\u89d2\u5ea6\n        preference.AnnotationStyle.DimensionStyle.NarrowLeaderAngle = 70.0\n\n        preference.Commit()\n        preference.Destroy()  <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763562455594.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 595px; --smush-placeholder-aspect-ratio: 595\/578;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8D%95%E4%BE%A7%E5%B0%BA%E5%AF%B8\"><\/span>\u5355\u4fa7\u5c3a\u5bf8<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def singleSideDimension(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5355\u4fa7\u5c3a\u5bf8\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u957f\u5ea6\n        preference.AnnotationStyle.SingleSidedDisplay.SingleSidedArrowLineLength = 11.1\n\n        preference.Commit()\n        preference.Destroy()  <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763562683622.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 603px; --smush-placeholder-aspect-ratio: 603\/591;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B0%BA%E5%AF%B8%E9%9B%86\"><\/span>\u5c3a\u5bf8\u96c6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def dimensionSets(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5c3a\u5bf8\u96c6\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u94fe\n        preference.AnnotationStyle.DimensionStyle.ChainOffset = 3.3\n\n        # \u57fa\u7ebf\n        preference.AnnotationStyle.DimensionStyle.BaselineOffset = 12.4\n\n        preference.Commit()\n        preference.Destroy()    <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1763562932934.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 601px; --smush-placeholder-aspect-ratio: 601\/589;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%80%92%E6%96%9C%E8%A7%92\"><\/span>\u5012\u659c\u89d2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def chamfer(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5012\u89d2\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u6837\u5f0f\n        preference.AnnotationStyle.DimensionStyle.ChamferForm = Annotations.ChamferForm.AngleSize\n\n        # \u5206\u9694\u7ebf\n        preference.AnnotationStyle.DimensionStyle.ChamferSeparator = Annotations.ChamferSeparatorType.LowercaseX\n\n        # \u95f4\u8ddd\n        preference.AnnotationStyle.DimensionStyle.ChamferSpaceFactor = 0.11\n\n        # \u6307\u5f15\u7ebf\u6837\u5f0f\n        preference.AnnotationStyle.DimensionStyle.ChamferLeaderType = Annotations.ChamferLeaderPlacement.Linear\n\n        # \u6587\u672c\u5bf9\u9f50\n        preference.AnnotationStyle.DimensionStyle.ChamferStubType = Annotations.ChamferStubType.NoneTextAfterLeader\n\n        preference.Commit()\n        preference.Destroy()  <\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1764685207993.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 601px; --smush-placeholder-aspect-ratio: 601\/591;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%B0%BA%E5%AF%B8%E7%BA%BF\"><\/span>\u5c3a\u5bf8\u7ebf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def dimensionLine(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5c3a\u5bf8\u7ebf\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u7bad\u5934\u4e4b\u95f4\u6709\u7ebf\n        preference.AnnotationStyle.DimensionStyle.LineBetweenArrows = False\n\n        # \u4fee\u526a\u5c3a\u5bf8\u7ebf\n        preference.AnnotationStyle.DimensionStyle.TrimDimLine = Annotations.TrimDimensionLineStyle.Trim\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1764686535699.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 599px; --smush-placeholder-aspect-ratio: 599\/591;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%BE%84%E5%90%91\"><\/span>\u5f84\u5411<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def radiaStyle(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5f84\u5411\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u5e26\u6298\u7ebf\u534a\u5f84\u5c3a\u5bf8\u7684\u89d2\u5ea6\n        preference.AnnotationStyle.RadialStyle.FoldedRadiusAngle = 44.0\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1764686768155.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 603px; --smush-placeholder-aspect-ratio: 603\/594;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%9D%90%E6%A0%87\"><\/span>\u5750\u6807<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-python\">class DraftingPreferencesTest:\n    &quot;&quot;&quot;\n    \u5236\u56fe\u9996\u9009\u9879\u6d4b\u8bd5\u7c7b\n    &quot;&quot;&quot;\n    @staticmethod\n    def ordinateStyle(part: NXOpen.Part, lw: NXOpen.ListingWindow):\n        &quot;&quot;&quot;\n        \u5750\u6807\n        &quot;&quot;&quot;\n        preference = getPartDraftingPreferences(part)\n\n        # \u6b63\u65b9\u5411\n        preference.AnnotationStyle.OrdinateStyle.PositiveDirection = Annotations.OrdinatePositiveDirection.LowerLeft\n\n        # \u663e\u793a\u5c3a\u5bf8\u7ebf\n        preference.AnnotationStyle.OrdinateStyle.DisplayDimensionLine = Annotations.OrdinateLineArrowDisplayOption.NotSet\n\n        # \u5728\u57fa\u51c6\u7ebf\u5904\u663e\u793a\u96f6\n        preference.AnnotationStyle.OrdinateStyle.DisplayZeroAtBaseline = False\n\n        # \u663e\u793a\u540d\u79f0\u6837\u5f0f\n        preference.AnnotationStyle.OrdinateStyle.DisplayNameStyle = Annotations.OrdinateOriginDisplayOption.OrdinateSetName\n\n        # \u7528\u6237\u5b9a\u4e49\u6587\u672c\n        preference.AnnotationStyle.OrdinateStyle.UserDefinedText = &#039;\u81ea\u5b9a\u4e49\u6587\u672c&#039;\n\n        # \u4e0e\u57fa\u51c6\u7ebf\u5bf9\u9f50\n        preference.AnnotationStyle.OrdinateStyle.AlignSymbolWithBaseline = False\n\n        # \u7b26\u53f7\u89d2\u5ea6\n        preference.AnnotationStyle.OrdinateStyle.SymbolAngle = 45 \/ 180 * math.pi\n\n        # \u8fb9\u8ddd\u6570\n        preference.AnnotationStyle.OrdinateStyle.NumberOfMargins = 1\n\n        preference.Commit()\n        preference.Destroy()<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/11\/image-1764687855880.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 597px; --smush-placeholder-aspect-ratio: 597\/589;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 2025\/11\/12 \u6211\u7814\u7a76\u5236\u56fe\u9996\u9009\u9879\u901a\u8fc7\u7f16\u7a0b\u8bbe\u7f6e\u7684\u76ee\u7684\u662f\uff1a\u5b9e\u73b0\u5c06\u4e00\u4e2a\u6a21\u677f\u7684\u5236\u56fe\u9996\u9009\u9879\u590d\u5236\u7ed9\u53e6\u5916\u4e00\u4e2a\u90e8\u4ef6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":null,"zakra_menu_item_active_color":null,"zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,618,592,617],"tags":[1829,909,1297,1874,1802,1825],"class_list":["post-22732","post","type-post","status-publish","format-standard","hentry","category-all","category-cad-cam","category-python","category-siemens-nx","tag-journal","tag-python","tag-siemens-nx","tag-1874","tag-1802","tag-1825"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/22732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22732"}],"version-history":[{"count":31,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/22732\/revisions"}],"predecessor-version":[{"id":24047,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/22732\/revisions\/24047"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}