扉の立面図を書くAutoLISPコマンドです。
- 細かいパラメータの設定
- 両開きであれば両方にチェック、片開きであれば片方にチェック。書く扉の有効Wを指定
- 扉有効高さを指定
- ここはヒバタの10mmを考慮するのであれば10、住宅のように扉枠の内々をW寸法とするのであれば0を入力します
- 図形を挿入するときの挿入基点を選択
- ガラスの形状を選択
- ドアガラリの形状を選択
このコマンドで作図できる扉の立面図は下図の通りです。
AutoLISPソース
(defun c:SD_6200 (/ door t1 t2 lst6 w h fp1 fp2 fp3 fp4 fp5 fp6 lst6 Width1 Width2 Heigth1 ListofSpecs TheLayer1 TheLayer2 flag Frame num0)
(if (= SD:Lang "E")
(princ "\n [SD_6200 ver.20221214] Door Elevation")
(princ "\n [SD_6200 ver.20221214] ドアの立面図")
)
(princ "\n **********************************")
(load "SD_U")
(setq *error* *myerror*)
(OpeningRoutine)
(setvar "expert" 5)
(setq TheLayer1 (Get_Layer "AS1" T)
TheLayer2 (Get_Layer "A83" T)
TheLayer3 (Get_Layer "A03" T))
(read_Registry_6200)
(show_dialogue_6200)
(write_Registry_6200)
(setq num0 (getvar "osmode"))
(setvar "osmode" 0)
(if (and (= t1 "1")(= t2 "1"))
(progn (setq flag T t1 "0")
(create_door_glass_6200)
(create_door_vent_6200)
(create_door_side_vent_6200)
(create_door_swing_6200)
(command "move" door "" fp1 (polar fp1 0.0 (atof Width1)))
(setq t1 "1" t2 "0")
(create_door_glass_6200)
(create_door_vent_6200)
(create_door_side_vent_6200)
(create_door_swing_6200)
(setq lst6 (list fp4 (polar fp3 (* 0.5 pi) f)))
(SD:MakePLine lst6 nil TheLayer1 0)
(setq door (ssadd (entlast) door))
(setq w (+ (atof Width1)(atof Width2))
fp3 (polar fp2 0.0 w)
fp4 (polar fp1 0.0 w)
)
(create_frame_6200)
)
(progn
(create_door_glass_6200)
(create_door_vent_6200)
(create_door_side_vent_6200)
(create_door_swing_6200)
(create_frame_6200)
)
)
(paste_door_6200)
(ClosingRoutine)
(setq *error* nil)
(princ)
)
;**********************************************************
(defun set_var ()
(setq Height1 (get_tile "Height1")
Frame1 (get_tile "Frame1")
Width1 (get_tile "Width1")
Width2 (get_tile "Width2")
Insertion (get_tile "Insertion")
t1 (get_tile "t1")
t2 (get_tile "t2")
glass (get_tile "glass")
louver (get_tile "louver")
ListofSpecs (list (atof (get_tile "A"))
(atof (get_tile "B"))
(atof (get_tile "C"))
(atof (get_tile "D"))
(atof (get_tile "E"))
(atof (get_tile "F"))
(atof (get_tile "G"))
(atof (get_tile "H"))
(atof (get_tile "J"))
)
door (ssadd)
)
)
;**********************************************************
(defun create_door_glass_6200 (/ pl1 pl2 pl3 pl4 pl5 p1 p2 p3 p4 p5 p6 p7 p8 pl2 pl3 pl4 pl5 lst1 blk1)
(if (= t1 "0")
(setq Width Width2)
(setq Width Width1)
)
(setq w (atof Width)
h (atof Height1)
f (atof Frame1)
fp2 (polar '(0.0 0.0 0.0) (* 0.5 pi) h)
p1 (polar (polar fp2 0.0 (nth 0 ListofSpecs)) (* 1.5 pi) (nth 1 ListofSpecs))
p2 (polar p1 0.0 (- w (* 2 (nth 0 ListofSpecs)))))
(if (= glass "1")
(setq p3 (polar p2 (* 1.5 pi) (- (- h (nth 2 ListofSpecs)) (nth 1 ListofSpecs)))
p4 (polar p1 (* 1.5 pi) (- (- h (nth 2 ListofSpecs)) (nth 1 ListofSpecs))))
(setq p3 (polar p2 (* 1.5 pi) (nth 4 ListofSpecs))
p4 (polar p1 (* 1.5 pi) (nth 4 ListofSpecs)))
)
(setq lst1 (list p1 p2 p3 p4))
(if (and (/= glass "0")(/= glass "3"))
(progn
(SD:MakePLine lst1 nil TheLayer1 1)
(setq pl1 (entlast)
p5 (polar p2 (* 1.0 pi) 57)
p6 (polar p5 (* 1.25 pi) 200)
p7 (polar p2 (* 1.5 pi) 57)
p8 (polar p7 (* 1.25 pi) 200)
)
(SD:MakeLine p5 p6 TheLayer2)
(setq pl2 (entlast))
(SD:MakeLine p7 p8 TheLayer2)
(setq pl3 (entlast))
(command "copy" pl2 "" p2 p4)
(command "rotate" (entlast) "" p4 "180")
(setq pl4 (entlast))
(command "copy" pl3 "" p2 p4)
(command "rotate" (entlast) "" p4 "180")
(setq pl5 (entlast)
blk1 (block_name "SD_6200_1_")
)
(command "-block" blk1 p4 pl1 pl2 pl3 pl4 pl5 "")
(command "-insert" blk1 p4 "" "" "")
(ssadd (entlast) door)
)
)
)
;**********************************************************
(defun create_door_vent_6200 (/ p5 p6 p7 p8 lst2 pl1 pl2 blk1 nofj nofjfixed Insertion)
(setq fp1 '(0.0 0.0 0.0)
p5 (polar (polar fp1 0.0 (nth 3 ListofSpecs)) (* 0.5 pi) (nth 2 ListofSpecs))
p6 (polar p5 0.0 (- w (* 2 (nth 3 ListofSpecs))))
p7 (polar p6 (* 0.5 pi) (nth 5 ListofSpecs))
p8 (polar p5 (* 0.5 pi) (nth 5 ListofSpecs))
lst2 (list p5 p6 p7 p8)
door_vent (ssadd)
)
(if (and (/= louver "00")(/= louver "02"))
(progn
(SD:MakePLine lst2 nil TheLayer1 1)
(setq pl1 (entlast))
(SD:MakeLine p7 p8 TheLayer1)
(setq pl2 (entlast))
(ssadd pl2 door_vent)
(setq nofj (/ (nth 5 ListofSpecs)(nth 8 ListofSpecs))
nofj (- nofj 1)
nofjfixed (fix nofj)
)
(if (/= nofj nofjfixed)
(progn
(command "move" pl2 "" p8 (polar p8 (* 1.5 pi) (/ (* (- nofj nofjfixed)(nth 8 ListofSpecs)) 2)))
(command "offset" (nth 8 ListofSpecs) (entlast) fp1 "")
(ssadd (entlast) door_vent)
)
(command "move" pl2 "" p8 (polar p8 (* 1.5 pi) (nth 8 ListofSpecs)))
)
(repeat nofjfixed
(command "offset" (nth 8 ListofSpecs) (entlast) fp1 "")
(ssadd (entlast) door_vent)
)
(setq blk1 (block_name "SD_6200_2_"))
(command "-block" blk1 p5 pl1 door_vent "")
(command "-insert" blk1 p5 "" "" "")
(ssadd (entlast) door)
)
)
)
;**********************************************************
(defun create_door_side_vent_6200 (/ p5 p6 p7 p8 lst2 pl1 pl2 pl3 blk1 nofj nofjfixed mp1 mp2)
(setq fp4 (polar fp1 0.0 w)
fp3 (polar fp4 (* 0.5 pi) h)
p5 (polar (polar fp4 (* 1.0 pi) (nth 0 ListofSpecs)) (* 0.5 pi) (nth 2 ListofSpecs))
p6 (polar p5 (* 1.0 pi) (nth 6 ListofSpecs))
p7 (polar p6 (* 0.5 pi) (/ (- (- (- h (nth 1 ListofSpecs))(nth 2 ListofSpecs))(nth 7 ListofSpecs)) 2))
p8 (polar p7 0.0 (nth 6 ListofSpecs))
lst2 (list p5 p6 p7 p8)
door_side_vent (ssadd)
)
(SD:MakePLine lst2 nil TheLayer1 1)
(setq pl1 (entlast))
(setq fp5 (polar fp1 (* 0.5 pi) (/ h 2))
fp6 (polar fp5 0.0 w)
mp1 (polar p8 (* 0.5 pi) (/ (nth 7 ListofSpecs) 2))
mp2 (polar mp1 0.0 (nth 6 ListofSpecs))
)
(command "mirror" pl1 "" mp1 mp2 "")
(setq pl2 (entlast))
(ssadd pl2 door)
(SD:MakeLine p7 p8 TheLayer1)
(setq pl3 (entlast))
(ssadd pl3 door_side_vent)
(setq nofj (/ (distance p6 p7) (nth 8 ListofSpecs))
nofj (- nofj 1)
nofjfixed (fix nofj)
)
(if (/= nofj nofjfixed)
(progn
(command "move" pl3 "" p8 (polar p8 (* 1.5 pi) (/ (* (- nofj nofjfixed)(nth 8 ListofSpecs)) 2)))
(command "offset" (nth 8 ListofSpecs) (entlast) fp1 "")
(ssadd (entlast) door_side_vent)
)
(command "move" pl3 "" p8 (polar p8 (* 1.5 pi) (nth 8 ListofSpecs)))
)
(repeat nofjfixed
(command "offset" (nth 8 ListofSpecs) (entlast) fp1 "")
(ssadd (entlast) door_side_vent)
)
(setq blk1 (block_name "SD_6200_3_"))
(command "-block" blk1 p6 pl1 door_side_vent "")
(if (= t1 "0")
(progn
(command "-insert" blk1 (polar (polar fp1 0.0 (nth 0 ListofSpecs)) (* 0.5 pi) (nth 2 ListofSpecs)) "" "" "")
(command "move" pl2 "" p6 (polar (polar fp1 0.0 (nth 0 ListofSpecs)) (* 0.5 pi) (nth 2 ListofSpecs)))
)
(command "-insert" blk1 p6 "" "" "")
)
(ssadd (entlast) door)
(if (/= glass "3")(entdel pl2))
(if (/= louver "02")(entdel (entlast)))
)
;**********************************************************
(defun create_door_swing_6200 (/ lst3 newfp1 newfp2 newfp3 newfp4 newfp5 newfp6)
(if flag
(setq newfp1 fp1
newfp2 (polar fp2 (* 0.5 pi) f)
newfp3 (polar fp3 (* 0.5 pi) f)
newfp4 fp4
)
(setq newfp1(polar fp1(* 1.0 pi) f)
newfp2 (polar (polar fp2 (* 1.0 pi) f) (* 0.5 pi) f)
newfp3 (polar (polar fp3 0.0 f) (* 0.5 pi) f)
newfp4(polar fp4 0.0 f)
)
)
(setq newfp5 (polar fp5 (* 1.0 pi) f)
newfp6 (polar fp6 0.0 f))
(if (= t1 "0")
(progn
(setq lst3 (list newfp1 newfp6 newfp2))
(SD:MakePLine lst3 nil TheLayer2 0)
(ssadd (entlast) door)
)
(progn
(setq lst3 (list newfp4 newfp5 newfp3))
(SD:MakePLine lst3 nil TheLayer2 0)
(ssadd (entlast) door)
)
)
)
;**********************************************************
(defun create_frame_6200 (/ lst4 pl1)
(setq lst4 (list fp1 fp2 fp3 fp4))
(SD:MakePLine lst4 nil TheLayer1 0)
(setq pl1(entlast))
(ssadd pl1 door)
(command "offset" f pl1 '(-100.0 0) "")
(ssadd (entlast) door)
(command "offset" (+ f 25.0) pl1 '(-100.0 0) "")
(command "pedit" (entlast) "c" "")
(ssadd (entlast) door)
(command "chprop" pl1 "" "la" TheLayer3 "")
)
;**********************************************************
(defun paste_door_6200 ()
(if (= Insertion "SD_6200_1")
(command "-block" "SD_6200" "0,0" door "" )
(command "-block" "SD_6200" (polar (list 0.0 0.0 0.0) 0.0 w) door "")
)
(setvar "osmode" num0)
(command "-insert" "SD_6200" pause "" "" "")
(command "explode" (entlast))
(command "purge" "b" "SD_6200" "" "y")
)
;**********************************************************
(defun show_dialogue_6200 ()
(setq dcl_id (load_dialog "SD_6200.DCL"))
(if (= SD:Lang "E")
(new_dialog "SD_6200" dcl_id)
(new_dialog "SD_6200_J" dcl_id)
)
(set_tile "Height1" Height1)
(set_tile "Frame1" Frame1)
(set_tile "Width1" Width1)
(set_tile "Width2" Width2)
(set_tile "Insertion" Insertion)
(set_tile "t1" t1)
(set_tile "t2" t2)
(set_tile "glass" glass)
(set_tile "louver" louver)
(set_tile "A" A)
(set_tile "B" B)
(set_tile "C" C)
(set_tile "D" D)
(set_tile "E" E)
(set_tile "F" F)
(set_tile "G" G)
(set_tile "H" H)
(set_tile "J" J)
(mode_tile "Width1" (- 1 (atoi t1)))
(mode_tile "Width2" (- 1 (atoi t2)))
(mode_tile "Height1" 2)
(start_image "image1")
(slide_image 0 0 (dimx_tile "image1")(dimy_tile "image1") Insertion)
(end_image)
(action_tile "Standard" (strcat "(set_tile \"A\" \"110\")"
"(set_tile \"B\" \"110\")"
"(set_tile \"C\" \"110\")"
"(set_tile \"D\" \"110\")"
"(set_tile \"E\" \"800\")"
"(set_tile \"F\" \"300\")"
"(set_tile \"G\" \"180\")"
"(set_tile \"H\" \"150\")"
"(set_tile \"J\" \"30\")"
)
)
(action_tile "t1" "(mode_tile \"Width1\" (- 1 (atoi $value)))")
(action_tile "t2" "(mode_tile \"Width2\" (- 1 (atoi $value)))")
(action_tile "Insertion" (strcat "(setq Insertion $value)"
"(start_image \"image1\")"
"(fill_image 0 0 (dimx_tile \"image1\")(dimy_tile \"image1\") 0)"
"(slide_image 0 0 (dimx_tile \"image1\")(dimy_tile \"image1\") Insertion)"
"(end_image)"
)
)
(action_tile "accept" "(setq Act 1)(set_var)(done_dialog)")
(action_tile "cancel" "(setq Act 0)(done_dialog)")
(start_dialog)
(unload_dialog dcl_id)
(if (= Act 0)
(exit)
)
)
;;************************
(defun read_Registry_6200 ()
(setq Path6200 "HKEY_CURRENT_USER\\Software\\SpeedDraft\\SD_6200")
(setq Height1 (vl-registry-read Path6200 "Height1"))
(if (null Height1)
(setq Height1 "1225")
)
(setq Frame1 (vl-registry-read Path6200 "Frame1"))
(if (null Frame1)
(setq Frame1 "10")
)
(setq t1 (vl-registry-read Path6200 "t1"))
(if (null t1)
(setq t1 "1")
)
(setq t2 (vl-registry-read Path6200 "t2"))
(if (null t2)
(setq t2 "0")
)
(setq glass (vl-registry-read Path6200 "glass"))
(if (null glass)
(setq glass "0")
)
(setq louver (vl-registry-read Path6200 "louver"))
(if (null louver)
(setq louver "00")
)
(setq Width1 (vl-registry-read Path6200 "Width1"))
(if (null Width1)
(setq Width1 "900")
)
(setq Width2 (vl-registry-read Path6200 "Width2"))
(if (null Width2)
(setq Width2 "900")
)
(setq Insertion (vl-registry-read Path6200 "Insertion"))
(if (null Insertion)
(setq Insertion "SD_6200_1")
)
(setq A (vl-registry-read Path6200 "A"))
(if (null A)
(setq A "110")
)
(setq B (vl-registry-read Path6200 "B"))
(if (null B)
(setq B "110")
)
(setq C (vl-registry-read Path6200 "C"))
(if (null C)
(setq C "110")
)
(setq D (vl-registry-read Path6200 "D"))
(if (null D)
(setq D "110")
)
(setq E (vl-registry-read Path6200 "E"))
(if (null E)
(setq E "800")
)
(setq F (vl-registry-read Path6200 "F"))
(if (null F)
(setq F "300")
)
(setq G (vl-registry-read Path6200 "G"))
(if (null G)
(setq G "180")
)
(setq H (vl-registry-read Path6200 "H"))
(if (null H)
(setq H "150")
)
(setq J (vl-registry-read Path6200 "J"))
(if (null J)
(setq J "30")
)
)
;;************************
(defun write_Registry_6200 ()
(setq Path6200 "HKEY_CURRENT_USER\\Software\\SpeedDraft\\SD_6200")
(vl-registry-write Path6200 "Height1" Height1)
(vl-registry-write Path6200 "Frame1" Frame1)
(vl-registry-write Path6200 "t1" t1)
(vl-registry-write Path6200 "t2" t2)
(vl-registry-write Path6200 "glass" glass)
(vl-registry-write Path6200 "louver" louver)
(vl-registry-write Path6200 "Width1" Width1)
(vl-registry-write Path6200 "Width2" Width2)
(vl-registry-write Path6200 "Insertion" Insertion)
(vl-registry-write Path6200 "A" (rtos (nth 0 ListofSpecs)))
(vl-registry-write Path6200 "B" (rtos (nth 1 ListofSpecs)))
(vl-registry-write Path6200 "C" (rtos (nth 2 ListofSpecs)))
(vl-registry-write Path6200 "D" (rtos (nth 3 ListofSpecs)))
(vl-registry-write Path6200 "E" (rtos (nth 4 ListofSpecs)))
(vl-registry-write Path6200 "F" (rtos (nth 5 ListofSpecs)))
(vl-registry-write Path6200 "G" (rtos (nth 6 ListofSpecs)))
(vl-registry-write Path6200 "H" (rtos (nth 7 ListofSpecs)))
(vl-registry-write Path6200 "I" (rtos (nth 8 ListofSpecs)))
)
;********Compute Name of Block
(defun block_name (blk1 / x1 )
(setq x1 1)
(while x1
(setq blkname (strcat blk1 (itoa x1)))
(if (/= (tblsearch "BLOCK" blkname) nil)(setq x1 (+ x1 1))(setq x1 nil))
)
blkname
)
(princ)
DCLソース
SD_6200:dialog{label="DoorElevation";
:row{
:column{alignment="center";
:icon_image{key="image1";width=50;height=20;aspect_ratio=1.0;}
}
:column{children_alignment=right;
:edit_box{edit_width=12;fixed_width=true;label="A:";key="A";}
:edit_box{edit_width=12;fixed_width=true;label="B:";key="B";}
:edit_box{edit_width=12;fixed_width=true;label="C:";key="C";}
:edit_box{edit_width=12;fixed_width=true;label="D:";key="D";}
:edit_box{edit_width=12;fixed_width=true;label="E:";key="E";}
:edit_box{edit_width=12;fixed_width=true;label="F:";key="F";}
:edit_box{edit_width=12;fixed_width=true;label="G:";key="G";}
:edit_box{edit_width=12;fixed_width=true;label="H:";key="H";}
:edit_box{edit_width=12;fixed_width=true;label="J:";key="J";}
:button{label="Standard";key="Standard";}
}
}
:column{
:row{
:boxed_column{label=LEFT;
:toggle{label="Draw";key="t1";}
:edit_box{label="Width1:";key="Width1";}
}
:boxed_column{label=RIGHT;
:toggle{label="Draw";key="t2";}
:edit_box{label="Width2:";key="Width2";}
}
}
}
:row{
:column{
:row{
:edit_box{label="Height1:";key="Height1";edit_width=10;}
:edit_box{label="Frame1:";key="Frame1";edit_width=5;}
}
:radio_row{label="Insertion";key="Insertion";value="SD_6200_1";
:radio_button{label="Left";key="SD_6200_1";}
:radio_button{label="Right";key="SD_6200_2";}
}
ok_cancel;
:text{label="";}
:text{label="";}
}
:column{
:radio_column{label="Glass";key="glass";value="1";
:radio_button{label="Nothing";key="0";}
:radio_button{label="Big";key="1";}
:radio_button{label="Top";key="2";}
:radio_button{label="Slit";key="3";}
}
:radio_column{label="Louver";key="louver";value="00";
:radio_button{label="Nothing";key="00";}
:radio_button{label="Bottom";key="01";}
:radio_button{label="Slit";key="02";}
}
}
}
}
SD_6200_J:dialog{label="ドアの立面図";
:row{
:column{alignment="center";
:icon_image{key="image1";width=50;height=20;aspect_ratio=1.0;}
}
:column{children_alignment="left";
:edit_box{edit_width=12;fixed_width=true;label="A:";key="A";}
:edit_box{edit_width=12;fixed_width=true;label="B:";key="B";}
:edit_box{edit_width=12;fixed_width=true;label="C:";key="C";}
:edit_box{edit_width=12;fixed_width=true;label="D:";key="D";}
:edit_box{edit_width=12;fixed_width=true;label="E:";key="E";}
:edit_box{edit_width=12;fixed_width=true;label="F:";key="F";}
:edit_box{edit_width=12;fixed_width=true;label="G:";key="G";}
:edit_box{edit_width=12;fixed_width=true;label="H:";key="H";}
:edit_box{edit_width=12;fixed_width=true;label="J:";key="J";}
:button{label="Standard";key="Standard";}
}
}
:column{
:row{
:boxed_column{label="左";
:toggle{label="有り";key="t1";}
:edit_box{label="ドア幅";key="Width1";}
}
:boxed_column{label="右";
:toggle{label="有り";key="t2";}
:edit_box{label="ドア幅";key="Width2";}
}
}
}
:row{
:column{
:row{
:edit_box{label="ドア高さ";key="Height1";edit_width=10;}
:edit_box{label="ひばた";key="Frame1";edit_width=5;}
}
:radio_row{label="挿入基点";key="Insertion";value="SD_6200_1";
:radio_button{label="左";key="SD_6200_1";}
:radio_button{label="右";key="SD_6200_2";}
}
ok_cancel;
:text{label="";}
:text{label="";}
}
:column{
:radio_column{label="ガラス";key="glass";value="1";
:radio_button{label="無し";key="0";}
:radio_button{label="全ガラス";key="1";}
:radio_button{label="上にガラス";key="2";}
:radio_button{label="スリットガラス";key="3";}
}
:radio_column{label="ガラリ";key="louver";value="00";
:radio_button{label="無し";key="00";}
:radio_button{label="下にガラリ";key="01";}
:radio_button{label="スリットガラリ";key="02";}
}
}
}
}
コメント