{"id":2092,"date":"2022-09-11T18:03:40","date_gmt":"2022-09-11T09:03:40","guid":{"rendered":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/?p=2092"},"modified":"2022-12-16T04:50:29","modified_gmt":"2022-12-15T19:50:29","slug":"sd_3103","status":"publish","type":"post","link":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/sd_3103\/","title":{"rendered":"[SD_3103] \u89aa\u5b50\u6249"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"312\" height=\"43\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/image-282.png\" alt=\"\" class=\"wp-image-2093\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/image-282.png 312w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/image-282-300x41.png 300w\" sizes=\"auto, (max-width: 312px) 100vw, 312px\" \/><\/figure>\n\n\n\n<p>\u89aa\u5b50\u6249\u3092\u4f5c\u6210\u3059\u308bAutoLISP\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<br>\u958b\u53e3\u30922\u70b9\u6307\u793a\u3057\u305f\u5f8c\u30012\u3064\u306e\u3046\u3061\u306e1\u3064\u306e\u6249\u5dfe\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"218\" height=\"171\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h14_24.png\" alt=\"\" class=\"wp-image-2138\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"329\" height=\"289\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/image-293.png\" alt=\"\" class=\"wp-image-2136\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/image-293.png 329w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/image-293-300x264.png 300w\" sizes=\"auto, (max-width: 329px) 100vw, 329px\" \/><\/figure>\n\n\n\n<p>\u6249\u3092\u4f5c\u6210\u3059\u308b\u5074\u53ca\u3073\u5de6\u53f3\u306e\u958b\u304d\u52dd\u624b\u306f\u3001\u30de\u30a6\u30b9\u306e\u4f4d\u7f6e\u3067\u6c7a\u5b9a\u3057\u307e\u3059\u3002\u30de\u30a6\u30b9\u306e\u4f4d\u7f6e\u306b\u3088\u3063\u3066\u30af\u30eb\u30af\u30eb\u3068\u6249\u304c\u5909\u308f\u308a\u307e\u3059\u306e\u3067\u3001\u5e0c\u671b\u306e\u4f4d\u7f6e\u3067\u6c7a\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"343\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_43.png\" alt=\"\" class=\"wp-image-2140\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_43.png 490w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_43-300x210.png 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"343\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_46.png\" alt=\"\" class=\"wp-image-2142\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_46.png 490w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_46-300x210.png 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"343\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_49.png\" alt=\"\" class=\"wp-image-2143\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_49.png 490w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_49-300x210.png 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"343\" src=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_52.png\" alt=\"\" class=\"wp-image-2144\" srcset=\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_52.png 490w, https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wordpress\/wp-content\/uploads\/2022\/09\/2022-09-13_10h16_52-300x210.png 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">AutoLISP\u30bd\u30fc\u30b9<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\n(defun c:sd_3103 (\/\t\t   ACT\t\tDCL_ID\t FCT\t  DIS1\t   DIS2\n\t\t\t\t  LBL_WIDTH\t\t\t*MODELSPACE*\t  BASEY\t   BLJ\n\t\t\t\t  DIS1\t   DIS2\t\tITSLAYER P1\t\t  P2\t   P3\n\t\t\t\t  P4\t   PLOBJ\tPM\t\t PTLST1\t  PTLST2   PTLST3\n\t\t\t\t  PTLST4   THEANG\tBASEY\t DELTA\t  DIST1\t   DIST2\n\t\t\t\t  P1\t   P2\t\tPT0\t\t PTLST\t  PTLST1   PTLST2\n\t\t\t\t  PTLST3   PTLST4\tPTX\t\t THEANG\t  THEY\t   NEWPOINTL\n\t\t\t\t  POINT\n\t\t\t\t )\n\t(if (= SD:Lang \"E\")\n\t\t(princ \"\\n &#91;SD_3103 ver.20220913] Door (Semi double). Press &#91;F1] for help\")\n\t\t(princ \"\\n &#91;SD_3103 ver.20220913] \u89aa\u5b50\u958b\u304d\u30c9\u30a2\u3002 &#91;F1]\u3067\u4f7f\u3044\u65b9\u8aac\u660e\")\n\t)\n\t(princ \"\\n **********************************\")\n\t(load \"SD_U\")\n\t(OpeningRoutine)\n\t(setfunhelp \"C:SD_3103\" \"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/sd_3103\/\")\n\t\n\t(setq theKeyWord (Get_LAyer \"A41\" T))\n\t(setvar \"osmode\" 33)\n\t(initget 1)\n\t(if (= SD:Lang \"E\")\n\t\t(setq p1 (trans (getpoint \"\\n Pick first point.\") 1 0))\n\t\t(setq p1 (trans (getpoint \"\\n 1\u70b9\u76ee\u3092\u6307\u793a\uff1a \") 1 0))\n\t)\n\t(initget 1)\n\t(if (= SD:Lang \"E\")\n\t\t(setq p2 (trans (getpoint p1 \"\\n Pick second point.\") 1 0))\n\t\t(setq p2 (trans (getpoint p1 \"\\n 2\u70b9\u76ee\u3092\u6307\u793a\uff1a \") 1 0))\n\t)\n\t(show_SD_3103 (distance p1 p2))\n\t(if (= PlanMode \"BasicPlan\")\n\t\t(setq theColor \"ByLayer\")\n\t\t(setq theColor \"5\")\n\t)\n\t(make_3103)\n\n\t(ClosingRoutine)\n\t(setq *error* nil)\n\t(princ)\n)\n ;*******\n(defun make_3103 ()\n;;;\t(setq ItsLayer (nth 2 (SD:LayKey \"DOOR\")))\n  (setq\ttheAng (angle p1 p2)\n\t\tBaseY  (cadr (SD1862 p1 theAng))\n\t\tp3\t   (polar p1 (+ theAng (* 0.5 pi)) dis1)\n\t\tp4\t   (polar p2 (+ theAng (* 0.5 pi)) dis2)\n\t\tpM\t   (polar p1 theAng dis1)\n\t\tptLst1 (PointConvert (list p1 p3 pM p4  p2))\n\t\t\n\t\tp3\t   (polar p1 (+ theAng (* 1.5 pi)) dis1)\n\t\tp4\t   (polar p2 (+ theAng (* 1.5 pi)) dis2)\n\t\tptLst2 (PointConvert (list p1 p3 pM p4  p2))\n\t\t\n\t\tp3\t   (polar p1 (+ theAng (* 0.5 pi)) dis2)\n\t\tp4\t   (polar p2 (+ theAng (* 0.5 pi)) dis1)\n\t\tpM\t   (polar p1 theAng dis2)\n\t\tptLst3 (PointConvert (list p1 p3 pM p4  p2))\n\n\t\tp3\t   (polar p1 (+ theAng (* 1.5 pi)) dis2)\n\t\tp4\t   (polar p2 (+ theAng (* 1.5 pi)) dis1)\n\t\tptLst4 (PointConvert (list p1 p3 pM p4  p2))\n\t\t\n\t\tblj\t   (* -1(getBlj (* pi 0.5)))\n  )\n  \n  (setq OrigColor (getvar \"cecolor\"))\n  (setvar \"clayer\" theKeyWord)\n;  (princ \"\\n theColor :  \")(princ theColor)\n  (setvar \"cecolor\" theColor)\n  (setq\tplObj (vla-addLightweightPolyline\n\t\t\t\t*ModelSpace*\n\t\t\t\tptLst1\n\t\t\t  )\n  )\n  (vla-setbulge plobj 1  blj)\n  (vla-setbulge plobj 2   blj)\n  \n  (setvar \"cecolor\" OrigColor)\n  \n  (GrRead_3103)\n  \n)\n;*******\n(defun GrRead_3103 ()\n  (while (and (\/= (car ptX) 3) )\n\t(setq result (vl-catch-all-apply\n\t\t\t\t   '(lambda\t()\n\t\t\t\t\t  (setq\tptX\t(grread T 1 2)\n\t\t\t\t\t  )\n\t\t\t\t\t)\n\t\t\t\t )\n\t)\n\t(if\t(vl-catch-all-error-p result)\n\t  (progn\n\t\t(vla-delete plObj)\n\t\t(vl-exit-with-error \"\")\n\t  )\n\t)\n\t(if\t(listp (cadr PtX))\n\t  (progn\n\t\t(setq pt0\t(trans (cadr PtX) 1 0)\n\t\t\t  theY\t(cadr (SD1862 pt0 theAng))\n\t\t\t  Delta\t(- theY BaseY)\n\t\t\t  Dist1\t(distance pt0 p1)\n\t\t\t  Dist2\t(distance pt0 p2)\n\t\t)\n\t\t(cond ((and (&lt;= 0 Delta) (&lt;= Dist1 Dist2))\n\t\t\t   (setq ptLst ptLst1\n\t\t\t\t\t blj   (* -1 (getBlj (* pi 0.5)))\n\t\t\t   )\n\t\t\t  )\n\t\t\t  ((and (&lt;= 0 Delta) (&gt;= Dist1 Dist2))\n\t\t\t   (setq ptLst ptLst3\n\t\t\t\t\t blj   (* -1 (getBlj (* pi 0.5)))\n\t\t\t   )\n\t\t\t  )\n\t\t\t  ((and (&gt;= 0 Delta) (&lt;= Dist1 Dist2))\n\t\t\t   (setq ptLst ptLst2\n\t\t\t\t\t blj   (getBlj (* pi 0.5))\n\t\t\t   )\n\t\t\t  )\n\t\t\t  ((and (&gt;= 0 Delta) (&gt;= Dist1 Dist2))\n\t\t\t   (setq ptLst ptLst4\n\t\t\t\t\t blj   (getBlj (* pi 0.5))\n\t\t\t   )\n\t\t\t  )\n\t\t)\n\t\t(vla-put-Coordinates plObj ptLst)\n\t\t(vla-setbulge plobj 1 blj)\n\t\t(vla-setbulge plobj 2 blj)\n\t  )\n\t)\n  )\n)\n ;************\n(defun getBlj (ang \/ blj)\n  (setq blj (\/ (sin (\/ ang 4)) (cos (\/ ang 4))))\n  blj\n)\n ;************\n(defun show_SD_3103\t(lbl_Width)\n\t(setq dcl_id (load_dialog \"SD_3103.dcl\"))\n  \t(if (= SD:Lang \"E\")\n  \t\t(new_dialog \"SD_3103\" dcl_id)\n  \t\t(new_dialog \"SD_3103_J\" dcl_id)\n  \t)\n  \n  (Registry_Read_3103)\n  (RegistryRead_PlanMode)\n  \n(set_tile \"PlanMode\" PlanMode)\n  (set_tile\t\"lbl_Width\"\n\t\t\t(if (= SD:Lang \"E\")\n\t\t\t\t(strcat \"Distance bet. corners : \" (rtos lbl_Width 2 4))\n\t\t\t\t(strcat \"\u8ddd\u96e2\uff1a \" (rtos lbl_Width 2 4))\n\t\t\t)\n  )\n  (set_tile \"txt_Door1\" txt_Door1)\n  \n  (action_tile \"btn_2_1\" \"(setq fct 2)(setDist_3103)\")\n  (action_tile \"btn_3_1\" \"(setq fct 3)(setDist_3103)\")\n\n  (action_tile\n\t\"accept\"\n\t\"(get_data_3103)(setq Act 1)(done_dialog )\"\n  )\n  (action_tile\n\t\"cancel\"\n\t\"(setq Act 0)(done_dialog)\"\n  )\n\t(action_tile \"help\" \"(startapp \\\"explorer\\\" \\\"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/sd_3103\/\\\")\")\n\n  (start_dialog)\n  (unload_dialog dcl_id)\n  \n  (if (= Act 0)\n\t(exit)\n\t\n  )\n  (princ)\n)\n;;;;*****************\n(defun get_data_3103 ()\n\t(setq\tdis1 (distof (get_tile \"txt_Door1\"))\n\t\t\tdis2 (- lbl_Width dis1)\n\t)\n\t(setq PlanMode (get_tile \"PlanMode\"))\n\t(setq txt_Door1 (get_tile \"txt_Door1\"))\n\t\n\t(Write_Registry_3103)\n\t(RegistryWrite_PlanMode)\n\n)\n;;;;*****************\n(defun setDist_3103\t()\n  (if (not fct)\n\t(setq fct 2)\n  )\n  (setq ds1 (* fct (\/ lbl_Width (+ fct 1))))\n  (set_tile \"txt_Door1\" (rtos ds1 2 4))\n)\n;;;;*****************\n(defun chkWdt_3103 ()\n  (if (&gt;= (distof (get_tile \"txt_Door1\")) lbl_Width)\n  \t(if (= SD:Lang \"E\")\n\t\t(alert (strcat \"Value must be less than \" (rtos lbl_Width 2 4)))\n\t\t(alert (strcat \"\u5024\u306e\u4e0a\u9650\uff1a \" (rtos lbl_Width 2 4)))\n\t)\n  )\n)\n;*****\n(defun Registry_Read_3103()\n  (setq\tPath_3103 \"HKEY_CURRENT_USER\\\\Software\\\\SpeedDraft\\\\SD_3103\" )\n  (if (vl-registry-read Path_3103 \"txt_Door1\")\n\t(setq txt_Door1 (vl-registry-read Path_3103 \"txt_Door1\"))\n\t(setq txt_Door1 \"\")\n  )\n )\n ;*****************; RegistryRead\n(defun RegistryRead_PlanMode ()\n\t(setq Path_PM \"HKEY_CURRENT_USER\\\\Software\\\\SpeedDraft\\\\SD_PlanMode\")\n\t(if \t(vl-registry-read Path_PM \"PlanMode\" )\n\t\t(setq  PlanMode (vl-registry-read Path_PM \"PlanMode\" ))\n\t\t(setq PlanMode \"BasicPlan\")\n\t)\n)\n;*****\n(defun Write_Registry_3103()\n\t(if txt_Door1 (vl-registry-write Path_3103 \"txt_Door1\" txt_Door1))\n)\n;*****************; RegistryWrite\n(defun RegistryWrite_PlanMode ()\n\t(vl-registry-write Path_PM \"PlanMode\" PlanMode )\n)\n(princ)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"\u89aa\u5b50\u6249\u3092\u4f5c\u6210\u3059\u308bAutoLISP\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002\u958b\u53e3\u30922\u70b9\u6307\u793a\u3057\u305f\u5f8c\u30012\u3064\u306e\u3046\u3061\u306e1\u3064\u306e\u6249\u5dfe\u3092\u5165\u529b\u3057\u307e\u3059\u3002 \u6249\u3092\u4f5c\u6210\u3059\u308b\u5074\u53ca\u3073\u5de6\u53f3\u306e\u958b\u304d\u52dd\u624b\u306f\u3001\u30de\u30a6\u30b9\u306e\u4f4d\u7f6e\u3067\u6c7a\u5b9a\u3057\u307e\u3059\u3002\u30de\u30a6\u30b9\u306e\u4f4d\u7f6e\u306b\u3088\u3063\u3066\u30af\u30eb\u30af\u30eb\u3068\u6249\u304c\u5909\u308f\u308a\u307e\u3059\u306e\u3067\u3001\u5e0c [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,43],"tags":[],"class_list":["post-2092","post","type-post","status-publish","format-standard","hentry","category-toolbar-floor-plan","category-door-toolbar"],"_links":{"self":[{"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts\/2092","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=2092"}],"version-history":[{"count":6,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts\/2092\/revisions"}],"predecessor-version":[{"id":3092,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/posts\/2092\/revisions\/3092"}],"wp:attachment":[{"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/media?parent=2092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/categories?post=2092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.offshorecad.com.ph\/speeddraft\/blog\/wp-json\/wp\/v2\/tags?post=2092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}