admin 发表于 2020-5-27 16:26:32

NX二次开发源码分享:更新所有图纸的视图到最新


NX二次开发源码分享:更新所有图纸的视图到最新


// TODO: add your code here
    DrawingSheetCollection* dcol = displayPart->DrawingSheets();

    for (DrawingSheetCollection::iterator it = dcol->begin();   it != dcol->end(); it++)
    {
      DrawingSheet* sheet = (*it);
      print("\nSheet Name: " + sheet->Name() );
      
      std::vector<NXOpen::Drawings::DraftingView *> dw = (*it)->GetDraftingViews();
            
      for (unsigned int ii=0; ii<dw.size(); ii++)
      {
            print( "" + dw->Name() );
      }   

      print("Updating all drafting views through DraftingViewCollection...\n");
      DraftingViewCollection* dvcol = displayPart->DraftingViews();
      dvcol->UpdateViews(DraftingViewCollection::ViewUpdateOptionAll, sheet);
      
    }

开始 发表于 2020-9-2 18:11:34

谢谢大神分享!!!!
页: [1]
查看完整版本: NX二次开发源码分享:更新所有图纸的视图到最新