首页 > 其他 > 详细

NXOpen 新建工程图图纸页

时间:2021-03-28 12:38:31      阅读:13      评论:0      收藏:0      [点我收藏+]

VS2010 NX8.5

 

//遍历所有图纸页
vector<NXOpen::Drawings::DrawingSheet*> AllSheet;
NXOpen::Drawings::DrawingSheet* Sheet1;
NXOpen::Drawings::DrawingSheetCollection::iterator Ite;//定义迭代器
for (Ite = workPart->DrawingSheets()->begin(); Ite != workPart->DrawingSheets()->end(); ++Ite)
{
Sheet1 = (*Ite);
AllSheet.push_back(Sheet1);
}

if ( AllSheet.size()==0)
{
theUI->NXMessageBox()->Show("提示", NXOpen::NXMessageBox::DialogTypeInformation, "当前不部件不是工程图环境");
return ;
}

Drawings::DrawingSheet *nullDrawings_DrawingSheet(NULL);
Drawings::DrawingSheetBuilder *drawingSheetBuilder1;
drawingSheetBuilder1 = workPart->DrawingSheets()->DrawingSheetBuilder(nullDrawings_DrawingSheet);
drawingSheetBuilder1->SetStandardMetricScale(Drawings::DrawingSheetBuilder::SheetStandardMetricScaleS11);
drawingSheetBuilder1->SetStandardEnglishScale(Drawings::DrawingSheetBuilder::SheetStandardEnglishScaleS11);
drawingSheetBuilder1->SetMetricSheetTemplateLocation("D:\\YiNing tools\\Drf_files\\A4_YN_horizontal.prt");//模板路径
drawingSheetBuilder1->SetEnglishSheetTemplateLocation("");
drawingSheetBuilder1->SetHeight(210.00); //图纸高度
drawingSheetBuilder1->SetLength(297.00); //图纸长度
drawingSheetBuilder1->SetStandardMetricScale(Drawings::DrawingSheetBuilder::SheetStandardMetricScaleS11);
drawingSheetBuilder1->SetStandardEnglishScale(Drawings::DrawingSheetBuilder::SheetStandardEnglishScaleS11);
drawingSheetBuilder1->SetScaleNumerator(1.0);
drawingSheetBuilder1->SetScaleDenominator(1.0);
drawingSheetBuilder1->SetUnits(Drawings::DrawingSheetBuilder::SheetUnitsMetric);
drawingSheetBuilder1->SetProjectionAngle(Drawings::DrawingSheetBuilder::SheetProjectionAngleFirst);
drawingSheetBuilder1->SetNumber("2");
drawingSheetBuilder1->SetSecondaryNumber("");
drawingSheetBuilder1->SetRevision("A");

NXObject *nXObject1;
nXObject1 = drawingSheetBuilder1->Commit();
drawingSheetBuilder1->Destroy();

workPart->Drafting()->SetTemplateInstantiationIsComplete(true);

 

技术分享图片

NXOpen 新建工程图图纸页

原文:https://www.cnblogs.com/hqsalanhuang/p/14587885.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!