• NXOpen 新建工程图图纸页


    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);

    怡宁塑胶模具设计
  • 相关阅读:
    Linux 下安装配置 JDK7
    win7下virtualbox装linux共享win7文件问题(已测试可用)
    Linix常用命令
    JAVA命令大全
    virtualbox 不能为虚拟电脑打开一个新任务/VT-x features locked or unavailable in MSR.
    VirtualBox下安装rhel5.5 linux系统
    redhat RHEL 5.5 下载地址
    ios开发@selector的函数如何传参数/如何传递多个参数
    U盘10分钟安装linux系统
    史上最浅显易懂的Git分布式版本控制系统教程
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14587885.html
Copyright © 2020-2023  润新知