PROCEDURE Volume_3D; LABEL 999; CONST vLayerType=154; {レイヤの種類} ltDesign=1; ltSheet=2; s3DSelect=-349; {ツール 3Dセレクションポインタ} SV_Chunk=2; {メニュー 上} objOptions=2; {Selected} travOptions=0; {Shallow} layerOptions=0; {Current} vObjectIs3D=650;{ステータス 3Dオブジェクト} pPrimUnitFraction=150; {ミリ/単位(主単位)} pPrimUnitsPerInch=152; {単位/インチ(主単位)} pPrimUnitStyleName=153; {単位名(主単位)} pPrimCubeUnitMark=160; {立方単位記号(主単位)} pVolumeUnitsPerCubicInch=180; {容積単位/立方インチ} pVolumeUnitName=181; {容積単位名} pVolumeUnitMark=182; {容積単位記号} pVolumeUnitFraction=187; {立方ミリ/容積単位} pSecondUnitFraction=200; {?} pSecondUnitsPerInch=202; {単位/インチ(補助単位)} pSecondUnitStyleName=203; {単位名(補助単位)} pSecondCubeUnitMark=210; {立方単位記号(補助単位)} VAR O_Volume,TO_Volume :REAL; FUNCTION Get_SelectHandle(O_hd:HANDLE):BOOLEAN; {O_hd=NILでは実行されない} BEGIN IF GetObjectVariableBoolean(O_hd,vObjectIs3D) THEN BEGIN O_Volume:=ObjVolume(O_hd); IF O_Volume<>0 THEN TO_Volume:=TO_Volume+O_Volume ELSE SetDSelect(O_hd); END ELSE SetDSelect(O_hd); Get_SelectHandle:=FALSE; END; BEGIN IF GetObjectVariableInt(ActLayer,vLayerType)=ltSheet THEN BEGIN AlrtDialog('このツールはシートレイヤでは使用できません'); GOTO 999; END; IF FSActLayer=NIL THEN BEGIN AlertCritical('図形が選択されていません','選択し直して下さい'); {プロパティで対応可} GOTO 999; END; SetTool(s3DSelect); { DoMenuTextByName('Standard Views',SV_Chunk);} ForEachObjectInLayer(Get_SelectHandle,objOptions,travOptions,layerOptions); Message( GetPrefString(pVolumeUnitName),' [ ',TO_Volume,' ] ',GetPrefString(pVolumeUnitMark),' , ', GetPrefString(pPrimUnitStyleName),' [ ',TO_Volume/GetPrefReal(pVolumeUnitsPerCubicInch)*GetPrefReal(pPrimUnitsPerInch)^3,' ] ',GetPrefString(pPrimCubeUnitMark),' , ', { GetPrefString(pPrimUnitStyleName),' [ ',TO_Volume*GetPrefReal(pVolumeUnitFraction)/GetPrefReal(pPrimUnitFraction)^3,' ] ',GetPrefString(pPrimCubeUnitMark),' , ',} GetPrefString(pSecondUnitStyleName),' [ ',TO_Volume/GetPrefReal(pVolumeUnitsPerCubicInch)*GetPrefReal(pSecondUnitsPerInch)^3,' ] ',GetPrefString(pSecondCubeUnitMark) { GetPrefString(pSecondUnitStyleName),' [ ',TO_Volume*GetPrefReal(pVolumeUnitFraction)/GetPrefReal(pSecondUnitFraction)^3,' ] ',GetPrefString(pSecondCubeUnitMark)} ); 999:END; Run(Volume_3D);