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

    怡宁塑胶模具设计
  • 相关阅读:
    模块化项目
    mysql mybatis-generator plugin 有page实体类的分页
    mysql mybatis-generator plugin 分页
    eclipse中mybatis generator插件的安装与使用,实现自动生成代码
    linux下安装mysql5.7.17及简单配置
    mybatis-mysql操作存储过程
    解决JSP路径问题的方法(jsp文件开头path, basePath作用)
    windows下开启mysql远程访问
    Java中hashCode的作用
    垃圾收集器与内存分配策略 (深入理解JVM二)
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14587885.html
Copyright © 2020-2023  润新知