{"id":414333,"date":"2024-06-29T23:41:48","date_gmt":"2024-06-29T23:41:48","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=414333"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T23:41:48","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=414333","title":{"rendered":"<span>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python \u0432\u00a0\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 nanoCAD 23<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 23-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b nanoCAD \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>PY<\/strong> \u0438 <strong>-PY<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python.<\/p>\n<p>?  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>PY<\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>?  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>-PY<\/strong> \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0440\u0435\u0434\u044b<\/h3>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Python \u043d\u0430 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 nanoCAD \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Python 3 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Python.AXScript.2 (Active Scripting). \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0432 \u0440\u0430\u0431\u043e\u0442\u0435, \u043d\u0443\u0436\u043d\u043e, \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044f \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438.<\/p>\n<p>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Python 3. <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: www.python.org\/downloads\/windows (\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 3.10.4).<\/p>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em><\/strong> <em>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 Python \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PATH \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435<\/em> <strong><em>Add Python 3.10 to PATH<\/em><\/strong> (\u0440\u0438\u0441. 1).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/abf\/8e3\/cd4\/abf8e3cd42950d2ddc30e81869e27682.png\" alt=\"\u0420\u0438\u0441. 1\" title=\"\u0420\u0438\u0441. 1\" width=\"974\" height=\"600\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/abf\/8e3\/cd4\/abf8e3cd42950d2ddc30e81869e27682.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 1<\/figcaption><\/div>\n<\/figure>\n<p>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Active Scripting \u0434\u043b\u044f Python.<\/p>\n<p>\u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Python Win32 extentions \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Python Active Scripting (win32com.axscript) \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Python \u043f\u0443\u0442\u044c \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PATH, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <\/p>\n<p><code>python -m pip install --upgrade pywin32<\/code><\/p>\n<p>\u0438\u043b\u0438<\/p>\n<p><code>pip install pywin32 --upgrade<\/code><\/p>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. <\/em><\/strong><em>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u041c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u00bb) \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f:<\/em><\/p>\n<p><code>python Scripts\/pywin32_postinstall.py -install<\/code><\/p>\n<p>\u041f\u0440\u0438\u00a0\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 nanoCAD \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u00a0\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u00abPython.AXScript.2\u00bb \u0432\u00a0\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435\u00a0\u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430, \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u0438\u00a0\u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442 \u043e\u00a0\u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 Python \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0432\u0438\u0434\u0430 \u00abUnable to create scripting engine for \u201ePython.AXScript.2\u201c\u00bb.<\/p>\n<h3>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Python<\/h3>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<ul>\n<li>\n<p>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 nanoCAD 23;<\/p>\n<\/li>\n<li>\n<p>Python for Windows 3.10.4;<\/p>\n<\/li>\n<li>\n<p>Pywin32 \u2013 Release 304.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 nanoCAD \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>PY<\/strong> (\u0440\u0438\u0441. 2) \u0438 <strong>-PY<\/strong> \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/974\/1c5\/459\/9741c545956093d3cb4da0a575a144bc.png\" alt=\"\u0420\u0438\u0441. 2\" title=\"\u0420\u0438\u0441. 2\" width=\"613\" height=\"381\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/974\/1c5\/459\/9741c545956093d3cb4da0a575a144bc.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 2<\/figcaption><\/div>\n<\/figure>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 MyPythonScript.py:<\/p>\n<pre><code>doc = ThisDrawing;  ut = doc.Utility;  ut.Prompt(\"\u041f\u0440\u0438\u0432\u0435\u0442, Python \u0432 nanoCAD!\"); <\/code><\/pre>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em><\/strong><em> \u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Python \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 SDK.<\/em><\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0440\u0438\u0441. 3.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/537\/bc0\/e7b\/537bc0e7bb92c118986b03c307dd1213.png\" alt=\"\u0420\u0438\u0441. 3\" title=\"\u0420\u0438\u0441. 3\" width=\"727\" height=\"217\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/537\/bc0\/e7b\/537bc0e7bb92c118986b03c307dd1213.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 3<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>-PY <\/strong>\u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 MyPythonScript.py \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0430 \u0440\u0438\u0441.\u00a04, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2013 \u043d\u0430 \u0440\u0438\u0441.\u00a05.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4d2\/517\/403\/4d251740388e0051eb4c5bd51a6655f8.png\" alt=\"\u0420\u0438\u0441. 4\" title=\"\u0420\u0438\u0441. 4\" width=\"630\" height=\"367\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4d2\/517\/403\/4d251740388e0051eb4c5bd51a6655f8.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c10\/2bf\/7c1\/c102bf7c170d52e2e50bdfed6264a9b6.png\" alt=\"\u0420\u0438\u0441. 5\" title=\"\u0420\u0438\u0441. 5\" width=\"869\" height=\"217\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c10\/2bf\/7c1\/c102bf7c170d52e2e50bdfed6264a9b6.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 5<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 nanoCAD: <em>\u0421\u0435\u0440\u0432\u0438\u0441<\/em> \u2192\u00a0 <em>\u0421\u043a\u0440\u0438\u043f\u0442\u044b<\/em> \u2192\u00a0 <em>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/em> (\u0440\u0438\u0441. 6).<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77d\/648\/afd\/77d648afd0ee65349d0865483110a08a.png\" alt=\"\u0420\u0438\u0441. 6\" title=\"\u0420\u0438\u0441. 6\" width=\"786\" height=\"411\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/77d\/648\/afd\/77d648afd0ee65349d0865483110a08a.png\"\/><\/p>\n<div><figcaption>\u0420\u0438\u0441. 6<\/figcaption><\/div>\n<\/figure>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. <\/em><\/strong><em>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.<\/em><\/p>\n<p><strong><em>\u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0432\u0441\u0435\u0435\u0432,<\/em><\/strong><\/p>\n<p><strong><em>\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 API<\/em><\/strong><\/p>\n<p><strong><em>\u041e\u041e\u041e \u00ab\u041d\u0430\u043d\u043e\u0441\u043e\u0444\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u00bb<\/em><\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/718362\/\"> https:\/\/habr.com\/ru\/articles\/718362\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 23-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b nanoCAD \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>PY<\/strong> \u0438 <strong>-PY<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python.<\/p>\n<p>?  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>PY<\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 Python, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>?  \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>-PY<\/strong> \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0440\u0435\u0434\u044b<\/h3>\n<p>\u0414\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Python \u043d\u0430 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 nanoCAD \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Python 3 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Python.AXScript.2 (Active Scripting). \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python \u0432 \u0440\u0430\u0431\u043e\u0442\u0435, \u043d\u0443\u0436\u043d\u043e, \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044f \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438.<\/p>\n<p>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Python 3. <\/p>\n<p>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a: www.python.org\/downloads\/windows (\u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 3.10.4).<\/p>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em><\/strong> <em>\u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 Python \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PATH \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435<\/em> <strong><em>Add Python 3.10 to PATH<\/em><\/strong> (\u0440\u0438\u0441. 1).<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. 1<\/figcaption><\/div>\n<\/figure>\n<p>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Active Scripting \u0434\u043b\u044f Python.<\/p>\n<p>\u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Python Win32 extentions \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Python Active Scripting (win32com.axscript) \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Python \u043f\u0443\u0442\u044c \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PATH, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <\/p>\n<p><code>python -m pip install --upgrade pywin32<\/code><\/p>\n<p>\u0438\u043b\u0438<\/p>\n<p><code>pip install pywin32 --upgrade<\/code><\/p>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. <\/em><\/strong><em>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u041c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u00bb) \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u043b\u044f \u0440\u0443\u0447\u043d\u043e\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f:<\/em><\/p>\n<p><code>python Scripts\/pywin32_postinstall.py -install<\/code><\/p>\n<p>\u041f\u0440\u0438\u00a0\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 nanoCAD \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u00a0\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u00abPython.AXScript.2\u00bb \u0432\u00a0\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435\u00a0\u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430, \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043f\u0440\u0438\u00a0\u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u0438\u0442 \u043e\u00a0\u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 Python \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0432\u0438\u0434\u0430 \u00abUnable to create scripting engine for \u201ePython.AXScript.2\u201c\u00bb.<\/p>\n<h3>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Python<\/h3>\n<p>\u0422\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430:<\/p>\n<ul>\n<li>\n<p>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 nanoCAD 23;<\/p>\n<\/li>\n<li>\n<p>Python for Windows 3.10.4;<\/p>\n<\/li>\n<li>\n<p>Pywin32 \u2013 Release 304.<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 nanoCAD \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>PY<\/strong> (\u0440\u0438\u0441. 2) \u0438 <strong>-PY<\/strong> \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. 2<\/figcaption><\/div>\n<\/figure>\n<p>\u041b\u0438\u0441\u0442\u0438\u043d\u0433 MyPythonScript.py:<\/p>\n<pre><code>doc = ThisDrawing;  ut = doc.Utility;  ut.Prompt(\"\u041f\u0440\u0438\u0432\u0435\u0442, Python \u0432 nanoCAD!\"); <\/code><\/pre>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/em><\/strong><em> \u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 Python \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 SDK.<\/em><\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0440\u0438\u0441. 3.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. 3<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>-PY <\/strong>\u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 MyPythonScript.py \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0430 \u0440\u0438\u0441.\u00a04, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2013 \u043d\u0430 \u0440\u0438\u0441.\u00a05.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. 4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. 5<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 nanoCAD: <em>\u0421\u0435\u0440\u0432\u0438\u0441<\/em> \u2192\u00a0 <em>\u0421\u043a\u0440\u0438\u043f\u0442\u044b<\/em> \u2192\u00a0 <em>\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/em> (\u0440\u0438\u0441. 6).<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0438\u0441. 6<\/figcaption><\/div>\n<\/figure>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. <\/em><\/strong><em>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.<\/em><\/p>\n<p><strong><em>\u0421\u0435\u0440\u0433\u0435\u0439 \u0415\u0432\u0441\u0435\u0435\u0432,<\/em><\/strong><\/p>\n<p><strong><em>\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 API<\/em><\/strong><\/p>\n<p><strong><em>\u041e\u041e\u041e \u00ab\u041d\u0430\u043d\u043e\u0441\u043e\u0444\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u00bb<\/em><\/strong><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/718362\/\"> https:\/\/habr.com\/ru\/articles\/718362\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-414333","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=414333"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414333\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}