private TitleBlockDefinition GetTitleBlock() { TitleBlockDefinition returnedTitleBlock = drawDoc.TitleBlockDefinitions[1]; foreach (TitleBlockDefinition tD in drawDoc.TitleBlockDefinitions) { if (tD.Name.Equals(SelectedTitleBlock)) { returnedTitleBlock = tD; } } return(returnedTitleBlock); }
private void AddSheetMetaData(Sheet sheet) { if (sheet.TitleBlock != null) { sheet.TitleBlock.Delete(); } if (sheet.Border != null) { sheet.Border.Delete(); } TitleBlockDefinition tempTitleBlockDef = GetTitleBlock(); TitleBlockLocationEnum titleBlockLocation = GetTitleBlockLocation(); string[] promptStrings = new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }; TitleBlock titleBlockForCreatedSheet = sheet.AddTitleBlock(tempTitleBlockDef, titleBlockLocation, promptStrings); if (SelectedBorder.Equals("Default Border")) { sheet.AddDefaultBorder(); } else { sheet.AddBorder(BorderDefinition: GetBorderDefinition(SelectedBorder)); } sheet.ExcludeFromCount = ExcludeFromCount; sheet.ExcludeFromPrinting = ExcludeFromPrinting; sheet.Name = SheetName; sheet.Orientation = this.GetPageOrientation(); if (drawDoc.ActiveSheet != sheet) { sheet.Activate(); } }