{"id":23330,"date":"2026-03-06T12:44:38","date_gmt":"2026-03-06T03:44:38","guid":{"rendered":"https:\/\/happy-man.jp\/engineer\/?p=23330"},"modified":"2026-03-06T12:44:39","modified_gmt":"2026-03-06T03:44:39","slug":"%e7%9f%ad%e5%86%8a%e5%bd%a2%e3%83%9c%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%b0%e6%9f%b1%e7%8a%b6%e5%9b%b3%e3%81%ae%e5%90%84%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e7%be%85%e5%88%97%e3%81%99%e3%82%8bli","status":"publish","type":"post","link":"https:\/\/happy-man.jp\/engineer\/?p=23330","title":{"rendered":"\u77ed\u518a\u5f62\u30dc\u30fc\u30ea\u30f3\u30b0\u67f1\u72b6\u56f3\u306e\u5404\u30d5\u30a1\u30a4\u30eb\u3092\u7f85\u5217\u3059\u308bLISP\u3092\u4f5c\u6210\u3057\u305f"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_91 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/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-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/happy-man.jp\/engineer\/?p=23330\/#%E7%B0%A1%E6%98%93%E3%83%9C%E3%83%BC%E3%83%AA%E3%83%B3%E3%82%B0%E6%9F%B1%E7%8A%B6%E5%9B%B3%E3%81%AE%E7%BE%85%E5%88%97%E3%81%97%E3%81%9F%E3%82%82%E3%81%AE%E3%82%92%E8%87%AA%E5%8B%95%E3%81%A7%E4%BD%9C%E3%82%8A%E3%81%9F%E3%81%84\" >\u7c21\u6613\u30dc\u30fc\u30ea\u30f3\u30b0\u67f1\u72b6\u56f3\u306e\u7f85\u5217\u3057\u305f\u3082\u306e\u3092\u81ea\u52d5\u3067\u4f5c\u308a\u305f\u3044<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/happy-man.jp\/engineer\/?p=23330\/#%E5%AE%9F%E7%8F%BE%E3%81%97%E3%81%9F%E3%81%84%E3%81%93%E3%81%A8\" >\u5b9f\u73fe\u3057\u305f\u3044\u3053\u3068<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/happy-man.jp\/engineer\/?p=23330\/#%E3%83%88%E3%83%A9%E3%82%A4%E3%82%A2%E3%83%B3%E3%83%89%E3%82%A8%E3%83%A9%E3%83%BC\" >\u30c8\u30e9\u30a4\u30a2\u30f3\u30c9\u30a8\u30e9\u30fc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/happy-man.jp\/engineer\/?p=23330\/#%E5%87%BA%E6%9D%A5%E4%B8%8A%E3%81%8C%E3%81%A3%E3%81%9FLISP%E3%81%AF%E3%81%93%E3%82%8C%E3%81%A0\" >\u51fa\u6765\u4e0a\u304c\u3063\u305fLISP\u306f\u3053\u308c\u3060<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%B0%A1%E6%98%93%E3%83%9C%E3%83%BC%E3%83%AA%E3%83%B3%E3%82%B0%E6%9F%B1%E7%8A%B6%E5%9B%B3%E3%81%AE%E7%BE%85%E5%88%97%E3%81%97%E3%81%9F%E3%82%82%E3%81%AE%E3%82%92%E8%87%AA%E5%8B%95%E3%81%A7%E4%BD%9C%E3%82%8A%E3%81%9F%E3%81%84\"><\/span>\u7c21\u6613\u30dc\u30fc\u30ea\u30f3\u30b0\u67f1\u72b6\u56f3\u306e\u7f85\u5217\u3057\u305f\u3082\u306e\u3092\u81ea\u52d5\u3067\u4f5c\u308a\u305f\u3044<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">50\u672c\u306e\u7c21\u6613\u67f1\u72b6\u56f3\u3092\u3044\u3061\u3044\u3061\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u308a\u9589\u3058\u305f\u308a\u3059\u308b\u306e\u306f\u975e\u5e38\u306b\u3081\u3093\u3069\u304f\u3055\u3044\u306e\u3067\u3001\u77ed\u518a\u5f62\u30dc\u30fc\u30ea\u30f3\u30b0\u67f1\u72b6\u56f3\u306e\u7f85\u5217\u3059\u308bLISP\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br><a href=\"https:\/\/happy-man.jp\/engineer\/?p=23325\">\u4e0b\u65b9\u5411\u304d\u306e\u6298\u308c\u7dda\u30b0\u30e9\u30d5\uff08N\u5024\uff09\u306eLISP\u304b\u3089\u7c21\u6613\u67f1\u72b6\u56f3\u7248\u306b\u30d6\u30e9\u30c3\u30b7\u30e5\u30a2\u30c3\u30d7\u3057\u3066\u3082\u3089\u3063\u305f\u3002 | \u5730\u8cea\u5c4b\u3055\u3093\u3068\u547c\u3070\u306a\u3044\u3067<\/a><br>Gemini\u306b\u4f5c\u3063\u3066\u3082\u3089\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%9F%E7%8F%BE%E3%81%97%E3%81%9F%E3%81%84%E3%81%93%E3%81%A8\"><\/span>\u5b9f\u73fe\u3057\u305f\u3044\u3053\u3068<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30fb\u8907\u6570\u306eDXF\u30d5\u30a1\u30a4\u30eb\u3092\u6a2a\u65b9\u5411\u306b\u7f85\u5217\u3057\u305f\u3082\u306e\u3092\u4f5c\u308a\u305f\u3044\u3002<br>\u30fbDWG\u3082\u5bfe\u5fdc\u3057\u305f\u3044\u304c\u3001\u3067\u304d\u308c\u3070\u3069\u3061\u3089\u3092\u8aad\u307f\u8fbc\u307f\u305f\u3044\u304b\u9078\u629e\u5236\u306b\u3057\u305f\u3044\u3002<br>\u30fb\u67f1\u72b6\u56f3\u306f\u4e0a\u7aef\u63c3\u3048\u306b\u3057\u305f\u65b9\u304c\u6271\u3044\u3084\u3059\u3044\u306e\u3067\u3001\u4e0a\u7aef\u63c3\u3048\u306b\u3057\u305f\u3044\u3002<br>\u30fb\u30d5\u30a1\u30a4\u30eb\u304c\u91cd\u306a\u3089\u306a\u3044\u3088\u3046\u306b\u81ea\u52d5\u914d\u7f6e\u3057\u305f\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%83%88%E3%83%A9%E3%82%A4%E3%82%A2%E3%83%B3%E3%83%89%E3%82%A8%E3%83%A9%E3%83%BC\"><\/span>\u30c8\u30e9\u30a4\u30a2\u30f3\u30c9\u30a8\u30e9\u30fc<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">LISP\u3092\u52d5\u304b\u3059\u306e\u306bActiveX\u304c\u4f7f\u3048\u308b\u65b9\u304c\u826f\u3044\u306e\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3002<br>\u3042\u3068\u4f55\u5ea6\u304b\u30a8\u30e9\u30fc\u30b3\u30fc\u30c9\u3092\u5410\u304d\u51fa\u3057\u3066\u3044\u305f\u306e\u3067\u3001\u5404\u3005\u4fee\u6b63\u3057\u3066\u3082\u3089\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%87%BA%E6%9D%A5%E4%B8%8A%E3%81%8C%E3%81%A3%E3%81%9FLISP%E3%81%AF%E3%81%93%E3%82%8C%E3%81%A0\"><\/span>\u51fa\u6765\u4e0a\u304c\u3063\u305fLISP\u306f\u3053\u308c\u3060<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>(defun c:bordxf (\/ *doc* *ms* acad sel_path f_ext files margin x_coord ins_pt full_path res minp maxp ll ur w high_y dy)\n  (vl-load-com)\n  \n  (setq acad (vlax-get-acad-object))\n  (setq *doc* (vla-get-activedocument acad))\n  (setq *ms* (vla-get-modelspace *doc*))\n\n  ;; 1. \u5f62\u5f0f\u306e\u9078\u629e\n  (initget 1 &quot;DWG DXF Both&quot;)\n  (setq f_ext (getkword &quot;\\n\u5bfe\u8c61\u3092\u9078\u629e [DWG(W)\/DXF(X)\/\u4e21\u65b9(B)]: &quot;))\n  (if (not f_ext) (setq f_ext &quot;Both&quot;))\n\n  ;; 2. \u30d5\u30a9\u30eb\u30c0\u9078\u629e\n  (setq sel_path (get_folder_dialog &quot;\u56f3\u9762\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044&quot;))\n  \n  (if (and sel_path (\/= sel_path &quot;&quot;))\n    (progn\n      ;; \u56fa\u5b9a\u9593\u9694\u3067\u306f\u306a\u304f\u300c\u56f3\u9762\u9593\u306e\u9699\u9593\uff08\u4f59\u767d\uff09\u300d\u3092\u5165\u529b\u3057\u3066\u3082\u3089\u3046\n      (setq margin (getdist &quot;\\n\u56f3\u9762\u9593\u306e\u4f59\u767d\u3092\u5165\u529b: &quot;))\n      (setq x_coord 0.0)\n      \n      (cond\n        ((= f_ext &quot;DWG&quot;) (setq files (vl-directory-files sel_path &quot;*.dwg&quot; 1)))\n        ((= f_ext &quot;DXF&quot;) (setq files (vl-directory-files sel_path &quot;*.dxf&quot; 1)))\n        (t (setq files (append (vl-directory-files sel_path &quot;*.dwg&quot; 1)\n                               (vl-directory-files sel_path &quot;*.dxf&quot; 1))))\n      )\n\n      (if files\n        (progn\n          (vla-StartUndoMark *doc*)\n          (setvar &quot;INSUNITS&quot; 0)\n\n          (foreach f files\n            (setq full_path (strcat sel_path &quot;\\\\&quot; f))\n            ;; \u4e00\u65e6\u73fe\u5728\u306e x_coord \u306b\u633f\u5165\n            (setq ins_pt (vlax-3d-point (list x_coord 0.0 0.0)))\n\n            (princ (strcat &quot;\\n\u914d\u7f6e\u4e2d: &quot; f &quot;...&quot;))\n            \n            (setq res (vl-catch-all-apply &#39;vla-InsertBlock \n                        (list *ms* ins_pt full_path 1.0 1.0 1.0 0.0)))\n\n            (if (not (vl-catch-all-error-p res))\n                (progn\n                  ;; --- \u5e45\u3068\u9ad8\u3055\u306e\u8a08\u7b97 ---\n                  (vla-GetBoundingBox res &#39;minp &#39;maxp)\n                  (setq ll (vlax-safearray-&gt;list minp)) ; \u5de6\u4e0b\n                  (setq ur (vlax-safearray-&gt;list maxp)) ; \u53f3\u4e0a\n                  \n                  (setq w (- (car ur) (car ll)))      ; \u56f3\u9762\u306e\u6a2a\u5e45\n                  (setq high_y (cadr ur))             ; Y\u306e\u6700\u5927\u5024\n                  \n                  ;; 1. \u4e0a\u7aef\u3092 Y=0 \u306b\u5408\u308f\u305b\u308b\n                  (setq dy (* -1.0 high_y))\n                  ;; 2. \u5de6\u7aef\u3092\u73fe\u5728\u306e x_coord \u306b\u5408\u308f\u305b\u308b\uff08(0,0)\u539f\u70b9\u3067\u306a\u3044\u56f3\u9762\u5bfe\u7b56\uff09\n                  (setq dx (- x_coord (car ll)))\n                  \n                  (vla-Move res (vlax-3d-point &#39;(0 0 0)) (vlax-3d-point (list dx dy 0)))\n                  \n                  ;; \u5206\u89e3\n                  (vla-Explode res)\n                  (vla-delete res)\n                  \n                  ;; \u6b21\u306e\u914d\u7f6e\u5ea7\u6a19 = \u73fe\u5728\u306eX + \u3053\u306e\u56f3\u9762\u306e\u5e45 + \u4f59\u767d\n                  (setq x_coord (+ x_coord w margin))\n                  (princ &quot; [OK]&quot;)\n                )\n                (princ &quot; [\u30a8\u30e9\u30fc]&quot;)\n            )\n          )\n          (vla-EndUndoMark *doc*)\n          (vla-ZoomExtents acad)\n        )\n        (princ &quot;\\n\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002&quot;)\n      )\n    )\n  )\n  (princ)\n)\n\n;; \u30d5\u30a9\u30eb\u30c0\u9078\u629e\u7528\n(defun get_folder_dialog (msg \/ shell folder folder_obj path)\n  (setq shell (vla-getinterfaceobject (vlax-get-acad-object) &quot;Shell.Application&quot;))\n  (setq folder (vlax-invoke-method shell &#39;BrowseForFolder 0 msg 0 &quot;&quot;))\n  (if folder\n    (progn\n      (setq folder_obj (vlax-get-property folder &#39;Self))\n      (vlax-get-property folder_obj &#39;Path)\n    )\n    nil\n  )\n)\n\n;; \u30a8\u30a4\u30ea\u30a2\u30b9\n(defun c:BD () (c:bordxf))&lt;br&gt;<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/happy-man.jp\/engineer\/wp-content\/uploads\/2026\/03\/SnapCrab_NoName_2026-3-6_11-29-44_No-00.png?w=1140&#038;ssl=1\" alt=\"SnapCrab_NoName_2026-3-6_11-29-44_No-00.png\"><br>\u3053\u308c\u3067\u3044\u3061\u3044\u3061\u30d5\u30a1\u30a4\u30eb\u53c2\u7167\u3057\u306a\u304f\u3066\u3001Copy+\u30d6\u30ed\u30c3\u30af\u8cbc\u308a\u4ed8\u3051\u3067\u56f3\u9762\u304c\u63cf\u3051\u308b\u3002\u3059\u3070\u3089\u3057\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7c21\u6613\u30dc\u30fc\u30ea\u30f3\u30b0\u67f1\u72b6\u56f3\u306e\u7f85\u5217\u3057\u305f\u3082\u306e\u3092\u81ea\u52d5\u3067\u4f5c\u308a\u305f\u3044 50\u672c\u306e\u7c21\u6613\u67f1\u72b6\u56f3\u3092\u3044\u3061\u3044\u3061\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u308a\u9589\u3058\u305f\u308a\u3059\u308b\u306e\u306f\u975e\u5e38\u306b\u3081\u3093\u3069\u304f\u3055\u3044\u306e\u3067\u3001\u77ed\u518a\u5f62\u30dc\u30fc\u30ea\u30f3\u30b0\u67f1\u72b6\u56f3\u306e\u7f85\u5217\u3059\u308bLISP\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u4e0b\u65b9\u5411\u304d\u306e\u6298\u308c\u7dda\u30b0\u30e9\u30d5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":23329,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"_lightning_design_setting":{"layout":"default"},"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[50,48],"tags":[],"class_list":["post-23330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-gemini"],"nelio_content":{"autoShareEndMode":"never","automationSources":{"useCustomSentences":false,"customSentences":[]},"efiAlt":"","efiUrl":"","followers":[1],"highlights":[],"isAutoShareEnabled":true,"networkImageIds":[],"permalinkQueryArgs":[],"series":[],"suggestedReferences":[]},"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_publicize_connections":[],"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/happy-man.jp\/engineer\/wp-content\/uploads\/2026\/03\/SnapCrab_NoName_2026-3-6_11-29-44_No-00.png?fit=1493%2C852&ssl=1","_links":{"self":[{"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/posts\/23330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23330"}],"version-history":[{"count":2,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/posts\/23330\/revisions"}],"predecessor-version":[{"id":23332,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/posts\/23330\/revisions\/23332"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=\/wp\/v2\/media\/23329"}],"wp:attachment":[{"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/happy-man.jp\/engineer\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}