private static void Initialize_Layer() { Utils.Layer.Create("00_guide", ColorIndex.SkyBlue); Utils.Layer.Create("00_Noprint", ColorIndex.RGB(0, 0, 20)); Utils.Layer.Create("00_가구", ColorIndex.Blue); Utils.Layer.Create("00_덕트", ColorIndex.RGB(0, 0, 30)); Utils.Layer.Create("00_발코니중심", ColorIndex.Green); Utils.Layer.Create("00_벽체", ColorIndex.Gray); Utils.Layer.Create("00_실면적", ColorIndex.Red); Utils.Layer.Create("00_외벽라인", ColorIndex.Yellow); Utils.Layer.Create("00_전용면적", ColorIndex.RGB(0, 0, 161)); Utils.Layer.Create("00_창호", ColorIndex.SkyBlue); Utils.Layer.Create("00_해치", ColorIndex.RGB(255, 127, 0)); Utils.Layer.Create("00_Dim", ColorIndex.Yellow); Utils.Layer.Create("00_Temp", ColorIndex.Gray); LAYER.Add("00_실면적"); LAYER.Add("00_외벽라인"); LAYER.Add("00_발코니중심"); LAYER.Add(Utils.Layer.GetName(AC.DB.Clayer)); // 현재 레이어 }
public static ObjectId Create_HDC_DimensionStyle(string StyleName) { var DimId = ObjectId.Null; using (Transaction T = AC.DB.TransactionManager.StartTransaction()) { DimStyleTable DST = T.GetObject(AC.DB.DimStyleTableId, OpenMode.ForWrite) as DimStyleTable; switch (StyleName) { case "HDC_Dim_Style": #region 생성 if (!DST.Has(StyleName)) { DST.UpgradeOpen(); var dstr = new DimStyleTableRecord() { Name = StyleName, // 스타일 이름 Dimasz = 0, // 화살표 크기 Dimtxt = 100, // 문자 크기 Dimexo = 100, // 원점에서 간격띄우기 값 Dimclrt = ColorIndex.Yellow, // 문자 색상 Dimclrd = ColorIndex.Yellow, // 치수선 생상 Dimclre = ColorIndex.Gray, // 치수보조선 색생 Dimtad = 0, // 1: 치수선 위에 입력, 0: 치수선 상에 입력 Dimtoh = false, // 문자 정렬(On/On: 수평, Off/Off: 치수선, On/Off: ISO) Dimtih = false, // 문자 정렬(On/On: 수평, Off/Off: 치수선, On/Off: ISO) Dimdec = 0, // 소수점 자릿수 Dimsd1 = true, // 치수선1 억제 Dimsd2 = true, // 치수선2 억제 Dimse1 = true, // 치수보조선1 억제 Dimse2 = true, // 치수보조선1 억제 Dimtix = true, }; DimId = DST.Add(dstr); T.AddNewlyCreatedDBObject(dstr, true); } #endregion #region 수정 else { DimId = DST[StyleName]; var dstr = T.GetObject(DimId, OpenMode.ForWrite) as DimStyleTableRecord; dstr.Name = StyleName; dstr.Dimasz = 0; dstr.Dimtxt = 100; dstr.Dimexo = 100; dstr.Dimgap = 50; dstr.Dimclrt = ColorIndex.Yellow; dstr.Dimclrd = ColorIndex.Yellow; dstr.Dimclre = ColorIndex.Gray; dstr.Dimtad = 0; dstr.Dimtoh = false; dstr.Dimtih = false; dstr.Dimdec = 0; dstr.Dimsd1 = true; // 치수선1 억제 dstr.Dimsd2 = true; // 치수선2 억제 dstr.Dimse1 = true; // 치수보조선1 억제 dstr.Dimse2 = true; // 치수보조선1 억제 dstr.Dimtix = true; } #endregion T.Commit(); break; case "HDC_도면 치수선": #region 생성 if (!DST.Has(StyleName)) { DST.UpgradeOpen(); var dstr = new DimStyleTableRecord(); dstr.Name = StyleName; // 스타일 이름 dstr.Dimasz = 10; // 화살표 크기 dstr.Dimblk = GetArrowObjectId("DIMBLK", "_ARCHTICK"); dstr.Dimblk1 = GetArrowObjectId("DIMBLK1", "_ARCHTICK"); // 화살표 모양 (_ARCHTICK : 건축 눈금) dstr.Dimblk2 = GetArrowObjectId("DIMBLK2", "_ARCHTICK"); // 화살표 모양 (_ARCHTICK : 건축 눈금) dstr.Dimtxt = 100; // 문자 크기 dstr.Dimexo = 150; // 원점에서 간격띄우기 값 dstr.Dimclrt = ColorIndex.Green; // 문자 색상 dstr.Dimclrd = ColorIndex.RGB(255, 63, 0); // 치수선 생상 dstr.Dimclre = ColorIndex.RGB(255, 63, 0); // 치수보조선 색생 dstr.Dimtad = 1; // 1: 치수선 위에 입력, 0: 치수선 상에 입력 dstr.Dimtoh = false; // 문자 정렬(On/On: 수평, Off/Off: 치수선, On/Off: ISO) dstr.Dimtih = false; // 문자 정렬(On/On: 수평, Off/Off: 치수선, On/Off: ISO) dstr.Dimdec = 0; // 소수점 자릿수 dstr.Dimsd1 = false; // 치수선1 억제 dstr.Dimsd2 = false; // 치수선2 억제 dstr.Dimse1 = false; // 치수보조선1 억제 dstr.Dimse2 = false; // 치수보조선1 억제 DimId = DST.Add(dstr); T.AddNewlyCreatedDBObject(dstr, true); } #endregion #region 수정 else { DimId = DST[StyleName]; var dstr = T.GetObject(DimId, OpenMode.ForWrite) as DimStyleTableRecord; dstr.Name = StyleName; dstr.Dimasz = 10; dstr.Dimblk = GetArrowObjectId("DIMBLK", "_ARCHTICK"); dstr.Dimblk1 = GetArrowObjectId("DIMBLK1", "_ARCHTICK"); dstr.Dimblk2 = GetArrowObjectId("DIMBLK2", "_ARCHTICK"); dstr.Dimtxt = 100; dstr.Dimexo = 150; dstr.Dimgap = 50; dstr.Dimclrt = ColorIndex.Green; dstr.Dimclrd = ColorIndex.RGB(255, 63, 0); dstr.Dimclre = ColorIndex.RGB(255, 63, 0); dstr.Dimtad = 1; dstr.Dimtoh = false; dstr.Dimtih = false; dstr.Dimdec = 0; dstr.Dimsd1 = false; // 치수선1 억제 dstr.Dimsd2 = false; // 치수선2 억제 dstr.Dimse1 = false; // 치수보조선1 억제 dstr.Dimse2 = false; // 치수보조선1 억제 //dstr.Dimfxlen = 700; //dstr.Dimtix = true; } #endregion T.Commit(); break; } } return(DimId); }