zoukankan      html  css  js  c++  java
  • NXOpen打开当前部件所在目录

    C++ 2010

    //用户代码
    #include <NXOpen/ListingWindow.hxx> //打印信息
    #include <NXOpen/NXException.hxx>   //异常处理
    #include <NXOpen/Part.hxx>
    #include <NXOpen/PartCollection.hxx>
    #include <NXOpen/BasePart.hxx>
    #include <atlstr.h>
    #include <iostream>
    #include <sstream>


     //用户代码

     theSession->ListingWindow()->Open();//打开信息窗口
     BasePart *basedisplaypart = theSession->Parts()->BaseDisplay();//获取顶层显示部件
     NXString directory = basedisplaypart->FullPath();//获取顶层显示部件路径
     string  filedirectorypath = directory.GetLocaleText();//字符串转换
     int end1 = (int)filedirectorypath.find_last_of("\");//找到顶层显示部件路径中的最后一个反斜杠
     string filedirectorypath1 = filedirectorypath.substr( 0, end1 + 1 );//分割部件全路径名获取显示部件路径
     //theSession->ListingWindow()->WriteLine(filedirectorypath1);

     //方法一
     ShellExecute(NULL,"open","Explorer.exe",filedirectorypath1.c_str(),NULL,SW_SHOWDEFAULT);

     //方法二
     //char filedirectorypath2[256];
     //sprintf (filedirectorypath2,"start "" "%s"",filedirectorypath1.c_str());
     //theSession->ListingWindow()->WriteLine(filedirectorypath2);
     //system(filedirectorypath2); //打开路径

     

    怡宁塑胶模具设计
  • 相关阅读:
    士兵杀死(两)(南阳116)
    Android 墙纸设置代码 详细说明
    Laravel nginx 伪静态规则
    STL源代码分析——STL算法merge合并算法
    第29周六
    第29周五
    第29周四
    第29周三
    2014第29周二
    第29周一
  • 原文地址:https://www.cnblogs.com/hqsalanhuang/p/14459656.html
Copyright © 2011-2022 走看看