本文整理汇总了C#中ModelDoc2.ForceRebuild3方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.ForceRebuild3方法的具体用法?C# ModelDoc2.ForceRebuild3怎么用?C# ModelDoc2.ForceRebuild3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelDoc2
的用法示例。
在下文中一共展示了ModelDoc2.ForceRebuild3方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoDimensionDrawing2
//.........这里部分代码省略.........
element.SetAttribute("X", Math.Round(d.X).ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
element.SetAttribute("Y", Math.Round(d.Y).ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
if (swView.Name == "F1" || swView.Name == "F6")
element.SetAttribute("Z", _z.ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
if (_node != null)
_node.AppendChild(element);
foreach (var ls in d.ListSize)
{
i++;
id = "id" + i;
element = _cxml.CreateElement(id);
element.SetAttribute("X", ls.X.ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
element.SetAttribute("Y", ls.Y.ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
element.SetAttribute("Diameter", ls.Diameter.ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
element.SetAttribute("Depth",ls.Depth.ToString(CultureInfo.CreateSpecificCulture("ru-RU")));
if (_node != null)
_node.AppendChild(element);
}
_node = _node.ParentNode;
}
#endregion
}
#endregion
swView.SetDisplayMode3(false, (int) swDisplayMode_e.swFACETED_HIDDEN_GREYED, true, true);
swDrawing.ActivateSheet(vSheetName);
}
catch (Exception e)
{
MessageBox.Show(@"Ошибка при образмеривании! " + e.Message, @"MrDoors",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (dimOnlyNew)
ShowHiddenComponents(list);
}
#endregion
}
}
if (type.Count != 0)
LegendMaker(swModel, swDrawing, type, vScale);
if (!string.IsNullOrEmpty(tableNameAttribute.Value))
sheetNode.SetAttribute("TableName", tableNameAttribute.Value);
if (Properties.Settings.Default.ScaleWhenDimen && !del3List && shi != 0)
AutoScaleSheet(listSize, swSheet, vScale, side);
shi++;
if(_node!=null)
_node = _node.ParentNode;
AutoArrangeDimentions(vSheetName,dimOnlyNew);
}
swModel.EditRebuild3();
if (shi == 3)
{
if (del3List)
{
if (isNeededSheetNumber && thrdList.Count > 0)
foreach (var sh in thrdList)
swModel.Extension.SelectByID2(sh, "SHEET", 0, 0, 0, true, 0, null, 0);
else
{
if (!swModel.Extension.SelectByID2("Лист3", "SHEET", 0, 0, 0, false, 0, null, 0))
{
swModel.Extension.SelectByID2("Back3", "SHEET", 0, 0, 0, false, 0, null, 0);
}
}
swModel.DeleteSelection(true);
}
else
SheetNumering(swModel, swDrawing);
}
swModel.ForceRebuild3(false);
bool writeXml = true;
if (atLeastOneF1View)
{
try
{
writeXml=SomeLogicChanges(swModel);
}
catch(Exception e)
{
if (swModel.GetPathName() != null)
Logging.Log.Instance.Fatal(e, "Ошибка при применении логики к XML. " + swModel.GetPathName());
else
Logging.Log.Instance.Fatal(e, "Ошибка при применении логики к XML. ");
}
if (writeXml)
StopWriteXml(pathXml);
}
return;
}
示例2: InitTableData
private void InitTableData()
{
md = (ModelDoc2)DrawingPropertySet.SwApp.ActiveDoc;
mde = md.Extension;
fracdisp = mde.GetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalDisplay,
(int)swUserPreferenceOption_e.swDetailingNoOptionSpecified);
//int den = mde.GetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearFractionDenominator,
// (int)swUserPreferenceOption_e.swDetailingNoOptionSpecified);
decs = mde.GetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalPlaces,
(int)swUserPreferenceOption_e.swDetailingNoOptionSpecified);
decd = mde.GetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalDisplay,
(int)swUserPreferenceOption_e.swDetailingNoOptionSpecified);
try {
mde.SetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalDisplay,
(int)swUserPreferenceOption_e.swDetailingNoOptionSpecified, (int)swFractionDisplay_e.swDECIMAL);
mde.SetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalPlaces,
(int)swUserPreferenceOption_e.swDetailingNoOptionSpecified, 3);
mde.SetUserPreferenceInteger((int)swUserPreferenceIntegerValue_e.swUnitsLinearDecimalDisplay,
(int)swUserPreferenceOption_e.swDetailingNoOptionSpecified, 3);
md.ForceRebuild3(false);
table = new swTableType.swTableType((DrawingPropertySet.SwApp.ActiveDoc as ModelDoc2),
Redbrick.MasterHashes);
} catch (NullReferenceException nre) {
if (_swApp != null) {
Redbrick.InsertBOM(_swApp);
InitTableData();
} else {
throw new NullReferenceException(@"No table found.");
}
} catch (Exception e) {
RedbrickErr.ErrMsg em = new RedbrickErr.ErrMsg(e);
em.ShowDialog();
Close();
} finally {
//
}
}
示例3: OpenDoc
public void OpenDoc(int idPdm, int revision, int taskType, string filePath, string fileName)
{
swApp = new SldWorks() {Visible = true};
Process[] processes = Process.GetProcessesByName("SLDWORKS");
var errors = 0;
var warnings = 0;
#region Case
switch (taskType)
{
case 1:
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectionColor = Color.Black));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += (String.Format("Выполняется: {0}\r\n", filePath))));
swModel = swApp.OpenDoc6(filePath, (int) swDocumentTypes_e.swDocPART, (int) swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref errors, ref warnings);
swModel = swApp.ActiveDoc;
if (!IsSheetMetalPart((IPartDoc) swModel))
{
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectionColor = Color.DarkBlue));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += ("Не листовой металл!\r\n")));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += ("--------------------------------------------------------------------------------------------------------------\r\n")));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += ("\r\n")));
swApp.CloseDoc(filePath);
swApp.ExitApp();
swApp = null;
foreach (Process process in processes)
{
process.CloseMainWindow();
process.Kill();
}
return;
}
swExtension = (ModelDocExtension) swModel.Extension;
swModel.EditRebuild3();
swModel.ForceRebuild3(false);
CreateFlattPatternUpdate();
object[] confArray = swModel.GetConfigurationNames();
foreach (var confName in confArray)
{
Configuration swConf = swModel.GetConfigurationByName(confName.ToString());
if (swConf.IsDerived()) continue;
Area(confName.ToString());
GabaritsForPaintingCamera(confName.ToString());
}
ExportDataToXmlSql(fileName, idPdm, revision);
ConvertToErpt(filePath);
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectionColor = Color.Black));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += (String.Format("{0} - Выполнен!\r\n", filePath))));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += ("-----------------------------------------------------------------\r\n")));
Program.HostForm.richTextBoxLog.Invoke(new Action(() => Program.HostForm.richTextBoxLog.SelectedText += ("\r\n")));
break;
case 2:
swModel = swApp.OpenDoc6(filePath, (int) swDocumentTypes_e.swDocDRAWING, (int) swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref errors, ref warnings);
//if (warnings == (int)swFileLoadWarning_e.swFileLoadWarning_ReadOnly)
//{MessageBox.Show("This file is read-only.");}
swDraw = (DrawingDoc) swModel;
swExtension = (ModelDocExtension) swModel.Extension;
ConvertToPdf(filePath);
break;
case 3:
//swModel = swApp.OpenDoc6(filePath, (int)swDocumentTypes_e.swDocPART, (int)swOpenDocOptions_e.swOpenDocOptions_Silent, "", ref errors, ref warnings);
MessageBox.Show("3");
break;
}
//TODO: swApp exit
swApp.CloseDoc(filePath);
swApp.ExitApp();
swApp = null;
foreach (Process process in processes)
{
process.CloseMainWindow();
process.Kill();
}
#endregion
}