{"id":2926,"date":"2022-12-05T03:00:58","date_gmt":"2022-12-04T18:00:58","guid":{"rendered":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/?p=2926"},"modified":"2022-12-14T01:41:15","modified_gmt":"2022-12-13T16:41:15","slug":"autolisp-basic","status":"publish","type":"post","link":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/autolisp-basic\/","title":{"rendered":"AutoLISP\u5165\u9580\u8b1b\u5ea7-2 \u57fa\u790e\u7de8"},"content":{"rendered":"<h2 class=\"styled_h2\">AutoLISP\u306e\u4e16\u754c\u306b\u5165\u308b<\/h2>\r\n<p>\u3053\u3053\u304b\u3089\u3001AutoLISP\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u306f\u3058\u307e\u308a\u3067\u3059\u3002<br \/>\u307e\u305a\u3001AutoLISP\u306e\u4e16\u754c\u3092\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u306a\u304c\u3089\u306e\u305e\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\r\n<h2 class=\"styled_h2\">AutoLISP\u306e\u4e16\u754c\u3092\u8997\u3044\u3066\u307f\u308b<\/h2>\r\n<p>AutoCAD\u3067\u3001\u5186\u30fb\u76f4\u7dda\u30fb\u77e9\u5f62\u3092\u66f8\u304f\u3002\u3067\u304d\u308c\u3070\u3044\u308d\u3044\u308d\u306a\u30ec\u30a4\u30e4\u30fc\u3067\u3002<\/p>\r\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"249\" height=\"231\" class=\"wp-image-2958\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/12\/b-01-01.jpg\" alt=\"\" \/><\/figure>\r\n<p>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u3001<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\ncommand: (entsel)\u3000<\/code><\/pre>\r\n<p>\u3068\u66f8\u304d\u3001\u30a8\u30f3\u30bf\u30fc\u3002<br \/>\u3059\u308b\u3068\u3001<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\nselect object\uff1a\u3000<\/code><\/pre>\r\n<p>\u3068\u805e\u3044\u3066\u304d\u307e\u3057\u305f\u3002\uff08\u5f53\u65b9\u306e\u4f7f\u3063\u3066\u3044\u308bCAD\u304c\u82f1\u8a9e\u7248\u306a\u306e\u3067\u82f1\u8a9e\u306b\u306a\u3063\u3061\u3083\u3063\u3066\u307e\u3059\u3002\u3059\u307f\u307e\u305b\u3093\uff09<br \/>\u4f55\u304b\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u307f\u308b\u3002<br \/>\u3059\u308b\u3068<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\nSelect object: (\uff1cEntity name: 7ef7f068\uff1e \u3000(11014.2 9982.11 0.0))\u3000<\/code><\/pre>\r\n<p>\u3068\u8fd4\u3063\u3066\u304d\u307e\u3057\u305f\u3002\u307b\u3093\u306e\u3072\u3068\u3064\u306e\u5358\u8a9e\u3092\u6253\u3061\u8fbc\u3093\u3060\u3060\u3051\u3067\u3001AutoCAD\u304c<br \/>\u56f3\u5f62\u3092\u9078\u629e\uff1a\u3068\u3044\u3046\u898b\u6163\u308c\u305f\u8a00\u8449\u3067\u30e6\u30fc\u30b6\u30fc\u306b\u9078\u629e\u3092\u4fc3\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u5fdc\u3048\u3001\u305d\u308c\u306b\u5bfe\u3057\u8fd4\u4e8b\u3092\u3059\u308b\u3068\u3044\u3046\u4f1a\u8a71\u304c\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\u79c1\u304c\u59cb\u3081\u3066\u3053\u308c\u3092\u3084\u3063\u305f\u3068\u304d\u306f\u3001\u3051\u3063\u3053\u3046\u611f\u52d5\u3057\u307e\u3057\u305f\u3002<br \/>\u3055\u3089\u306b\u30b3\u30de\u30f3\u30c9\u3092\u52a0\u3048\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\ncommand: (entsel \"\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a\")<\/code><\/pre>\r\n<p>\u3068\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u66f8\u3044\u3066\u3001\u56f3\u5f62\u3092\u9078\u629e\u3002\u3059\u308b\u3068\u3001<\/p>\r\n<pre class=\"wp-block-code\"><code>command:<br \/>\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a(\uff1cEntity name: 7ef7f068\uff1e (11292.2 10028.4 0.0))\u3000<\/code><\/pre>\r\n<p><br \/>\u3068\u306a\u308a\u307e\u3057\u305f\u3002<br \/>entsel \u3068\u306f\u30e6\u30fc\u30b6\u30fc\u306b\u56f3\u5f62\u9078\u629e\u3092\u4fc3\u3059\u30b3\u30de\u30f3\u30c9\u3067\u3001\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30fc\u3092\u30bb\u30ec\u30af\u30c8\u3059\u308b\u3001\u3068\u3044\u3046\u610f\u5473\u3067\u30a8\u30f3\u30c8\u30bb\u30eb\u3068\u8aad\u307f\u307e\u3059\u3002<br \/>\u305d\u308c\u306b\u5bfe\u3057AutoCAD\u304b\u3089\u306e\u8fd4\u4e8b\u306f\u3001\u300c\u9078\u629e\u3055\u308c\u305f\u56f3\u5f62\u306e\u56f3\u5f62\u540d\u79f0\u300d\u3068\u300c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u70b9\u300d\u306e2\u3064\u3068\u30bb\u30c3\u30c8\u306b\u3057\u305f\u3082\u306e\u3067\u3059\u3002<br \/>\u3053\u306e\u3088\u3046\u306a\u30bb\u30c3\u30c8\u306e\u3053\u3068\u3092\u30ea\u30b9\u30c8\u3068\u547c\u3073\u307e\u3059\u3002<br \/>\uff1cEntity name: 7ef7f068\uff1e\u3068\u3044\u3046\u306e\u304c\u56f3\u5f62\u540d\u3001(11292.2 10028.4 0.0)\u3068\u3044\u3046\u306e\u304c\u30e6\u30fc\u30b6\u30fc\u304c\u30af\u30ea\u30c3\u30af\u3057\u305f\u70b9\u306e\u5ea7\u6a19\u3067\u3059\u3002<br \/>\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3057\u3066\u3001\u9078\u629e\u3092\u4fc3\u3059\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u3001\u4eca\u56de\u306e\u3088\u3046\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<br \/>\u300c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u70b9\u300d\u306f\u3001\u30af\u30ea\u30c3\u30af\u3057\u305f\u70b9\u305d\u306e\u3082\u306e\u3067\u3042\u3063\u3066\u3001\u30b9\u30ca\u30c3\u30d7\u52b9\u679c\u306f\u8003\u616e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u3067\u3059\u306e\u3067\u3001\u3053\u3053\u3067\u306e\u5ea7\u6a19\u306f\u56f3\u5f62\u4e0a\u306b\u306e\u3063\u3066\u3044\u307e\u305b\u3093\u3002\u3068\u3044\u3046\u3088\u3046\u306a\u3053\u3068\u3082\u30d8\u30eb\u30d7\u306b\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\r\n<p>\u3055\u3089\u306b\u30b3\u30de\u30f3\u30c9\u3092\u52a0\u3048\u3066\u3001<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\ncommand: (car (entsel \"\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a\"))<\/code><\/pre>\r\n<p><br \/>\u3068\u3057\u3066\u3001\u56f3\u5f62\u3092\u9078\u629e\u3002\u3059\u308b\u3068<\/p>\r\n<pre class=\"wp-block-code\"><code>command:<br \/>\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a\uff1cEntity name: 7ef7f068\uff1e<\/code><\/pre>\r\n<p><br \/>\u3068\u306a\u308a\u3001\u56f3\u5f62\u540d\u3060\u3051\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\r\n<p>car\u3068\u306f\u3001\u30ea\u30b9\u30c8\u306e\u3046\u3061\u3001\u4e00\u756a\u6700\u521d\u306e\u8981\u7d20\u3060\u3051\u3092\u629c\u304d\u53d6\u3063\u3066\u8868\u793a\u3055\u305b\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u306a\u305ccar\u3068\u3044\u3046\u306e\u304b\u3001\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\r\n<p>\u3067\u3059\u306e\u3067\u3001(\uff1cEntity name: 7ef7f068\uff1e (11292.2 10028.4 0.0)) \u3068\u3044\u3046\u30ea\u30b9\u30c8\u304b\u3089\u3001\u6700\u521d\u306e\u8981\u7d20\u3067\u3042\u308b\uff1cEntity name: 7ef7f068\uff1e\u3060\u3051\u304c\u629c\u304d\u51fa\u3055\u308c\u3066\u8fd4\u3063\u3066\u304d\u305f\u308f\u3051\u3067\u3059\u3002<br \/>\u3053\u3053\u304b\u3089\u304c\u3044\u3088\u3044\u3088\u9762\u767d\u3044\u3068\u3053\u308d\u3067\u3059\u3002\u3055\u3089\u306b\u30b3\u30de\u30f3\u30c9\u3092\u52a0\u3048\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\nCommand: (entget(car(entsel \"\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a\")))<\/code><\/pre>\r\n<p><br \/>\u3068\u3057\u3066\u3001\u56f3\u5f62\u3092\u9078\u629e\u3002\u3059\u308b\u3068<\/p>\r\n<pre class=\"wp-block-code\"><code>command:<br \/>\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a((-1 . \uff1cEntity name: 7ef7f068\uff1e) (0 . \"LWPOLYLINE\")<br \/>(330 . ) (5 . \"86\") (100 . \"AcDbEntity\") (67 . 0) (410 .<br \/>\"Model\") (8 . \"51_zatsu_A\") (370 . 40) (100 . \"AcDbPolyline\") (90 . 4) (70 . 1)<br \/>(43 . 0.0) (38 . 0.0) (39 . 0.0) (10 10247.0 12595.2) (40 . 0.0) (41 . 0.0) (42<br \/>. 0.0) (10 13255.4 12595.2) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 13255.4<br \/>10052.1) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 10247.0 10052.1) (40 . 0.0) (41 .<br \/>0.0) (42 . 0.0) (210 0.0 0.0 1.0))<\/code><\/pre>\r\n<p><br \/>AutoLISP\u304c\u30c7\u30fc\u30bf\u306e\u7f85\u5217\u3092\u8fd4\u3057\u3066\u304d\u307e\u3057\u305f\u3002<br \/>\u3053\u308c\u306f\u3001\u3055\u3063\u304d\u9069\u5f53\u306b\u63cf\u3044\u305fRECTANGLE\u306e\u56f3\u5f62\u304c\u6301\u3064\u3001DXF\u60c5\u5831\u3067\u3059\u3002<br \/>AutoCAD\u304c\u4f55\u3092\u3069\u3046\u3084\u3063\u3066\u56f3\u5f62\u3092\u63cf\u3044\u3066\u3044\u308b\u306e\u304b\u77e5\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u306e\u30c7\u30fc\u30bf\u304c\u56f3\u5f62\u305d\u306e\u3082\u306e\u3067\u3042\u308b\u3068\u3059\u308b\u306a\u3089\u3070\u3001AutoCAD\u306e\u4e2d\u5473\u306b\u8fd1\u3044\u90e8\u5206\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u305f\u308f\u3051\u3067\u3001\u306a\u3093\u3068\u3082\u9762\u767d\u3044\u3053\u3068\u3067\u3059\u3002<br \/>AutoCAD\u30e6\u30fc\u30b6\u30fc\u30fc\u306e\u304a\u305d\u3089\u304f99%\u306e\u4eba\u306f\u3001\u3053\u3046\u3044\u3063\u305f\u30c7\u30fc\u30bf\u306b\u89e6\u308c\u308b\u3053\u3068\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3082\u3063\u305f\u3044\u306a\u3044\u3053\u3068\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\r\n<p>entget\u3068\u306f\u3001\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30fc\u3092\u30b2\u30c3\u30c8\u3059\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u30a8\u30f3\u30c8\u30b2\u30c3\u30c8\u3068\u8aad\u307f\u307e\u3059\u3002<br \/>(entget \u56f3\u5f62\u540d) \u3068\u3044\u3046\u5f62\u3067\u4f7f\u3046\u3053\u3068\u306b\u3088\u308a\u3001\u56f3\u5f62\u306e\u5185\u90e8\u60c5\u5831\u3092\u30b2\u30c3\u30c8\u3057\u3066\u304d\u3066\u304f\u308c\u307e\u3059\u3002<br \/>\u201d\u56f3\u5f62\u540d\u201d\u304c\u76ee\u7684\u8a9e\uff08\u5f15\u6570\uff09\u306b\u306a\u308b\u3068\u6c7a\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001car\u3092\u4f7f\u3063\u3066\u3001\u4f59\u8a08\u306a\u5ea7\u6a19\u60c5\u5831\u304c\u5165\u3063\u3066\u3053\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u308f\u3051\u3067\u3059\u3002<br \/>\u3053\u306e\u3088\u3046\u306b\u3001\u56f3\u5f62\u306b\u306f\u4e00\u3064\u4e00\u3064\uff1cEntity name: 7ef7f068\uff1e\u3068\u3044\u3046\u3088\u3046\u306a\u56f3\u5f62\u540d\u304c\u4e0e\u3048\u3089\u308c\u3066\u3044\u3066\u3001\u3053\u306e\u56f3\u5f62\u540d\u3092\u4f7f\u3044\u306a\u304c\u3089\u56f3\u5f62\u3092\u6271\u3044\u307e\u3059\u3002<\/p>\r\n<p>\u3053\u306e\u307e\u307e\u3060\u3068\u8aad\u307f\u3065\u3089\u304f\u3001\u304b\u3064\u3044\u3061\u3044\u3061\u30af\u30ea\u30c3\u30af\u3059\u308b\u306e\u304c\u9762\u5012\u304f\u3055\u3044\u306e\u3067\u3001eData \u3068\u3044\u3046\u5909\u6570\u306b\u3053\u306e\u60c5\u5831\u3092\u4e38\u3054\u3068\u4ee3\u5165\u3057\u305f\u306e\u3061\u3001\u6539\u884c\u3057\u306a\u304c\u3089\u8868\u793a\u3055\u305b\u307e\u3059\u3002\u5909\u6570\u3067\u3059\u306e\u3067\u540d\u524d\u306f\u4f55\u3067\u3082\u826f\u3044\u3067\u3059\u304c\u3001LINE\u3000\u306a\u3069\u306eAutoCAD\u304c\u4f7f\u3063\u3066\u3044\u308b\u8a00\u8449\u306f\u907f\u3051\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002\u307e\u305a\u5909\u6570\u306b\u4ee3\u5165\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>command:\r\ncommand: (setq eData (entget(car(entsel \"\u56f3\u5f62\u3092\u9078\u629e\u3057\u3066\u304f\u308c\uff1a\"))))<\/code><\/pre>\r\n<p><br \/>setq\u3068\u306f\u3001(setq AAA BBB)\u306e\u5f62\u3067\u3001AAA\u306bBBB\u3092\u4ee3\u5165\u3059\u308b\u3001\u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u30bb\u30c3\u30c8\u30ad\u30e5\u30fc\u3068\u8aad\u307f\u307e\u3059\u3002<br \/>\u6b21\u306b\u6539\u884c\u8868\u793a\u3055\u305b\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059<\/p>\r\n<pre class=\"wp-block-code\"><code>Command:\r\nCommand: (mapcar 'print eData)(princ)<\/code><\/pre>\r\n<p>\u3059\u308b\u3068<\/p>\r\n<pre class=\"wp-block-code\"><code>Command:<br \/>Command: (mapcar 'print eData)(princ)<br \/>(-1 . \uff1cEntity name: 7ef7f068\uff1e)<br \/>(0 . \"CIRCLE\")<br \/>(330 . )<br \/>(5 . \"85\")<br \/>(100 . \"AcDbEntity\")<br \/>(67 . 0)<br \/>(410 . \"Model\")<br \/>(8 . \"21_RC\")<br \/>(370 . 40)<br \/>(100 . \"AcDbCircle\")<br \/>(10 7809.79 7674.96 0.0)<br \/>(40 . 2547.4)<br \/>(210 0.0 0.0 1.0)<\/code><\/pre>\r\n<p><br \/>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u4e00\u3064\u4e00\u3064\u306e\u8981\u7d20\u304c\u6539\u884c\u8868\u793a\u3055\u308c\u3001\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\u3053\u308c\u306f\u5186\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306eDXF\u60c5\u5831\u3067\u3059\u3002<br \/>\u3053\u3053\u306b\u306f\u3001\u30ec\u30a4\u30e4\u30fc\u3001\u8272\u3001\u7dda\u7a2e\u3001\u7dda\u306e\u592a\u3055\u3001\u4e2d\u5fc3\u306e\u5ea7\u6a19\u3001\u534a\u5f84\u3001\u306a\u3069\u5186\u81ea\u8eab\u304c\u6301\u3064\u60c5\u5831\u304c\u5168\u3066\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\u3088\u304f\u898b\u308b\u3068\u300121_RC \u306a\u3069\u306e\u3088\u3046\u306b\u5f53\u65b9\u304c\u8a2d\u5b9a\u3057\u305f\u30ec\u30a4\u30e4\u30fc\u306e\u540d\u79f0\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br \/>AutoLISP\u3068\u306f\u3001\u7c21\u5358\u306b\u8a00\u3048\u3070\u3001\u3053\u306e\u30c7\u30fc\u30bf\u3092\u3068\u306b\u304b\u304f\u3053\u306d\u304f\u308a\u56de\u3059\u3053\u3068\u306a\u306e\u3067\u3059\u3002<\/p>\r\n<h2 class=\"styled_h2\">DXF\u30c7\u30fc\u30bf\u3092\u8997\u3044\u3066\u307f\u308b<\/h2>\r\n<p>\u3044\u308d\u3044\u308d\u306a\u56f3\u5f62\u306eDXF\u30c7\u30fc\u30bf\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\u6b21\u306e\u77ed\u3044\u30b3\u30de\u30f3\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u30da\u30fc\u30b9\u30c8\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(mapcar 'print (entget (car (entsel))))(princ)\r\n<\/code><\/pre>\r\n<p>\u3044\u308d\u3044\u308d\u306a\u56f3\u5f62\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u305d\u306eDXF\u30c7\u30fc\u30bf\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\r\n<h3 class=\"styled_h3\">DXF\u30c7\u30fc\u30bf<\/h3>\r\n<p>\u7dda\u5206\u306eDXF\u30c7\u30fc\u30bf\u3092\u4f8b\u306b\u3001\u5404\u9805\u76ee\u306e\u610f\u5473\u3092\u66f8\u304d\u6dfb\u3048\u307e\u3059\u3002<br \/>\u5404\u9805\u76ee\u306e\u6700\u521d\u306e\u756a\u53f7\u306fAutoCAD\u306b\u6c7a\u3081\u3089\u308c\u305f\u756a\u53f7\u3067\u3001\u4f8b\u3048\u3070\u30018\u756a\u3067\u3042\u308c\u3070\u3001<br \/>\u201d\u5f8c\u306b\u7d9a\u304f\u6587\u5b57\u304c\u5fc5\u305a\u30ec\u30a4\u30e4\u30fc\u3092\u793a\u3059\u201d\u3068\u6c7a\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(-1 . )\t\u56f3\u5f62\u540d\r\n(0 . \"LINE\")\t\t\t\t\u56f3\u5f62\u306e\u7a2e\u985e\r\n(330 . )*\u4e0d\u660e*\u4f7f\u308f\u306a\u3044\u3067\u3059\r\n(5 . \"2E\")\t\t\t\t\u30cf\u30f3\u30c9\u30eb\u540d\r\n(100 . \"AcDbEntity\")\t\t\t\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u3001\u307f\u305f\u3044\u306a\u3082\u306e\r\n(67 . 0)\t\t\t\t0\u306a\u3089\u30e2\u30c7\u30eb\u306b\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u30011\u306a\u3089\u30da\u30fc\u30d1\u30fc\u7a7a\u9593\r\n(410 . \"Model\")\t\t\t\t\u56f3\u5f62\u306e\u5b58\u5728\u3059\u308b\u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u540d\u524d\r\n(8 . \"0\")\t\t\t\t\u30ec\u30a4\u30e4\u30fc\r\n(62 . 1)\t\t\t\t\u8272\u756a\u53f7\u3002256\u3082\u3057\u304f\u306f\u7701\u7565\u304cByLayer\u30010\u304cByBlock\r\n\t\t\t\t\t\u30de\u30a4\u30ca\u30b9\u306a\u3089OFF\u72b6\u614b\r\n(6 . \"Continuous\")\t\t\t\u7dda\u7a2e\u3002\u7701\u7565\u3055\u308c\u3066\u3044\u308c\u3070ByLayer\r\n(370 . 9)\t\t\t\t\u7dda\u306e\u592a\u3055\u3002100\u500d\u3055\u308c\u305f\u5024\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u3067\u3042\u308b\u3002\r\n(100 . \"AcDbLine\")\t\t\t\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u3001\u307f\u305f\u3044\u306a\u3082\u306e\r\n(10 139.448 118.297 0.0)\t\t\u958b\u59cb\u70b9\u306e\u5ea7\u6a19\r\n(11 276.378 203.415 0.0)\t\t\u7d42\u4e86\u70b9\u306e\u5ea7\u6a19\r\n(210 0.0 0.0 1.0)\t\t\t\u56f3\u5f62\u304c\u5b58\u5728\u3059\u308b\u5e73\u9762\u306e\u6cd5\u7dda\u30d9\u30af\u30c8\u30eb\r\n\t\u30d9\u30af\u30c8\u30eb0,0,1\u304c0,0,-1\u3060\u3063\u305f\u308a\u3059\u308b\u3068\u88cf\u8fd4\u3063\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u3001\r\n\t\u6642\u8a08\u30fb\u534a\u6642\u8a08\u304c\u9006\u306b\u306a\u3063\u305f\u308a\u3057\u307e\u3059\u3002\u6955\u5186\u30fb\u6955\u5186\u5f27\u3067\u306f\u91cd\u8981\u306b\u306a\u308b<\/code><\/pre>\r\n<p>\u3082\u3046\u3072\u3068\u3064\u3001\u5186\u306eDXF\u30c7\u30fc\u30bf\u3067\u3059\u3002\u7dda\u5206\u3068\u9055\u3046\u90e8\u5206\u3060\u3051\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(-1 . )\r\n(0 . \"CIRCLE\")\r\n(330 . )\r\n(5 . \"76\")\r\n(100 . \"AcDbEntity\")\r\n(67 . 0)\r\n(410 . \"Model\")\r\n(8 . \"0\")\r\n(100 . \"AcDbCircle\")\r\n(10 217.297 124.702 0.0)\t\t\t\u4e2d\u5fc3\u306e\u5ea7\u6a19\r\n(40 . 48.6309)\t\t\t\t\t\u534a\u5f84\r\n(210 0.0 0.0 1.0)<\/code><\/pre>\r\n<p>\u3053\u3046\u3044\u3046\u3088\u3046\u306b\u3001\u7dda\u5206\u3001\u30dd\u30ea\u30e9\u30a4\u30f3\u3001\u5186\u3001\u5186\u5f27\u3001\u6955\u5186\u3001\u5bf8\u6cd5\u3001\u6587\u5b57\u3001\u30de\u30eb\u30c1\u30c6\u30ad\u30b9\u30c8\u3001\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u3001<br \/>\u30d6\u30ed\u30c3\u30af\u306a\u3069\u3001\u5168\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304cDXF\u30c7\u30fc\u30bf\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\u3068\u3066\u3082\u9762\u767d\u3044\u4ed5\u7d44\u307f\u3060\u3068\u601d\u3044\u307e\u305b\u3093\u304b\u3002<\/p>\r\n<h3 class=\"styled_h3\">\u30c7\u30fc\u30bf\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f<\/h3>\r\n<p>\u3053\u308c\u3089DXF\u30c7\u30fc\u30bf\u304b\u3089\u77e5\u308a\u305f\u3044\u60c5\u5831\u3001\u4f8b\u3048\u3070\u5186\u306e\u4e2d\u5fc3\u306e\u5ea7\u6a19\u3092\u77e5\u308a\u305f\u3044\u306e\u3067\u3042\u308c\u3070\u3001<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq Data0 (entget (car (entsel))))\r\n<\/code><\/pre>\r\n<p>\u3067\u307e\u305a\u30c7\u30fc\u30bf\u5168\u4f53\u3092Data0\u3068\u3044\u3046\u5909\u6570\u306b\u3044\u308c<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq Data1 (assoc 10 Data0)\r\n<\/code><\/pre>\r\n<p>\u3067(10 217.297 124.702 0.0)\u3068\u3044\u3046\u30ea\u30b9\u30c8\u3092\u53d6\u308a\u51fa\u3057Data1\u306b\u3044\u308c<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq Data2 (cdr Data1))\r\n<\/code><\/pre>\r\n<p>\u3067\u3001(217.297 124.702 0.0)\u3000\u3068\u3044\u3046\u5ea7\u6a19\u3092\u53d6\u308a\u51fa\u3057Data2\u306b\u5165\u308c\u308b\u3002\u3068\u3044\u3046\u624b\u9806\u3092\u8e0f\u307f\u307e\u3059\u3002<br \/>\u5b9f\u969b\u306b\u306f\u3053\u306e\u624b\u9806\u306f\u3042\u307e\u308a\u306b\u983b\u51fa\u3059\u308b\u306e\u3067<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq ObjectName (car entsel))\r\n(setq Data2 (cdr (assoc 10  (entget ObjectName))))<\/code><\/pre>\r\n<p>\u30682\u6bb5\u968e\u3050\u3089\u3044\u306b\u3057\u3066\u66f8\u3044\u305f\u308a\u3001\u305d\u308c\u3082\u9762\u5012\u304f\u3055\u3051\u308c\u3070\u3001<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq ObjectName (car entsel))\r\n(setq Data2 (ObjDxf 10  ObjectName))<\/code><\/pre>\r\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001ObjDxf \u3068\u3044\u3046\u81ea\u5206\u306e\u95a2\u6570\u3092\u4f5c\u3063\u3066\u304a\u304d\u3001\u6587\u5b57\u5165\u529b\u306e\u6570\u3092\u6e1b\u3089\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\r\n<h2 class=\"styled_h2\">\u7df4\u7fd2\u30d7\u30ed\u30b0\u30e9\u30e0\u3000\u305d\u306e1<\/h2>\r\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e00\u9023\u306e\u6d41\u308c\u3092\u5927\u307e\u304b\u306b\u628a\u63e1\u3059\u308b\u305f\u3081\u306b\u3001\u5358\u7d14\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3001\u4f55\u56de\u304b\u306b\u5206\u3051\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u5473\u306f\u3001\u6b21\u306e\u3088\u3046\u306a3\u90e8\u69cb\u6210\u306b\u306a\u308b\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002\u3059\u306a\u308f\u3061<\/p>\r\n<pre class=\"wp-block-code\"><code>(defun c:Program_Name( \/ aa bb cc)\r\n\r\n\t\u30e6\u30fc\u30b6\u30fc\u306eCAD\u8a2d\u5b9a\u3092\u8a18\u61b6\u3059\u308b\u30d1\u30fc\u30c8\r\n\r\n\t*************************************************\r\n\r\n\t1\u3000\u30e6\u30fc\u30b6\u30fc\u306b\u56f3\u5f62\u3092\u9078\u629e\u3055\u305b\u305f\u308a\u3001\u6570\u5024\u3092\u5165\u529b\u3055\u305b\u305f\u308a\u3059\u308b\u3001\u60c5\u5831\u53ce\u96c6\u30d1\u30fc\u30c8\r\n\r\n\t2\u3000AutoLISP\u304c\u8a08\u7b97\u3059\u308b\u3001\u8a08\u7b97\u30d1\u30fc\u30c8\r\n\r\n\t3\u3000AutoLISP\u306b\u4f55\u304b\u3092\u63cf\u304b\u305b\u305f\u308a\u3001\u5909\u66f4\u3055\u305b\u308b\u3001\u4f5c\u56f3\u30d1\u30fc\u30c8\r\n\r\n\t*************************************************\r\n\r\n\t\u30e6\u30fc\u30b6\u30fc\u306eCAD\u8a2d\u5b9a\u3092\u5143\u306b\u623b\u3059\u30d1\u30fc\u30c8\r\n)<\/code><\/pre>\r\n<p>\u30e6\u30fc\u30b6\u30fc\u306eCAD\u8a2d\u5b9a\u3092\u8a18\u61b6\u3057\u305f\u308a\u3001\u5143\u306b\u623b\u3057\u305f\u308a\u3068\u3044\u3046\u306e\u306f\u3001\u3059\u3067\u306b\u6e96\u5099\u7de8\u3067\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\u3044\u308f\u3070\u5100\u5f0f\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308a\u3001\u4e00\u65e6\u3001\u4f5c\u3063\u3066\u3057\u307e\u3048\u3070\u3001\u305d\u3093\u306a\u306b\u5909\u3048\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\u8ab0\u304c\u4f5c\u3063\u3066\u3082\u5185\u5bb9\u3082\u4f3c\u305f\u3088\u3046\u306a\u3082\u306e\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\u60c5\u5831\u53ce\u96c6\u3000\u2192\u3000\u8a08\u7b97\u3000\u2192\u3000\u4f5c\u56f3<br \/>\u3068\u3044\u3046\u6d41\u308c\u3092\u5ff5\u982d\u306b\u304a\u3044\u3066\u3001\u6b21\u306e\u3088\u3046\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\r\n\r\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"495\" height=\"182\" class=\"wp-image-3034\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/12\/b-02-01.jpg\" alt=\"\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/12\/b-02-01.jpg 495w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/12\/b-02-01-300x110.jpg 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/figure>\r\n\r\n<p>\u3010\u4ed5\u69d8\u3011\u3000\u7dda\u5206\u3092\u30ac\u30b5\u3063\u3068\u9078\u629e\u3059\u308b\u3068\u3001\u305d\u306e\u7dda\u5206\u306e\u4e2d\u70b9\u306b\u3001\u534a\u5f84100\u306e\u5186\u3092\u4f5c\u56f3\u3059\u308b\u3002<br \/>\u6700\u521d\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u4f8b\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002\u6b21\u306b\u3001\u8aac\u660e\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\u76ee\u3067\u8ffd\u3046\u3060\u3051\u3067\u3001\u306a\u3093\u3068\u306a\u304f\u96f0\u56f2\u6c17\u304c\u5206\u304b\u308b\u3088\u3046\u306b\u3001\u30d9\u30bf\u30d9\u30bf\u306a\u66f8\u304d\u304b\u305f\u3092\u3057\u307e\u3059\u3002<br \/>\u4fdd\u5b58\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306f\u5fc5\u305aAutoCAD\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30d1\u30b9\u3092\u901a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(defun test( \/ ObjNameL i  ObjSet Data Pt10 Pt11 MidPt MidPtL item)\r\n\t;\u30e6\u30fc\u30b6\u30fc\u306eCAD\u8a2d\u5b9a\u3092\u8a18\u61b6\u3059\u308b\u30d1\u30fc\u30c8\uff08\u6bce\u56de\u540c\u3058\uff09*********************\r\n\t(load \"A_Utility\")\r\n\t(setq *error* *myerror*)\r\n\t(A_start)\r\n\t;\u30e6\u30fc\u30b6\u30fc\u304c\u56f3\u5f62\u3092\u9078\u629e\u3059\u308b\u30d1\u30fc\u30c8**********************\r\n\t(while (= ObjSet nil)\r\n\t\t(setq ObjSet (ssget '((0 . \"LINE\"))))\r\n\t)\r\n\t;\u9078\u629e\u3057\u305f\u56f3\u5f62\u30bb\u30c3\u30c8\u304b\u3089\u56f3\u5f62\u540d\u306e\u30ea\u30b9\u30c8\u3092\u4f5c\u308b\r\n\t(setq \ti 0)\r\n\t(setq m (sslength ObjSet))\r\n\t(repeat m\r\n\t\t(setq ObjNameL (cons  (ssname ObjSet i) ObjNameL))\r\n\t\t(setq i (1+ i))\r\n\t)\r\n\t(princ \"n ObjNameL :  \")(princ ObjNameL)\r\n\t;\u7aef\u70b9\u306e\u5ea7\u6a19\u3092\u53d6\u308a\u51fa\u3057\u3001\u4e2d\u70b9\u3092\u8a08\u7b97\u3059\u308b\u30d1\u30fc\u30c8**********************\r\n\t(foreach item ObjNameL\r\n\t\t(setq Data (entget item))\r\n\t\t;\u4e00\u65b9\u306e\u70b9\u306e\u5ea7\u6a19\r\n\t\t(setq Pt10 (cdr (assoc 10 Data)))\r\n\t\t(princ \"n Pt10 :  \")(princ Pt10)\r\n\r\n\t\t;\u3082\u3046\u4e00\u65b9\u306e\u70b9\u306e\u5ea7\u6a19\r\n\t\t(setq Pt11 (cdr (assoc 11 Data)))\r\n\t\t(princ \"n Pt11 :  \")(princ Pt11)\r\n\r\n\t\t;\u4e2d\u70b9\u3092\u6c42\u3081\u308b\r\n\t\t(setq MidPt (list\r\n\t\t\t\t\t(* 0.5 (+ (car Pt10)(car Pt11)))\r\n\t\t\t\t\t(* 0.5 (+ (cadr Pt10)(cadr Pt11)))\r\n\t\t\t\t)\r\n\t\t)\r\n\t\t(princ \"n MidPt :  \")(princ MidPt)\r\n\t\t;\u7d50\u679c\u306e\u5ea7\u6a19\u3092MidPtL\u3068\u3044\u3046\u3072\u3068\u3064\u306e\u30ea\u30b9\u30c8\u306b\u3069\u3093\u3069\u3093\u3064\u306a\u3052\u3066\u3044\u304f\r\n\t\t(setq MidPtL (cons  MidPt MidPtL))\r\n\t\t(princ \"n MidPtL :  \")(princ MidPtL)\r\n\t)\r\n\t;\u7d50\u679c\u3092\u3082\u3068\u306b\u4f5c\u56f3\u3059\u308b\u30d1\u30fc\u30c8**********************\r\n\t(setvar \"OSMODE\" 0)\t\t;O\u30b9\u30ca\u30c3\u30d7\u3092\u89e3\u9664\u3057\u3066\u304a\u304f\r\n\t(foreach item MidPtL\r\n\t\t(command \"._circle\" item 10)\r\n\t)\r\n\t;\u30e6\u30fc\u30b6\u30fc\u306eCAD\u8a2d\u5b9a\u3092\u5fa9\u5143\u3059\u308b\u30d1\u30fc\u30c8\uff08\u6bce\u56de\u540c\u3058\uff09*********************\r\n\t(A_end)\r\n\t(setq *error* nil)\r\n\t(princ)\r\n)\r\n;\u30ed\u30fc\u30c9\u3057\u305f\u3089\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\r\n(test)<\/code><\/pre>\r\n<p>\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u306b\u8aac\u660e\u3092\u66f8\u304d\u52a0\u3048\u307e\u3059\u3002\u3068\u3066\u3082\u7c21\u5358\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u304c\u3001\u9078\u629e\u2192\u8a08\u7b97\u2192\u4f5c\u56f3\u3068\u5168\u90e8\u63c3\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u6d41\u308c\u304c\u3088\u304f\u308f\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(defun test( \/ ObjNameL i  ObjSet Data Pt10 Pt11 MidPt MidPtL item)\r\n\t(load \"A_Utility\")<\/code><\/pre>\r\n<p>A_Utility\u3068\u3044\u3046\u306e\u306f\u3001\u4e0b\u306b\u51fa\u3066\u304f\u308b(A_start)\u3068(A_end)\u3068\u3044\u3046\u95a2\u6570\u3092\u66f8\u304d\u8fbc\u3093\u3060\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u3042\u3068\u3067\u3001(A_start)\u3068(A_end)\u3092\u547c\u3073\u51fa\u3059\u306e\u3067\u3001\u547c\u3073\u51fa\u3059\u524d\u306b\u30ed\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\u3087\u3063\u3068\u7279\u6b8a\u306a\u8a18\u8ff0\u3067\u3059\u3002\u3053\u3046\u3057\u3066\u304a\u304f\u3068\u3001\u30a8\u30e9\u30fc\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d42\u308f\u3063\u305f\u5834\u5408\u306b\u3082\u3001A_Utility\u306b\u3042\u308b\u3001*myerror*\u3068\u3044\u3046\u30eb\u30fc\u30c1\u30f3\u3092\u8aad\u307e\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\u79c1\u3082\u3088\u304f\u308f\u304b\u3089\u305a\u306b\u3001\u8ab0\u304b\u306e\u66f8\u3044\u305f\u30b5\u30f3\u30d7\u30eb\u306e\u307e\u306d\u3092\u3057\u307e\u3057\u305f\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(A_start)\r\n<\/code><\/pre>\r\n<p>(A_start)\u3068\u3044\u3046\u306e\u306f\u3001\u73fe\u5728\u306eO\u30b9\u30ca\u30c3\u30d7\u8a2d\u5b9a\u3084\u3001\u73fe\u5728\u753b\u5c64\u3092\u4e00\u6642\u7684\u306b\u5909\u6570\u306b\u683c\u7d0d\u3057\u3066\u304a\u304f\u30eb\u30fc\u30c1\u30f3\u3067A_Utility\u306b\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\r\n<h3 class=\"styled_h3\">\u30e6\u30fc\u30b6\u30fc\u304c\u56f3\u5f62\u3092\u9078\u629e\u3059\u308b\u30d1\u30fc\u30c8<\/h3>\r\n<p>ssget\u3068\u3044\u3046\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30ac\u30d0\u3063\u3068\u56f3\u5f62\u3092\u9078\u629e\u3055\u305b\u308b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<br \/>\u2018((0 . \u201cLINE\u201d)))\u3068\u3044\u3046\u8a18\u8ff0\u3092\u52a0\u3048\u308b\u3053\u3068\u306b\u3088\u308a\u3001LINE\u3057\u304b\u9078\u629e\u3055\u308c\u306a\u3044\u3088\u3046\u306b\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u304b\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u3001\u3059\u3054\u3044\u30b3\u30de\u30f3\u30c9\u3067\u3059ssget \u306b\u3088\u3063\u3066\u5f97\u3089\u308c\u308b\u3082\u306e\u306f\u3001\u9078\u629e\u30bb\u30c3\u30c8\u3068\u547c\u3070\u308c\u308b\u3001\u3044\u304f\u3064\u304b\u306e\u56f3\u5f62\u306e\u96c6\u307e\u308a\u3067\u3059\u3002<br \/>\u5909\u6570ObjSet\u306b\u306f\u3001\u201d\u9078\u629e\u30bb\u30c3\u30c8\u306e\u540d\u524d\u201d\u3057\u304b\u5165\u3063\u3066\u304a\u3089\u305a\u3001\u4e2d\u5473\u304c\u4f55\u306a\u306e\u304b\u3092\u77e5\u308b\u306b\u306f\u3001\u5225\u306e\u30b3\u30de\u30f3\u30c9\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\u307e\u305f\u3001\u3053\u3053\u3067\u306f\u3001\u3072\u3068\u3064\u3067\u3082\u56f3\u5f62\u3092\u9078\u629e\u3057\u306a\u3044\u3068\u5148\u306b\u9032\u307e\u306a\u3044\u3088\u3046\u306b\u3001(while (= ObjSet nil)\u3067\u56f2\u3093\u3067\u3044\u307e\u3059\u3002ObjSet \u304cnil\u306e\u9593\u306f\u3001\u3044\u3064\u307e\u3067\u3082\u30b0\u30eb\u30b0\u30eb\u56de\u308c\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(while (= ObjSet nil)\r\n\t\t(setq ObjSet (ssget '((0 . \"LINE\"))))\r\n\t)<\/code><\/pre>\r\n<p>\u9078\u629e\u3057\u305f\u56f3\u5f62\u30bb\u30c3\u30c8\u304b\u3089\u56f3\u5f62\u540d\u306e\u30ea\u30b9\u30c8\u3092\u4f5c\u308b\u3081\u3067\u305f\u304f\u56f3\u5f62\u304c\u9078\u629e\u3055\u308c\u305f\u3089\u3001\u305d\u306e\u9078\u629e\u30bb\u30c3\u30c8\u306b\u542b\u307e\u308c\u308b\u56f3\u5f62\u540d\u3092\u53d6\u308a\u51fa\u3057\u3066\u3001ObjNameL\u3068\u3044\u3046\u30ea\u30b9\u30c8\u306e\u4e2d\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<br \/>\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u521d\u671f\u5024\u30920\u306b\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(setq \ti 0)\r\n<\/code><\/pre>\r\n<p>sslength \u3067\u56f3\u5f62\u30bb\u30c3\u30c8\u306e\u4e2d\u306b\u4f55\u500b\u306e\u56f3\u5f62\u304c\u3042\u308b\u304b\u3092\u8abf\u3079m\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(setq m (sslength ObjSet))\r\n<\/code><\/pre>\r\n<p>m\u56de\u7e70\u308a\u8fd4\u3057\u307e\u3059<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(repeat m\r\n<\/code><\/pre>\r\n<p>ssname \u306fi\u756a\u76ee\u306e\u56f3\u5f62\u306e\u56f3\u5f62\u540d\u3092\u53d6\u308a\u51fa\u3059\u95a2\u6570\u3067\u3059\u3002<br \/>cons\u3068\u3044\u3046\u306e\u306f\u65b0\u3057\u3044\u8981\u7d20\u3092\u53e4\u3044\u30ea\u30b9\u30c8\u306e\u982d\u306b\u304f\u3063\u3064\u3051\u308b\u3001\u3068\u3044\u3046\u95a2\u6570\u3002<br \/>\u3053\u3053\u306f\u3061\u3087\u3063\u3068\u5206\u304b\u308a\u306b\u304f\u3044\u306e\u3067\u3059\u304c\u3001ObjNameL \u3068\u3044\u3046\u95a2\u6570\u306e\u982d\u306b\u3001\u3069\u3093\u3069\u3093\u56f3\u5f62\u540d\u3092\u304f\u3063\u3064\u3051\u3066\u3044\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(setq ObjNameL (cons  (ssname ObjSet i) ObjNameL))\r\n<\/code><\/pre>\r\n<p>\u30ab\u30a6\u30f3\u30bf\u30fc\u3092\u30d7\u30e9\u30b91\u3057\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(setq i (1+ i))\r\n\t)<\/code><\/pre>\r\n<p>\u51fa\u6765\u4e0a\u304c\u3063\u305f\u56f3\u5f62\u540d\u306e\u30ea\u30b9\u30c8\u3092\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u6253\u3061\u51fa\u3057\u3066\u3001\u76ee\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\u3053\u3053\u3067\u5217\u6319\u3055\u308c\u308b\u56f3\u5f62\u540d\u305f\u3061\u304c\u3001\u3053\u308c\u304b\u3089\u8a08\u7b97\u306e\u5bfe\u8c61\u3068\u306a\u308b\u56f3\u5f62\u305f\u3061\u3067\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(princ \"n ObjNameL :  \")(princ ObjNameL)\r\n<\/code><\/pre>\r\n<h3 class=\"styled_h3\">\u7aef\u70b9\u306e\u5ea7\u6a19\u3092\u53d6\u308a\u51fa\u3057\u3001\u4e2d\u70b9\u3092\u8a08\u7b97\u3059\u308b\u30d1\u30fc\u30c8<\/h3>\r\n<p>(foreach \u3067\u3001ObjNameL\u306e\u4e2d\u306e\u8981\u7d20\u306e\u305d\u308c\u305e\u308c\u306b\u5bfe\u3057\u3001\u4f55\u304b\u306e\u64cd\u4f5c\u3092\u884c\u3044\u307e\u3059\u3002<br \/>repeat\u3068\u4f3c\u305f\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u304c\u3001\u30ab\u30a6\u30f3\u30bf\u30fc\u4ee3\u308f\u308a\u306e\u5909\u6570\u304c\u4e0d\u8981\u306a\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u697d\u3067\u3059\u3002<br \/>item \u3068\u3044\u3046\u5909\u6570\u304c\u3001ObjNameL\u3068\u3044\u3046\u30ea\u30b9\u30c8\u306e\u4e2d\u3092\u8981\u7d20\u306b\u9806\u756a\u306b\u6210\u308a\u4ee3\u308f\u3063\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(foreach item ObjNameL\r\n<\/code><\/pre>\r\n<p>enget\u3067\u8981\u7d20\u306eDXF\u60c5\u5831\u3092\u53d6\u308a\u51fa\u3057\u3001Data\u306b\u4fdd\u5b58\u3057\u307e\u3059<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(setq Data (entget item))\r\n<\/code><\/pre>\r\n<p>\u4e00\u65b9\u306e\u70b9\u306e\u5ea7\u6a19<br \/>\u76f4\u7dda\u306e\u7aef\u70b9\u306f\u3001\u4e00\u65b9\u304cDXF\u306e10\u756a\u3001\u3082\u3046\u4e00\u65b9\u304c11\u756a\u3068\u6c7a\u307e\u3063\u3066\u3044\u308b\u306e\u3067\u307e\u305a\u300110\u756a\u306e\u65b9\u3092\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002<br \/>assoc\u3067\u3072\u3063\u304b\u3051\u3066\u3001cdr\u3067\u982d\u3092\u98db\u3070\u3057\u3001\u5ea7\u6a19\u3060\u3051\u306e\u72b6\u614b\u306b\u3057\u3066\u304b\u3089Pt10\u306b\u4ee3\u5165\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(setq Pt10 (cdr (assoc 10 Data)))\r\n<\/code><\/pre>\r\n<p>\u4e00\u5fdc\u3001\u753b\u9762\u3067\u7d50\u679c\u78ba\u8a8d\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(princ \"n Pt10 :  \")(princ Pt10)\r\n<\/code><\/pre>\r\n<p>\u3082\u3046\u4e00\u65b9\u306e\u70b9\u306e\u5ea7\u6a1911\u756a\u306e\u65b9\u3092\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002<br \/>assoc\u3067\u3072\u3063\u304b\u3051\u3066\u3001cdr\u3067\u982d\u3092\u98db\u3070\u3057\u3001\u5ea7\u6a19\u3060\u3051\u306e\u72b6\u614b\u306b\u3057\u3066\u304b\u3089Pt11\u306b\u4ee3\u5165\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(setq Pt11 (cdr (assoc 11 Data)))\r\n<\/code><\/pre>\r\n<p>\u4e00\u5fdc\u3001\u753b\u9762\u3067\u7d50\u679c\u78ba\u8a8d\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(princ \"n Pt11 :  \")(princ Pt11)\r\n<\/code><\/pre>\r\n<h3 class=\"styled_h3\">\u4e2d\u70b9\u3092\u6c42\u3081\u308b<\/h3>\r\n<p>2\u70b9\u9593\u306e\u4e2d\u70b9\u3068\u306f\u3001<br \/>(X\u5ea7\u6a19\u3092\u8db3\u3057\u30662\u3067\u5272\u3063\u305f\u3082\u306e, Y\u5ea7\u6a19\u3092\u8db3\u3057\u30662\u3067\u5272\u3063\u305f\u3082\u306e)<br \/>\u306a\u306e\u3067\u3001\u305d\u306e\u901a\u308a\u306b\u5f0f\u3067\u66f8\u3044\u3066\u3001MidPt\u306b\u4ee3\u5165\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(setq MidPt (list\r\n\t\t\t(* 0.5 (+ (car Pt10)(car Pt11)))\r\n\t\t\t(* 0.5 (+ (cadr Pt10)(cadr Pt11)))\r\n\t\t)\r\n\t)<\/code><\/pre>\r\n<p>\u4e00\u5fdc\u3001\u753b\u9762\u3067\u7d50\u679c\u78ba\u8a8d\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(princ \"n MidPt :  \")(princ MidPt)\r\n<\/code><\/pre>\r\n<p>\u7d50\u679c\u306e\u5ea7\u6a19\u3092MidPtL\u3068\u3044\u3046\u3072\u3068\u3064\u306e\u30ea\u30b9\u30c8\u306b\u3069\u3093\u3069\u3093\u3064\u306a\u3052\u3066\u3044\u304f<br \/>\u3055\u3066\u3001\u3053\u3053\u3067\u3001\u4e2d\u70b9\u306e\u5ea7\u6a19\u304c\u3059\u3067\u306b\u5206\u304b\u3063\u305f\u306e\u3067\u3001\u76f4\u63a5\u5186\u3092\u4f5c\u56f3\u3057\u3066\u3082\u3088\u3044\u306e\u3067\u3059\u304c\u3001\u3053\u3053\u306f\u4e00\u65e6\u3001\u5168\u3066\u306e\u7d50\u679c\u3092\u3072\u3068\u3064\u306e\u30ea\u30b9\u30c8\u306b\u307e\u3068\u3081\u308b\u3068\u3044\u3046\u624b\u9806\u3092\u304b\u307e\u305b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\u5148\u307b\u3069\u3068\u540c\u3058\u3088\u3046\u306b\u3001cons\u30b3\u30de\u30f3\u30c9\u3067\u3001\u6b21\u3005\u306b\u6570\u73e0\u7e4b\u304e\u306b\u3057\u3066\u4e2d\u70b9\u30ea\u30b9\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t\t(setq MidPtL (cons\tMidPt MidPtL))\r\n<\/code><\/pre>\r\n<p>\u4e00\u5fdc\u3001\u753b\u9762\u3067\u7d50\u679c\u78ba\u8a8d\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(princ \"n MidPtL :  \")(princ MidPtL)\r\n\t)<\/code><\/pre>\r\n<h3 class=\"styled_h3\">\u7d50\u679c\u3092\u3082\u3068\u306b\u4f5c\u56f3\u3059\u308b\u30d1\u30fc\u30c8<\/h3>\r\n<p>command\u3092\u4f7f\u3063\u3066\u4f5c\u56f3\u3059\u308b\u5834\u5408\u306f\u3001O\u30b9\u30ca\u30c3\u30d7\u306e\u30e2\u30fc\u30c9\u3092\u30bc\u30ed\u306b\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3042\u3089\u306c\u3068\u3053\u308d\u306b\u4f5c\u56f3\u3057\u305f\u308a\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(setvar \"OSMODE\" 0)\t\t;O\u30b9\u30ca\u30c3\u30d7\u3092\u89e3\u9664\u3057\u3066\u304a\u304f\r\n<\/code><\/pre>\r\n<p>\u518d\u3073foreach\u95a2\u6570\u3067\u3001\u4e2d\u70b9\u30ea\u30b9\u30c8\u306e\u305d\u308c\u305e\u308c\u306e\u8981\u7d20\u3092\u4e2d\u5fc3\u3068\u3057\u305f\u3001\u534a\u5f8410\u306e\u5186\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>\t(foreach item MidPtL\r\n\t\t(command \"._circle\" item 10)\r\n\t)<\/code><\/pre>\r\n<p>\u3053\u308c\u3067\u4f5c\u56f3\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\r\n<h3 class=\"styled_h3\">\u30e6\u30fc\u30b6\u30fc\u306eCAD\u8a2d\u5b9a\u3092\u5fa9\u5143\u3059\u308b\u30d1\u30fc\u30c8\uff08\u6bce\u56de\u540c\u3058\uff09<\/h3>\r\n<pre class=\"wp-block-code\"><code>\t(A_end)\r\n\t(setq *error* nil)\r\n\t(princ)\r\n)\r\n;\u30ed\u30fc\u30c9\u3057\u305f\u3089\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304f\r\n(test)<\/code><\/pre>\r\n<h2 class=\"styled_h2\">\u95a2\u6570<\/h2>\r\n<p>\u7df4\u7fd2\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u305d\u3063\u3066\u3001\u51fa\u3066\u304f\u308b\u95a2\u6570\u3092\u9806\u756a\u306b\u307f\u3066\u3044\u304d\u307e\u3059\u3002\u305d\u306e\u306a\u304b\u3067\u95a2\u9023\u3059\u308b\u95a2\u6570\u3092\u7d39\u4ecb\u3057\u3001\u306a\u308b\u3079\u304f\u30b0\u30eb\u30fc\u30d7\u3067\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\r\n<h3 class=\"styled_h3\">defun \u30c7\u30d5\u30a1\u30f3 ( defun AAA\u3000(\u3000BB CC\u3000\/\u3000DD EE FF\u3000)\uff09<\/h3>\r\n<p>define function \uff08\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\uff09\u306e\u7565\u3067\u3001defun\u3001\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(defun AAA\u3000(\u3000BB CC\u3000\/\u3000DD EE FF\u3000\uff09\r\n\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u5473\r\n\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u5473\r\n\u3000\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e2d\u5473\r\n\uff09<\/code><\/pre>\r\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002<br \/>AAA\u3000\u306b\u306f\u597d\u304d\u306a\u95a2\u6570\u540d\u3092\u5165\u308c\u307e\u3059\u3002<br \/>\u7279\u5225\u306a\u6c7a\u307e\u308a\u304c\u3042\u308a\u3001c:AAA\u3068\u3044\u3046\u3088\u3046\u306b\u3001c:\u3092\u4ed8\u3051\u308b\u3068\u3001AutoCAD\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u201dAAA\u201d\u3068\u6253\u3061\u8fbc\u3093\u3067\u3001\u76f4\u63a5\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>AutoLISP\u95a2\u6570\u304b\u3089\u4e00\u6b69\u98db\u3073\u51fa\u3057\u3001AutoCAD\u95a2\u6570\u306b\u683c\u4e0a\u3052\u3055\u308c\u305f\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002<br \/>c:\u3092\u4ed8\u3051\u305a\u306b AAA\u306e\u307e\u307e\u306e\u5834\u5408\u3001AutoLISP\u306e\u4e2d\u3067\u3057\u304b\u4f7f\u3048\u307e\u305b\u3093\u306e\u3067\u3001AutoLISP\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u306b<br \/>(AAA)<br \/>\u3068\u66f8\u3044\u3066\u547c\u3073\u51fa\u3059\u304b\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u30ab\u30c3\u30b3\u4ed8\u304d\u3067(AAA)\u3068\u66f8\u3044\u3066\u547c\u3073\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3063\u3068\u3082\u3001\u305d\u306e\u524d\u306b\u3001\u30ed\u30fc\u30c9\u3068\u3044\u3063\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u3092AutoCAD\u306b\u8aad\u307e\u305b\u3066\u304a\u304b\u306a\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u30ed\u30fc\u30c9\u3055\u305b\u308b\u306b\u306f\u3001\u305d\u306eLISP\u30d5\u30a1\u30a4\u30eb\u3092AutoCAD\u4e0a\u306b\u30c9\u30e9\u30c3\u30b0\u3055\u305b\u308c\u3070\u3088\u3044\u3067\u3059\u3002<br \/>BB\u3000CC\u3000\u306f\u5f15\u6570\u3092\u8a18\u8ff0\u3059\u308b\u3068\u3053\u308d\u3002\u305d\u306e\u95a2\u6570\u304c\u5f15\u6570\u3092\u5fc5\u8981\u3068\u3057\u306a\u3044\u306a\u3089\u3001\u7a7a\u6b04\u3068\u3057\u3001\u5fc5\u8981\u3068\u3059\u308b\u306a\u3089\u305d\u306e\u5f15\u6570\u3092\u4e26\u3079\u3066\u8a18\u8ff0\u3057\u307e\u3059\u3002\u5f15\u6570\u3068\u306f\u3001\u82f1\u8a9e\u3067\u8a00\u3046\u76ee\u7684\u8a9e\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(defun test (bb cc \/ dd)\r\n\t(setq dd (* bb cc))\r\n\tdd\r\n)<\/code><\/pre>\r\n<p>\u3053\u306e\u4f8b\u306f\u3001aa bb\u3068\u3044\u3046\uff12\u3064\u306e\u6570\u5024\u3092\u4e0e\u3048\u308c\u3070\u3001\u305d\u308c\u3089\u3092\u639b\u3051\u7b97\u3057\u3066\u3001cc\u3068\u3044\u3046\u6570\u5024\u3092\u8fd4\u3059\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<br \/>\u4f7f\u3046\u3068\u304d\u306b\u306f\u3001<br \/>(test 10 20)<br \/>\u3068\u3044\u3046\u3088\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002<br \/>\u5f15\u6570\u306e\u6570\u304c\u8db3\u308a\u306a\u304f\u3066\u3001<br \/>(test 10)<br \/>\u306a\u3069\u3068\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u5f15\u6570\u304c\u8db3\u308a\u307e\u305b\u3093\uff01\u3068\u6012\u3089\u308c\u3001\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\u307e\u305f\u3001c:AAA\u306e\u3088\u3046\u306b\u3001AutoCAD\u95a2\u6570\u306b\u683c\u4e0a\u3052\u3092\u884c\u3063\u305f\u5834\u5408\u306f\u3001\u3053\u306e\u5f15\u6570\u306f\u306a\u3057\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\u305d\u3046\u3044\u3048\u3070\u3001trim\u3084\u3001copy\u306a\u3069\u3001AutoCAD\u306e\u95a2\u6570\u3067\u5f15\u6570\u3092\u5fc5\u8981\u3068\u3059\u308b\u95a2\u6570\u306f\u3072\u3068\u3064\u3082\u3042\u308a\u307e\u305b\u3093\u306d\u3002<br \/>AutoLISP\u3092\u81ea\u4f5c\u3057\u3066\u3044\u308b\u3068\u3001\u4f55\u5ea6\u3082\u4f7f\u3046\u95a2\u6570\u304c\u3069\u3093\u3069\u3093\u5897\u3048\u3066\u304d\u307e\u3059\u3002<br \/>\u4f8b\u3048\u3070\u3001<\/p>\r\n<ol>\r\n<li>\u76f4\u7dda\u3068\u70b9\u306e\u8ddd\u96e2\u3092\u6c42\u3081\u308b\u95a2\u6570<\/li>\r\n<li>\u7dda\u5206\u3068\u7dda\u5206\u306e\u4ea4\u70b9\u3092\u6c42\u3081\u308b\u95a2\u6570<\/li>\r\n<li>\u70b9\u3000\u70b9\u3000\u30ec\u30a4\u30e4\u30fc\u3000\u3067\u7dda\u5206\u3092\u4f5c\u6210\u3059\u308b\u95a2\u6570<\/li>\r\n<li>\u6587\u5b57\u5217\u3092\u3076\u3064\u5207\u308a\u306b\u3057\u3066\u30ea\u30b9\u30c8\u306b\u3059\u308b\u95a2\u6570<\/li>\r\n<li>\u9006\u306b\u30ea\u30b9\u30c8\u3092\u3064\u306a\u3052\u3066\u6587\u5b57\u5217\u306b\u3059\u308b\u95a2\u6570<\/li>\r\n<\/ol>\r\n<p>\u306a\u3069\u306a\u3069\u3067\u3059\u3002<br \/>DD EE FF\u306e\u90e8\u5206\u306f\u3001\u305d\u306e\u95a2\u6570\u306e\u4e2d\u3067\u3060\u3051\u4f7f\u3046\u3001\u4f7f\u3044\u6368\u3066\u5909\u6570\u3092\u5217\u8a18\u3057\u307e\u3059\u3002<br \/>\u3053\u3053\u306b\u66f8\u304b\u308c\u305f\u4f7f\u3044\u6368\u3066\u5909\u6570\u306f\u3001\u95a2\u6570\u306e\u7d42\u4e86\u3068\u540c\u6642\u306b\u3001\u3059\u3079\u3066nil\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002<br \/>nil\u3068\u3044\u3046\u306e\u306f\u3001\u4f55\u306b\u3082\u7121\u3057\u30020\u3067\u3059\u3089\u306a\u3044\u3001\u7121\u306e\u72b6\u614b\u3067\u3059\u3002<br \/>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f55\u5ea6\u3082\u66f8\u304d\u76f4\u3057\u3066\u3044\u308b\u9014\u4e2d\u306f\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u307b\u307c\u5b8c\u6210\u3057\u305f\u9803\u306b\u306f\u3001\u5168\u3066\u306e\u5909\u6570\u3092\u3053\u3053\u306b\u5217\u8a18\u3057\u307e\u3059\u3002<br \/>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u540c\u3058\u5909\u6570\u540d\u3092\u5225\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u4f7f\u7528\u3057\u305f\u3068\u304d\u306e\u4e0d\u5177\u5408\u3092\u9632\u6b62\u3057\u307e\u3059\u3002<br \/>\u3053\u3053\u306b\u610f\u56f3\u7684\u306b\u8a18\u8ff0\u3057\u306a\u3044\u5909\u6570\u306f\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u3068\u547c\u3070\u308c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d42\u4e86\u3057\u3066\u3082nil\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u305b\u3093\u306e\u3067\u3001\u5225\u306e\u95a2\u6570\u3067\u305d\u306e\u5909\u6570\u3092\u518d\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5897\u3048\u3066\u304f\u308b\u3068\u30b0\u30ed\u30fc\u30d0\u30eb\u95a2\u6570\u3082\u5897\u3048\u3066\u304f\u308b\u3068\u601d\u308f\u308c\u307e\u3059\u304c\u3001\u4f55\u304c\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306a\u306e\u304b\u3001\u3057\u3063\u304b\u308a\u899a\u3048\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\r\n<h3 class=\"styled_h3\">\u3088\u304f\u3042\u308b\u5931\u6557<\/h3>\r\n<p>\u4f7f\u3044\u6368\u3066\u95a2\u6570\u306f\u3001\u79c1\u3082\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5b8c\u6210\u3059\u308b\u307e\u3067\u3001\u307b\u3068\u3093\u3069\u66f8\u304d\u307e\u305b\u3093\u3002<br \/>\u305d\u308c\u306f\u3001\u307b\u3068\u3093\u3069\u306e\u95a2\u6570\u304c<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq aaa (\u306a\u3093\u3061\u3083\u3089\u304b\u3093\u3061\u3083\u3089))\r\n<\/code><\/pre>\r\n<p>\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u5f37\u5236\u7684\u306b\u5024\u3092\u5165\u529b\u3055\u308c\u308b\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u306a\u306e\u3067\u3001\u305d\u308c\u4ee5\u524d\u306b\u4f55\u306e\u5024\u304c\u5165\u3063\u3066\u3044\u3088\u3046\u304c\u3001\u95a2\u4fc2\u306a\u3044\u306e\u3067\u3059\u3002\u3068\u3053\u308d\u304c\u3001\u3072\u3068\u3064\u3060\u3051\u5fc5\u305a\u5931\u6557\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\r\n<pre class=\"wp-block-code\"><code>(setq theList (cons newAtom theList))<\/code><\/pre>\r\n<p>\u306e\u3088\u3046\u306b\u3001\u81ea\u5206\u81ea\u8eab\u306b\u4f55\u304b\u3092\u52a0\u3048\u3066\u3044\u304f\u3088\u3046\u306a\u5834\u5408\u3067\u3059\u3002<br \/>\u3053\u308c\u3060\u3068\u3001\u3069\u3093\u3069\u3093\u3001\u3069\u3093\u3069\u3093\u5909\u6570\u306e\u4e2d\u5473\u304c\u9577\u304f\u306a\u3063\u3066\u3001\u3068\u3093\u3067\u3082\u306a\u3044\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\u306a\u306e\u3067\u3001cons\u3000\u3084append\u3092\u4f7f\u3063\u3066\u3001\u81ea\u5206\u81ea\u8eab\u306b\u9023\u7d50\u3059\u308b\u3068\u304d\u306f\u3001\u305f\u3068\u3048\u30d7\u30ed\u30b0\u30e9\u30e0\u4f5c\u6210\u4e2d\u3067\u3042\u3063\u3066\u3082\u3001\u4f7f\u3044\u6368\u3066\u5909\u6570\u3068\u3057\u3066\u5ba3\u8a00\u3057\u3066\u30ea\u30bb\u30c3\u30c8\u3092\u304b\u3051\u308b\u304b\u3001\u3082\u3057\u304f\u306f\u660e\u793a\u7684\u306b<br \/>(setq theList nil)<br \/>\u3068\u76f4\u524d\u306b\u5165\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\r\n<h3 class=\"styled_h3\">ssget<\/h3>\r\n<p>ssget\u306f\u30e6\u30fc\u30b6\u30fc\u306b\u56f3\u5f62\u3092\u9078\u629e\u3055\u305b\u308b\u91cd\u8981\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u30d5\u30a7\u30f3\u30b9\u9078\u629e\u306a\u3069\u306e\u9078\u629e\u30aa\u30d7\u30b7\u30e7\u30f3\u3084\u3001\u9078\u629e\u3059\u308b\u56f3\u5f62\u306e\u7a2e\u985e\u3092\u9650\u5b9a\u3067\u304d\u308b\u30d5\u30a3\u30eb\u30bf\u30fc\u306a\u3069\u3001\u6a5f\u80fd\u6e80\u8f09\u3067\u3001\u7d50\u69cb\u3059\u3054\u3044\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\r\n<ol>\r\n<li>\u7279\u5b9a\u306e\u7a2e\u985e\u306e\u56f3\u5f62\u3060\u3051\u3092\u9078\u629e\u3055\u305b\u308b<br \/>(ssget \u2018((0 . \u201cDIMENSION\u201d))))<\/li>\r\n<li>\u7279\u5b9a\u306e\u7a2e\u985e\u306e\u56f3\u5f62\u3060\u3051\u3092\u9078\u629e\u3055\u305b\u308b\uff08OR\uff09<br \/>(ssget \u2018((-4 . \u201c&lt;OR\u201d)(0 . \u201cARC\u201c)(0 . \u201cCIRCLE\u201c)(0 . \u201cINSERT\u201c)(0 . \u201cLEADER\u201c)(-4 . \u201cOR&gt;\u201d)))<br \/>\u3082\u3057\u304f\u306f<br \/>(ssget \u2018((0 . \u201cARC,CIRCLE,INSERT,LEADER\u201d))<br \/>\u3060\u3051\u3067\u3082\u52d5\u304d\u307e\u3059\u3002<\/li>\r\n<li>\u7279\u5b9a\u306e\u7a2e\u985e\u306e\u56f3\u5f62\u3060\u3051\u3092\u9078\u629e\u3055\u305b\u308b\uff08AND\uff09<br \/>\u8907\u5408\u56f3\u5f62\u304b\u3064(66 . 1)\uff08\uff1d\u5c5e\u6027\u5b9a\u7fa9\uff09\u3060\u3051\u3092\u9078\u629e\u3059\u308b\u5834\u5408<br \/>(ssget \u2018((-4 . \u201c&lt;AND\u201d)(0 . \u201cINSERT\u201d)(66 . 1)(-4 . \u201cAND&gt;\u201d)))<\/li>\r\n<li>\u30d5\u30a3\u30eb\u30bf\u30fc\u306b\u201d*\u201d\u304c\u4f7f\u3048\u308b<br \/>\u201c*line\u201d\u3068\u3044\u3046\u3088\u3046\u306b\u3057\u3066\u3001LINE, LWPOLYLINE, POLYLINE, XLINE\u3092\u9078\u629e\u3055\u305b\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>(ssget \u2018((0 . \u201c*LINE\u201d)))<\/li>\r\n<li>\u56f3\u9762\u5168\u4f53\u306e\u4e2d\u304b\u3089\u9078\u629e<br \/>\u5b58\u5728\u3059\u308b\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5168\u3066\u9078\u629e\u3055\u305b\u308b<br \/>(ssget \u201cx\u201d \u2018((0 . \u201cVIEWPORT\u201d)))<\/li>\r\n<li>\u3042\u3089\u304b\u3058\u3081\u70b9\u3092\u53ce\u7d0d\u3057\u3066\u304a\u304d\u3001\u30af\u30ed\u30b9\u3067\u9078\u629e<br \/>(ssget \u201c_C\u201d Pt1 Pt2 \u2018((0 . \u201cLINE\u201d)))<\/li>\r\n<\/ol>\r\n<h3 class=\"styled_h3\">mapcar \u3068 lambda<\/h3>\r\n<p>\u96e3\u3057\u3044\u3068\u3044\u308f\u308c\u308bmapcar\u3068lambda\u3068\u3044\u3046\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3067\u3059\u3002<br \/>\u3044\u304f\u3089\u30b0\u30b0\u3063\u3066\u3082\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3057\u3066\u3044\u308b\u6587\u66f8\u304c\u7121\u304f\u3001\u5f53\u7136\u3001\u66f8\u7c4d\u306b\u3082\u8a18\u8f09\u304c\u7121\u304f\u3001\u79c1\u3082\u7406\u89e3\u306b\u306f\u3059\u3054\u304f\u82e6\u52b4\u3057\u307e\u3057\u305f\u3002<br \/>\u3057\u304b\u3057\u3001\u4e00\u65e6\u7406\u89e3\u3059\u308b\u3068\u3001\u975e\u5e38\u306b\u4fbf\u5229\u306a\u95a2\u6570\u3067\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u884c\u6570\u304c\u7701\u3051\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u304a\u305d\u3089\u304f\u51e6\u7406\u30b9\u30d4\u30fc\u30c9\u3082\u3001\u307b\u3093\u306e\u3061\u3087\u3063\u3068\u3042\u304c\u308b\u306e\u3067\u306f\u306a\u3044\u304b\u3001\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\r\n<p>\u25a0mapcar\u3068lambda\u306e\u52b9\u7528<br \/>mapcar\u3068lambda\u306f\u3001\u305f\u3068\u3048\u308b\u3068\u3001\u300c5\u500b\u306e\u5c0f\u9ea6\u7c89\u304b\u30895\u500b\u306e\u30b1\u30fc\u30ad\u3092\u9023\u7d9a\u7684\u306b\u4f5c\u308b\u300d\u3068\u3044\u3046\u95a2\u6570\u3067\u3059\u3002<br \/>\u305d\u306e\u30b1\u30fc\u30ad\u306e\u4f5c\u308a\u65b9\u3092\u8aac\u660e\u3059\u308b\u95a2\u6570\u90e8\u5206\u304clambda\u3067\u3059\u3002<br \/>\u4f3c\u305f\u3088\u3046\u306a\u7e70\u308a\u8fd4\u3057\u52d5\u4f5c\u3092\u3059\u308b\u95a2\u6570\u306b\u3001foreach \u3084 repeat \u95a2\u6570\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306b\u6bd4\u3079\u3001\u884c\u6570\u304c\u304b\u306a\u308a\u6e1b\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\r\n<p><br \/>\u25a0\u5b9f\u969b\u306e\u66f8\u304d\u65b9<br \/>\u5b9f\u969b\u306e\u95a2\u6570\u306e\u5f62\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002\u4f8b\u3068\u3057\u3066\u30011 5 7 3 8\u3068\u3044\u3046\u5404\u6570\u5b57\u306b5\u3092\u52a0\u3048\u308b\u64cd\u4f5c\u3067\u3059\u3002<br \/>(setq MyList (mapcar &#8216;(lambda(x)(+ x 5))(list 1 5 7 3 8 )))<br \/>\u2192(6 10 12 8 13)<br \/>\u3053\u308c\u306f\u3053\u306e\u3088\u3046\u306b\u8aad\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>(setq \u30b1\u30fc\u30ad5\u30bb\u30c3\u30c8 (mapcar \u2018(lambda(x)(\u30b1\u30fc\u30ad\u306e\u30ec\u30b7\u30d4\u3092x\u3092\u4f7f\u3063\u3066\u8aac\u660e))(\u5c0f\u9ea6\u7c895\u30bb\u30c3\u30c8)))<\/p>\r\n<p>\u3044\u304f\u3064\u304b\u306e\u30dd\u30a4\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\u307e\u305a\u3001mapcar\u3068lambda\u306f5\u3064\u306e\u5177\u304b\u30895\u3064\u306e\u6210\u679c\u54c1\u3092\u4f5c\u308b\u95a2\u6570\u3067\u3042\u3063\u3066\u30015\u3064\u306e\u5177\u304b\u30891\u500b\u306e\u6210\u679c\u54c1\u3092\u4f5c\u308b\u95a2\u6570\u3067\u306f\u306a\u3044\u3002\u3064\u307e\u308a\u6750\u6599\u304c 5\u3064\u3042\u308c\u3070\u3001\u7d50\u679c\u30825\u3064\u3067\u3059\u3002\u305d\u308c\u304c\u30ea\u30b9\u30c8\u306b\u3072\u3068\u307e\u3068\u307e\u308a\u306b\u306a\u3063\u3066\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002\u306a\u306e\u3067\u30011 5 7 3 8\u3092\u5168\u90e8\u52a0\u3048\u305f\u6570\u3092\u77e5\u308a\u305f\u3044\u3001\u3068\u3044\u3046\u3068\u304d\u306fmapcar\u3068lambda\u3067\u306f\u306a\u304f\u3001apply\u3068\u3044\u3046\u95a2\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002\u3053\u306e\u70b9\u304c\u3001\u6df7\u540c\u3057\u3084\u3059\u3044\u70b9\u3067\u3059\u3002<br \/>(setq MyList (mapcar \u2018(lambda(x)( \u307e\u3067\u306f\u8003\u3048\u305a\u306b\u3068\u306b\u304b\u304f\u66f8\u304f\u3002<br \/>\u2018(lambda\u306e\u3088\u3046\u306b\u3001\u30a2\u30dd\u30b9\u30c8\u30ed\u30d5\u30a3\u304c\u3064\u3044\u3066\u3044\u3066\u3001\u3053\u306e\u610f\u5473\u306f\u4f55\u3060\u308d\u3046\u3001\u3068\u6c17\u306b\u306a\u3063\u3066\u8abf\u3079\u305f\u308a\u3059\u308b\u3068\u30c9\u30c4\u30dc\u306f\u307e\u308a\u307e\u3059\u3002<br \/>\u3061\u306a\u307f\u306b\u5f0f\u306e\u4e2d\u3067\u4f7f\u3046\u5909\u6570\u304c\u5c0f\u9ea6\u7c89\u3060\u3051\u3001\u3068\u3044\u3046\u3088\u3046\u306b1\u7a2e\u985e\u306a\u3089lambda(x)\u3067\u3059\u304c\u3001\u300c\u5c0f\u9ea6\u7c89\u3068\u5375\u300d\u3068\u3044\u3046\u3088\u3046\u306b2\u3064\u306e\u5834\u5408\u306flambda(x y)\u3068\u66f8\u304f\u3060\u3051\u3067\u3059\u3002<br \/>\u305d\u306e\u5f8c\u306b\u7d9a\u304f\u306e\u306f\u3001\u30b1\u30fc\u30ad\u306e\u30ec\u30b7\u30d4\uff1d\u300c\u5b9f\u884c\u3059\u308b\u95a2\u6570\u300d\u3067\u3059\u304c\u3001\u4f55\u884c\u306b\u308f\u305f\u3063\u3066\u3082OK\u3002\u3068\u306b\u304b\u304f\u3001x\u3092\u4f7f\u3063\u305f\u5f62\u3067\u3001\u666e\u901a\u306eLISP\u5f62\u5f0f\u3067\u5f0f\u3092\u4e26\u3079\u308c\u3070\u3088\u3044\u3002\u9014\u4e2d\u306bif\u6587\u304c\u3042\u308d\u3046\u304c\u3001cond\u6587\u304c\u3042\u308d\u3046\u304c\u304b\u307e\u3044\u307e\u305b\u3093\u3002<br \/>\u6700\u5f8c\u306b\u3001\u8a08\u7b97\u306e\u6750\u6599\u3068\u306a\u308b(list 1 5 7 3 8 )\u3092\u7d9a\u3051\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u307e\u3048\u306b\u3001\u62ec\u5f27\u304c\u304d\u3061\u3093\u3068\u3042\u3063\u3066\u3044\u308b\u304b\u304c\u91cd\u8981\u3067\u3059\u3002\u3064\u307e\u308a\u3001\u8a08\u7b97\u306e\u6750\u6599\u3068\u306a\u308b(list 1 5 7 3 8 )\u3092\u7d9a\u3051\u308b\u524d\u306b\u3001\u2018(lambda\u306b\u5bfe\u5fdc\u3059\u308b\u62ec\u5f27\u3092\u7d42\u308f\u3089\u305b\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u666e\u901a\u306f\u3001LISP\u30a8\u30c7\u30a3\u30bf\u30fc\u3084\u3001\u79c0\u4e38\u306a\u3069\u306e\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u4f7f\u3063\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u306e\u3067\u3001\u3044\u3061\u3044\u3061\u62ec\u5f27\u306e\u6570\u3092\u6570\u3048\u308b\u4eba\u306f\u3044\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001(+ x 5))\u306e\u6700\u5f8c\u306e\u62ec\u5f27\u306f\u3001\u2018(lambda\u306e\u62ec\u5f27\u304c\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u308b\u307e\u3067\u5165\u529b\u3055\u305b\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002mapcar\u3068lambda\u5f0f\u306e\u30a8\u30e9\u30fc\u306f\u307b\u3068\u3093\u3069\u3001\u3053\u3053\u306e\u62ec\u5f27\u306e\u4e0d\u4e00\u81f4\u3067\u8d77\u304d\u307e\u3059\u3002<br \/>\u6700\u5f8c\u306b\u3084\u3063\u3068\u8a08\u7b97\u306e\u6750\u6599\u3068\u306a\u308b(list 1 5 7 3 8 )\u3092\u66f8\u304d\u3001\u3042\u3068\u306f\u3001(setq \u306b\u5bfe\u3059\u308b\u62ec\u5f27\u304c\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u308b\u307e\u3067\u62ec\u5f27\u3092\u5fc5\u8981\u306a\u3060\u3051\u5165\u308c\u3066\u7d42\u308f\u308a\u3002<\/p>\r\n<p>\u25a0\u96e3\u3057\u30442\u91cdmapcar<br \/>L1= (((A (2 3)) (A (3 5))) ((B (1 3)) (B (7 9)) (B (5 1))) ((C (4 7)) (C (4 1))))<br \/>\u3068\u3044\u3046\u30ea\u30b9\u30c8\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3001\u305d\u306e\u982d\u306e\u90e8\u5206\u3060\u3051\u3092\u53d6\u308a\u51fa\u3057\u3066\u3001((A A)(B B B)(C C))\u3068\u3044\u3046\u30ea\u30b9\u30c8\u3092\u5f97\u305f\u3044\u3068\u304d\u3001\u3053\u308c\u306f\u304b\u306a\u308a\u982d\u304c\u3054\u3061\u3083\u3054\u3061\u3083\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u30012\u91cdmapcar\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<br \/>\u307e\u305a((A (2 3)) (A (3 5)))\u3068\u3044\u3046\u3068\u3053\u308d\u3060\u3051\u306b\u7740\u76ee\u3057\u3001\u3053\u3053\u304b\u3089(A A)\u3092\u53d6\u308a\u51fa\u3059\u5f0f\u3092\u8003\u3048\u3001\u305d\u308c\u3092\u5168\u4f53\u306bmapcar\u3055\u305b\u308b\u3068\u3044\u3046\u624b\u9806\u306b\u306a\u308a\u307e\u3059\u3002<br \/>x=((A (2 3)) (A (3 5)))\u304b\u3089(A A)\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f<br \/>(mapcar \u2018car x)<br \/>\u3053\u308c\u3092\u5168\u4f53\u306b\u7e70\u308a\u8fd4\u3059\u306e\u3067<br \/>(mapcar \u2018(lambda(x) (mapcar \u2018car x)) L1)<br \/>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\r\n<p>\u25a0\u3055\u3089\u306b\u96e3\u3057\u30442\u91cdmapcar<br \/>L1=(((1 2) (2 3)) ((3 5) (6 2)) ((3 6) (3 1)))<br \/>\u3068\u3044\u3046\u3088\u3046\u306a6\u500b\u306e\u70b9\u306e\u5ea7\u6a19\u304c\u3001\u5909\u5247\u7684\u306a\u30ea\u30b9\u30c8\u306b\u306a\u3063\u305f\u3082\u306e\u304c\u3042\u3063\u305f\u3068\u3057\u3066\u3001\u3053\u308c\u3089\u306e\u70b9\u5168\u90e8\u306b\u5bfe\u3057\u3001\u4f55\u304b\u306e\u64cd\u4f5c\u3092\u3057\u305f\u3044\u3068\u304d\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<br \/>\u7c21\u5358\u306e\u305f\u3081\u3001\u70b9\u3092\u4e2d\u5fc3\u306b\u5186\u3092\u66f8\u304f\u95a2\u6570\u3092(MyCircle \u70b9)\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u3059\u308b\u3068\u3001<br \/>(mapcar \u2018(lambda (y) (mapcar \u2018(lambda(x) (MyCircle x)) y )) L1)<br \/>\u3068\u306a\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u3053\u3053\u307e\u3067\u304f\u308b\u3068\u306a\u304b\u306a\u304b\u76f4\u611f\u3067\u306f\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u305a\u3001\u304b\u306a\u308a\u8a66\u884c\u932f\u8aa4\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\u3046\u307e\u304f\u52d5\u3044\u305f\u3068\u304d\u306f\u3001\u3069\u3053\u304b\u306b\u30e1\u30e2\u3063\u3066\u304a\u3044\u305f\u307b\u3046\u304c\u3044\u3044\u3067\u3059\u306d\u3002<\/p>\r\n<h3 class=\"styled_h3\">quote\u306e\u4f7f\u3044\u65b9<\/h3>\r\n<p>\u25a0 \u2018(\u30a2\u30dd\u30b9\u30c8\u30ed\u30d5\u30a3)\u306b\u3088\u308b\u3001quote\u306e\u4f7f\u3044\u65b9<br \/>\u4f8b\u3068\u3057\u3066<br \/>L1=(1 2 3)<br \/>L2=(4 5 6)<br \/>\u306e\u3068\u304d\u306b\u3001\u305d\u308c\u305e\u308c\u306e\u8981\u7d20\u540c\u58eb\u3092\u639b\u3051\u5408\u308f\u305b\u308b\u95a2\u6570\u306f<br \/>(mapcar &#8216;(lambda(x y)(* x y)) &#8216;(1 2 3) &#8216;(4 5 6))<br \/>(mapcar &#8216;(lambda(x y)(* x y)) L1 L2)<br \/>\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001\u95a2\u6570\u90e8\u5206(* x y)\u304c\u3001\u201d*\u201d\u3068\u3044\u3046\u95a2\u6570\u3068x\u3001y\u3068\u3044\u3046\u5909\u6570\u4ee5\u5916\u306b\u4f55\u3082\u7121\u3044\u5834\u5408\u306b\u9650\u3063\u3066\u3001<br \/>(mapcar &#8216;* L1 L2)<br \/>\u3068\u8a00\u3046\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\u307b\u304b\u306b\u306f<br \/>(mapcar &#8216;(lambda(x)(car x)) L1)\u3000\u306f\u3000(mapcar &#8216;car L1)<br \/>(mapcar &#8216;(lambda(x)(print x)) L1)\u3000\u306f\u3000(mapcar &#8216;print L1)<br \/>lambda\u3092\u7406\u89e3\u3057\u305f\u3044\u3068\u304d\u306b\u3001\u2019(quote)\u3092\u4f7f\u3063\u305f\u5f0f\u3068lambda\u3092\u4f7f\u3063\u305f\u5f0f\u3092\u540c\u6642\u306b\u898b\u305b\u3089\u308c\u3066\u3057\u307e\u3046\u3068\u3001\u975e\u5e38\u306b\u6df7\u4e71\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u79c1\u306f\u3042\u304f\u307e\u3067lambda(x)(x\u306e\u5f0f)\u3092\u6700\u521d\u306b\u7406\u89e3\u3057\u3001\u305d\u306e\u3042\u3068\u3067\u7279\u6b8a\u306a\u5834\u5408\u306b\u306e\u307f\u2019(quote)\u3092\u4f7f\u3063\u305f\u5f0f\u3092\u4f7f\u3048\u308b\u3001\u3068\u7406\u89e3\u3057\u305f\u307b\u3046\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u2019(quote)\u306b\u306f\u3001\u300c\u305d\u306e\u5f8c\u306b\u7d9a\u304f\u6587\u5b57\u3092\u8a55\u4fa1\u305b\u305a\u306b\u305d\u306e\u307e\u307e\u5f15\u7528\u3059\u308b\u300d\u307f\u305f\u3044\u306a\u610f\u5473\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u305d\u3093\u306a\u8aac\u660e\u3092\u805e\u3044\u3066\u3082\u3055\u3063\u3071\u308a\u308f\u304b\u3089\u306a\u3044\u3067\u3059\u3002\uff09<br \/>\u7279\u306b<br \/>(mapcar &#8216;print List)<br \/>\u306f\u3001\u5404\u8981\u7d20\u3092\u3001\u6539\u884c\u3057\u306a\u304c\u3089\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306b\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u3084\u3084\u3053\u3057\u3044\u30ea\u30b9\u30c8\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3068\u304d\u306b\u306f\u3001\u3068\u3066\u3082\u91cd\u5b9d\u3057\u307e\u3059\u3002<\/p>\r\n<h2 class=\"styled_h2\">\u3068\u306b\u304b\u304f\u30d1\u30bf\u30fc\u30f3\u5316<\/h2>\r\n<p><br \/>AutoLISP\u3092\u4f55\u500b\u3082\u4f5c\u3063\u3066\u3044\u304f\u3068\u6c17\u3065\u304f\u306e\u3067\u3059\u304c\u3001\u56f3\u5f62\u3092\u9078\u629e\u2192\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u306f\u6570\u7a2e\u985e\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\u3068\u306b\u304b\u304f\u30d1\u30bf\u30fc\u30f3\u3092\u305f\u304f\u3055\u3093\u3064\u304f\u3063\u3066\u3001\u3042\u3068\u306f\u305d\u308c\u306e\u30b3\u30d4\u30da\u3092\u3059\u308b\u3002\u305d\u308c\u304c\u65e9\u9053\u3067\u3059\u3002<br \/>\u4e0b\u8a18\u304c\u56f3\u5f62\u9078\u629e\u306b\u304a\u3051\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\r\n<ol>\r\n<li>ssget\u3084entsel\u3067Obj\u3092\u6307\u5b9a\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u7d42\u308f\u308b\u30d1\u30bf\u30fc\u30f3<\/li>\r\n<li>ssget\u3084entsel\u3067Object\u3092\u305f\u3081\u8fbc\u3093\u3067\u3001\u53f3\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u30d1\u30bf\u30fc\u30f3<\/li>\r\n<li>Entsel\u3067\u4e00\u3064\u9078\u629e\u3055\u308c\u308b\u3054\u3068\u306bProcedure\u3092\u5b9f\u884c\u3057\u3001\u53f3\u30af\u30ea\u30c3\u30af\u3055\u308c\u308b\u307e\u3067\u7d9a\u304f\u30d1\u30bf\u30fc\u30f3<\/li>\r\n<li>Entsel\u3067\u56f3\u5f62\u3092\uff11\u500b\u9078\u629e\u3057\u305f\u77ac\u9593\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u7d42\u308f\u308b\u30d1\u30bf\u30fc\u30f3<\/li>\r\n<\/ol>\r\n<pre class=\"wp-block-code\"><code>\r\n;1 ssget\u3084entsel\u3067Obj\u3092\u6307\u5b9a\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u7d42\u308f\u308b\u30d1\u30bf\u30fc\u30f3\r\n(defun c:Test1( \/ ObjSet ObjNameL i)\r\n\t(load \"A_Utility\")\r\n\t(setq *error* *myerror*)\r\n\t(A_start)\r\n\r\n\t(setq ObjSet nil)\r\n\t(while (= ObjSet nil)\r\n\t(setq ObjSet (ssget '((-4 . \"\"))))\r\n\t)\r\n\t;\u9078\u629e\u30bb\u30c3\u30c8\u304b\u3089\u56f3\u5f62\u540d\u306e\u30ea\u30b9\u30c8\u4f5c\u6210\r\n\t(setq i -1)\r\n\t(repeat (sslength ObjSet)\r\n\t\t(setq ObjNameL (cons  (ssname ObjSet (setq i (1+ i))) ObjNameL))\r\n\t)\r\n\t(Procedure1)\r\n\r\n\t(A_end)\r\n\t(setq *error* nil)\r\n\t(princ)\r\n)\r\n\r\n;*****************************************************************\r\n;2 ssget\u3084entsel\u3067\u305f\u3081\u8fbc\u3093\u3067\u3001\u53f3\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u30d1\u30bf\u30fc\u30f3\r\n(defun c:Test2( \/ ObjNameL Flag ObjType)\r\n\t(load \"A_Utility\")\r\n\t(setq *error* *myerror*)\r\n\t(A_start)\r\n\r\n\t(while (null Flag)      ;Flag\u304cT\u306b\u306a\u308b\u307e\u3067\u7d9a\u304f\r\n\t\t(setvar \"ERRNO\" 0)\r\n\t\t(setq ObjName nil ObjType nil)\r\n\t\t(setq ObjName (car (entsel  \"n \u6587\u5b57\u3092\u9078\u629e\uff1a\")))\r\n\t\t(if ObjName (setq ObjType (A_dxf 0 ObjName))(setq Flag nil))\r\n\t\t(cond\t((or (= ObjType \"TEXT\")(= ObjType \"MTEXT\"))\r\n\t\t\t\t\t(princ ObjType)\r\n\t\t\t\t\t(setq ObjNameL (append ObjNameL (list ObjName)))\r\n\t\t\t\t)\r\n\t\t\t\t((= (getvar \"ERRNO\") 52)\r\n\t\t\t\t\t(Procedure1)\r\n\t\t\t\t\t(setq Flag T)\r\n\t\t\t\t)\r\n\t\t)\r\n\t)\r\n\r\n\t(A_end)\r\n\t(setq *error* nil)\r\n\t(princ)\r\n)\r\n;****************************************************************\r\n;3 Entsel\u3067\u4e00\u3064\u9078\u629e\u3055\u308c\u308b\u3054\u3068\u306bProcedure\u3092\u5b9f\u884c\u3057\u3001\r\n;\u53f3\u30af\u30ea\u30c3\u30af\u3055\u308c\u308b\u307e\u3067\u7d9a\u304f\u30d1\u30bf\u30fc\u30f3\r\n(defun c:Test3( \/ Flag ObjName ObjType )\r\n\t(load \"A_Utility\")\r\n\t(setq *error* *myerror*)\r\n\t(A_start)\r\n\r\n\t(while (null Flag)      ;Flag\u304cT\u306b\u306a\u308b\u307e\u3067\u7d9a\u304f\r\n\t\t(setvar \"ERRNO\" 0)\r\n\t\t(setq ObjName nil ObjType nil)\r\n\t\t(setq ObjName (car (entsel  \"n \u6587\u5b57\u3092\u9078\u629e\uff1a\")))\r\n\t\t(if ObjName (setq ObjType (A_dxf 0 ObjName))(setq Flag nil))\r\n\t\t(cond\t((= ObjType \"TEXT\")(Procedure2))\r\n\t\t\t\t((= ObjType \"MTEXT\")(Procedure3))\r\n\t\t\t\t((= (getvar \"ERRNO\") 52)(setq Flag T))\r\n\t\t)\r\n\t)\r\n\r\n\t(A_end)\r\n\t(setq *error* nil)\r\n\t(princ)\r\n)\r\n;********************************************************************\r\n;4 Entsel\u3067\u56f3\u5f62\u3092\uff11\u500b\u9078\u629e\u3057\u305f\u77ac\u9593\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u7d42\u308f\u308b\u30d1\u30bf\u30fc\u30f3\r\n(defun c:Test4()\r\n\t(load \"A_Utility\")\r\n\t(setq *error* *myerror*)\r\n\t(A_start)\r\n\r\n\t(setq Flag nil)\r\n\t(while (null Flag)      ;Flag\u304cT\u306b\u306a\u308b\u307e\u3067\u7d9a\u304f\r\n\t\t(setq ObjName nil ObjType nil)\r\n\t\t(setq ObjName (car (entsel  \"n \u30dd\u30ea\u30e9\u30a4\u30f3\u3092\u9078\u629e\uff1a\")))\r\n\t\t(if ObjName (setq ObjType (A_dxf 0 ObjName))(setq Flag nil))\r\n\t\t(if (= ObjType \"LWPOLYLINE\")(setq Flag T))\r\n\t)\r\n\r\n\t(Procedure4)\r\n\r\n\t(A_end)\r\n\t(setq *error* nil)\r\n\t(princ)\r\n)\r\n;*******************\r\n(defun Procedure1()\r\n\t(princ \"nObjNameL  : \")(princ ObjNameL)\r\n)\r\n;*******************\r\n(defun Procedure2()\r\n\t(princ \"n Procedure2\")\r\n)\r\n;*******************\r\n(defun Procedure3()\r\n\t(princ \"n Procedure3\")\r\n)\r\n;*******************\r\n(defun Procedure4()\r\n\t(princ \"n Procedure4\")\r\n)\r\n(princ)\r\n<\/code><\/pre>\r\n<p><strong>\u25a0\u7a7a\u632f\u308a\u306b\u5bfe\u3057\u3066\u306e\u5bfe\u51e6<br \/><\/strong>entsel\u3067\u56f3\u5f62\u3092\u9078\u629e\u3059\u308b\u3068\u304d\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u56f3\u5f62\u9078\u629e\u306b\u5931\u6557\u3057\u3001\u7a7a\u632f\u308a\u3057\u305f\u5834\u5408\u306b\u3082<strong>\u30a8\u30e9\u30fc\u306b\u306a\u3089\u305a\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d99\u7d9a<\/strong>\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u683c\u6bb5\u306b\u4f7f\u3044\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\u30e6\u30fc\u30b6\u30fc\u306f\u666e\u6bb5\u306f\u901f\u3044\u30b9\u30d4\u30fc\u30c9\u3067\u64cd\u4f5c\u3092\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u591a\u304f\u3001\u7a7a\u632f\u308a\u3059\u308b\u4e8b\u304c\u591a\u3044\u306e\u3067\u3001\u305d\u306e\u305f\u3073\u306b\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u305f\u306e\u3067\u306f\u3001\u4f5c\u696d\u52b9\u7387\u304c\u843d\u3061\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\u4e0a\u8a18\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e3\u756a\u30684\u756a\u3067\u306f\u3001\u7a7a\u632f\u308a\u306b\u5bfe\u3059\u308b\u5bfe\u51e6\u3092\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u3082\u3063\u3068\u304d\u308c\u3044\u306a\u65b9\u6cd5\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff09<\/p>\r\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"AutoLISP\u306e\u4e16\u754c\u306b\u5165\u308b \u3053\u3053\u304b\u3089\u3001AutoLISP\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u306f\u3058\u307e\u308a\u3067\u3059\u3002\u307e\u305a\u3001AutoLISP\u306e\u4e16\u754c\u3092\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u306a\u304c\u3089\u306e\u305e\u3044\u3066\u307f\u307e\u3059\u3002 AutoLISP\u306e\u4e16\u754c\u3092\u8997\u3044\u3066\u307f\u308b AutoCAD\u3067\u3001\u5186\u30fb\u76f4\u7dda\u30fb\u77e9\u5f62\u3092 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[],"class_list":["post-2926","post","type-post","status-publish","format-standard","hentry","category-autolisp-lecture"],"_links":{"self":[{"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts\/2926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/comments?post=2926"}],"version-history":[{"count":19,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts\/2926\/revisions"}],"predecessor-version":[{"id":3050,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts\/2926\/revisions\/3050"}],"wp:attachment":[{"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/media?parent=2926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/categories?post=2926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/tags?post=2926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}