ARCHICAD20用カスタム作成した窓をキープランに対応させる方法

by Michitaka Kiriki · 最終更新日: 2017年1月12日

 

この記事では、カスタム建具をキープランに対応させる方法について説明します。自作の窓やドアオブジェクトにGDLスクリプトを追加する事で、キープランが表示されるようになります。

ARCHICAD20より、モデル表示オプションの設定が変更になり、「日本語版ライブラリの詳細レベル」で建具記号の表示の切り替えを行うようになりました。ARCHICAD19での「組み立て要素オプション」で建具記号表示の切り替えを行いたい場合は、ArchiCAD19用カスタム建具をキープランに対応させる方法を参照ください。

以下の手順に従ってください。

1.保存した建具を開き、サブタイプを日本建具に設定します(例:窓の場合、「ACJX4WindowShoji」)。

[窓のサブタイプ]

2.自作建具の「マスタスクリプト」に以下のスクリプトを貼り付けます。

[窓のマスタスクリプト]

!------------ For Window Marker -----------------------


iWindowCode         = 34		! WIN_SIMPLE


! =============================================================================
! KeyPlan No.+ sub no.
! =============================================================================
for ii=10 to 1 step -1
	if type_no<10**ii then no_len=ii
next ii
for ii=10 to 1 step -1
	if type_no_sub<10**ii then no_len_sub=ii
next ii

if no_and_sub = "" then
	if type_no_sub=0 then
		type_no_tx = STR(type_no, no_len, 0)
	else
		type_no_tx = STR(type_no, no_len, 0) + "-" + STR(type_no_sub, no_len_sub, 0)
	endif
else
	type_no_tx = no_and_sub
endif

parameters type_no_tx = type_no_tx
lock "type_no_tx"

if iK_Direction = 2 then k_rot=int(1)
if iK_Direction = 3 then k_rot=int(2)
if iK_Direction = 1 then k_rot=int(3)


 

3.自作建具の「パラメータスクリプト」に以下のスクリプトを貼り付けます。

[窓のパラメータスクリプト]

!------------ For Window Marker -----------------------

call "ListValuesJPN" parameters all gs_JPNObjectType = 6,             !COMMPARS_WINDOWS1
gs_is_p6 = 1
!------------ KeyPlan No.+ sub no. --------------------
for ii=10 to 1 step -1
if type_no<10**ii then no_len=ii
next ii
for ii=10 to 1 step -1
if type_no_sub<10**ii then no_len_sub=ii
next ii
if no_and_sub = "" then
if type_no_sub=0 then
type_no_tx = STR(type_no, no_len, 0)
else
type_no_tx = STR(type_no, no_len, 0) + "-" + STR(type_no_sub, no_len_sub, 0)
endif
else
type_no_tx = no_and_sub
endif
parameters type_no_tx = type_no_tx
lock "type_no_tx"

 

4.自作建具の「2Dスクリプト」に以下のスクリプトを貼り付けます。

窓の平面形状は、2Dスクリプト内に記述されている必要があります。2Dシンボルに記載されている場合は、2Dスクリプト内に記述してください。

[窓の2Dスクリプト]

[追加部分(前半)]
!------------------ キープラン対応部分 -------------------------

!=============================================================================
!	Model View Option Control
!=============================================================================
bShowOpLine2D       = 0
bShowCenterLine     = 0
lineTypeOpeningLine = 0
bShowRegMarker      = 0
bShowJoinerySign    = 0

CALL "requestMVOOptions_DW_JPN_m", 
		parameters ALL      iWindowCode = iWindowCode,
					       ! comment: Use iDoorCode to handle individual cases

		returned_parameters bShowOpLine2D,
					        bShowCenterLine,
					        lineTypeOpeningLine,
							bShowRegMarker,
							bShowJoinerySign

if GLOB_PREVIEW_MODE = 2 then 
	goto 1000
endif

if WIDO_REVEAL_SIDE then
	add2 0, WALL_THICKNESS - 2*WIDO_SILL
endif

[追加部分(後半)]
!------------------ キープラン対応部分 -------------------------
1000:
IF (key_mark_flag = 1 and bShowJoinerySign) OR GLOB_PREVIEW_MODE = 2 then

	is_flag = 0
	goto "KeyPlan_Marker"
else
	is_flag = 0
endif

END

"KeyPlan_Marker":

add2 0, WIDO_SILL

	! =============================================================================
	! Symbol marker 
	! =============================================================================

	if GLOB_PREVIEW_MODE = 2 then
		if fl_symbol then
			is_flag = 0
		else
			is_flag = 1
		endif
	endif

	if GLOB_SCALE>50 then
		elong = WALL_THICKNESS/2
	else
		elong = fgd
	endif

	if GLOB_PREVIEW_MODE = 1 then
		tmp_elv =  ac_sill_to_curr_story  - ac_wall_elevation * sill_ref_wall - gap_level * (1 - sill_ref_wall) - WIDO_THRES_DEPTH
	else
		tmp_elv = WIDO_SILL_HEIGHT + (ac_wall_elevation - gap_level) * (1 - sill_ref_wall) - WIDO_THRES_DEPTH
	endif

	if scale_link_label then
		if GLOB_SCALE > detail_high then
			marker_type =0
		else
			marker_type =1
		endif
	else
		if iKey_Mark_Type = 1 then
			marker_type = 0
		else
			marker_type = 1
		endif
	endif

	CALL "AC14_symbol_marker" PARAMETERS k_dia = k_dia, \
		k_line = k_line,
		k_lenb = k_lenb,
		k_lena = k_lena,
		k_lenc = k_lenc,
		fsize_flag = fsize_flag,
		fsize = fsize,
		k_notation1 =k_notation1,
		n_offx1 =n_offx1,
		n_offy1 =n_offy1,
		k_notation2 =k_notation2,
		n_offx2 =n_offx2,
		n_offy2 =n_offy2,
		k_notation3 = k_notation3,
		n_offx3 =n_offx3,
		n_offy3 =n_offy3,
		k_notation4 =k_notation4,
		n_offx4 =n_offx4,
		n_offy4 =n_offy4,
		pen_text = pen_marker,
		pen_symbol = pen_marker,
		pen_fill = keyplan_fill_pen,
		type_fill = keyplan_fill_type,
		keyplan_fill_bg_pen = keyplan_fill_bg_pen,
		fontType = fontType,
		type_symbol = stW_Type_Name,
		type_no = type_no_tx,
		globid = GLOB_ID,
		elong = elong,
		k_idflag = k_idflag,
		fill_flag = bKeyplan_fill,
		marker_type = marker_type,

		op_elv = tmp_elv,
		op_height = B,
		is_flag = is_flag, ltype_marker = ltype_marker,
		k_rot=k_rot,
		wd_show_size = wd_show_size,
		size_anno_x = size_anno_x,
		size_anno_y = size_anno_y,
		A = A,
!!--- new for paper scale V17
		paper_scale	= paper_scale,
		ex_fsize		= ex_fsize,
		wd_fsize		= wd_fsize,
		k_dia_paper 	= k_dia_paper,
		k_lenb_paper  = k_lenb_paper,
		k_lena_paper  = k_lena_paper,
		k_lenc_paper  = k_lenc_paper,

		n_offx1_paper = n_offx1_paper,
		n_offy1_paper = n_offy1_paper,
		n_offx2_paper = n_offx2_paper,
		n_offy2_paper = n_offy2_paper,
		n_offx3_paper = n_offx3_paper,
		n_offy3_paper = n_offy3_paper,
		n_offx4_paper = n_offx4_paper,
		n_offy4_paper = n_offy4_paper,
		size_anno_x_paper = size_anno_x_paper,
		size_anno_y_paper = size_anno_y_paper,

		k_dia_M		= k_dia_M,
		k_lenb_M	= k_lenb_M,
		k_lena_M	= k_lena_M,
		k_lenc_M	= k_lenc_M,

		n_offx1_M	= n_offx1_M,
		n_offy1_M	= n_offy1_M,
		n_offx2_M	= n_offx2_M,
		n_offy2_M	= n_offy2_M,
		n_offx3_M	= n_offx3_M,
		n_offy3_M	= n_offy3_M,
		n_offx4_M	= n_offx4_M,
		n_offy4_M	= n_offy4_M,
		size_anno_x_M = size_anno_x_M,
		size_anno_y_M = size_anno_y_M,
!!------------------------------
		k_rot_ang=k_rot_ang
del top