本文整理汇总了C#中ModelDoc2.ViewZoomToSelection方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.ViewZoomToSelection方法的具体用法?C# ModelDoc2.ViewZoomToSelection怎么用?C# ModelDoc2.ViewZoomToSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelDoc2
的用法示例。
在下文中一共展示了ModelDoc2.ViewZoomToSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoDimensionDrawing2
//.........这里部分代码省略.........
}
_swAdd.SetModelProperty(swModel, "WasMesure", string.Empty, swCustomInfoType_e.swCustomInfoYesOrNo, "Yes", true);
}
string pathXml = WriteXmlFile(swModel, isValidXml, targetModelPath);
bool isNeededSheetNumber = PrepareDrawingDoc(swModel, out listSide);
bool dimOnlyNew = false;
if (swModel.GetCustomInfoValue("", "DimOnlyNew") == "Yes")
dimOnlyNew = true;
var vSheetNames = (string[])swDrawing.GetSheetNames();
var rootNode = _node;
bool atLeastOneF1View = false;
foreach (var vSheetName in vSheetNames)
{
bool iftherewasAhole = false;
XmlElement element = null;
XmlElement sheetNode = null;
KeyValuePair<string,string> tableNameAttribute = new KeyValuePair<string, string>();
if (_createProgramm && !string.IsNullOrEmpty(pathXml))
{
element = _cxml.CreateElement("Sheet");
element.SetAttribute("Name", vSheetName);
_node = rootNode.AppendChild(element);
sheetNode = element;
}
double vScale = 0;
var type = new List<string>();
var listSize = new List<SizeForDim>();
swDrawing.ActivateSheet(vSheetName);
swModel.Extension.SelectByID2(vSheetName, "SHEET", 0, 0, 0, true,
(int)swSelectionMarkAction_e.swSelectionMarkAppend, null, 0);
swModel.ViewZoomToSelection();
swModel.ClearSelection();
var swSheet = (Sheet)swDrawing.GetCurrentSheet();
var swViews = (object[])swSheet.GetViews();
bool side = shi == 1;
if (isNeededSheetNumber && listSide.ContainsKey(vSheetName.Substring(vSheetName.Length - 1)))
side = listSide[vSheetName.Substring(vSheetName.Length - 1)];
if (vSheetName.ToUpper().Contains("FACE"))
side = true;
if (vSheetName.ToUpper().Contains("BACK"))
side = false;
if (swViews != null)
{
var rootViewElement = _node;
if (Properties.Settings.Default.ViewsBeforeDimen)
ReplaceViews(swViews, swDrawing);
foreach (var t in swViews)
{
#region Образмеривание вида
var swView = (View) t;
swModel.ClearSelection2(true);
const string expr = "^F[1-6]$";
Match isMatch = Regex.Match(swView.Name, expr, RegexOptions.IgnoreCase);
if (_createProgramm && swView.Name.ToLower().Contains("const"))
{
//Logging.Log.Instance.Fatal(@"На данный чертеж программа не будет создана! " + swModel.GetPathName() + "swView.Name = " + swView.Name);
//MessageBox.Show(@"На данный чертеж программа не будет создана!", @"MrDoors",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}