码迷,mamicode.com
首页 > 其他好文 > 详细

NXOpen 新建工程图图纸页

时间:2021-03-29 12:52:23      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:horizon   tst   iterator   fir   end   rev   ack   etl   turn   

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 新建工程图图纸页

标签:horizon   tst   iterator   fir   end   rev   ack   etl   turn   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!