找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1138|回复: 12

[求助] [已解决]保存视口截屏时 没有图像文件输出

[复制链接]

已领礼包: 12个

财富等级: 恭喜发财

发表于 2018-11-22 11:26:47 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
本帖最后由 松s_king 于 2018-11-26 09:29 编辑

源码基本照下面改的 在附件里
Capturing a Screen Shot using ObjectARX By Fenton webb
Issue
  • How to capture the screen shot of a Viewport to save it to an image file?
  • Is it possible to temporarily display an image over the Viewport or alter the Viewport display?

Solution
There are two AcGs functions in ObjectARX SDK that can be used to get the screen shot of the specified Viewport in AutoCAD and also to set an image to be displayed in a specified Viewport.
The functions are:
  • acgsGetScreenShot()
  • acgsDisplayImage()
The function acgsGetScreenShot() will get you the pointer to an AcGsScreenShot object for the specified viewport number. When in TILEMODE 1, just specify the Viewport that you are interested in or just specify “0” to get the entire ModelSpace (and same is the case with PaperSpace). Similarly just specify the Viewport number you are interested in if the TILEMODE is 0 (i.e. in PaperSpace). Also if you specify viewport number of 1 in TILEMODE 0 then you will get only the entities that exist in the PaperSpace.
You can get the image data using the method getScanline() of the AcGsScreenShot class. Using this you can fill in an array of truecolor long words which essentially will be the ARBG data. This data can be used to create an image file. You can use the ATIL SDK to create a bitmap or JPG easily from the image data.
The function acgsDisplayImage() on the other hand takes an array of truecolor long words and displays the image at the specified location on a specified Viewport. The image will stay till a redraw is called.
This function can be used to:
  • Show a temporary external image quickly.
  • Blank the entire view port temporarily.
  • Change the colors of the Viewport. Say inverting the colors of the Viewport.
Note:The acgsGetScreenShot() does not get you the shaded or rendered view.
Here’s some code which shows how to use the functions, to use the Atil libs you need to link with the headers and libs in the Atil folder of the ObjectARX SDK:
// by Fenton Webb, DevTech, 1/30/2013


[C++] 纯文本查看 复制代码
// screen shoots the view details as a BMP
bool RecordViewDetails(double &fieldWidth, double &fieldHeight, AcGePoint3d &position, AcGePoint3d &target, AcGeVector3d &upVector, const TCHAR *imagePath)
{
  int iVP = getCVPort();
 
  // Compute the viewport dimensions.
  int nLeft, nBottom, nRight, nTop;
  int iImageWidth, iImageHeight;
  acgsGetViewportInfo (iVP, nLeft, nBottom, nRight, nTop);
 
  iImageWidth  = nRight - nLeft + 1;
  iImageHeight = nTop - nBottom + 1;
  Atil::Size size(iImageWidth, iImageHeight);
  int nBytesPerRow = Atil::DataModel::bytesPerRow(iImageWidth,
                                Atil::DataModelAttributes::k32);
  unsigned long nBufferSize = iImageHeight * nBytesPerRow;
 
  // Create an ATIL image for accepting the rendered image.
  std::auto_ptr<char> autoBuff = std::auto_ptr<char>(new char[nBufferSize]);
  char *pSnapshotData = autoBuff.get(); 
  Atil::Image * pImage = NULL;
  // see if there is a GS view created
  AcGsView *pView = acgsGetGsView(iVP, false);
  // if not
  if (NULL == pView)
  {
    // then we must be in 2D wireframe mode, so use acgsGetScreenShot
    std::auto_ptr<AcGsScreenShot> autoScreenShot(acgsGetScreenShot(iVP));
    AcGsScreenShot* screenShot = autoScreenShot.get(); // auto_ptr still owns the pointer.
    if (screenShot)
    {
      int w = 0, h = 0, d = 0;
      screenShot->getSize(w, h, d);
 
      char* pBufTemp = pSnapshotData;
      for (int row = 0; row < h; row++)
      {
        memcpy(pBufTemp, screenShot->getScanline(0, row), nBytesPerRow);
 
        // convert from RGBA to BGRA
        char* pColor = pBufTemp;
        for (int i = 0; i < w; i++)    // Slow but it works
        {
          char temp = *pColor;
          *pColor = *(pColor + 2);
          *(pColor + 2) = temp;
          pColor += 4;
        }
        pBufTemp += nBytesPerRow;
      }
      pImage = constructAtilImg(reinterpret_cast<char*>(pSnapshotData),
                    nBufferSize, nBytesPerRow, w, h, 32, 0);
      std::auto_ptr<Atil::Image> autodeleter = std::auto_ptr<Atil::Image>(pImage); // auto_ptr now owns the image
 
      if (!writeImageFile(pImage, kBMP, imagePath))
      {
        acutPrintf(_T("\nFailed to write image file %s"), imagePath);
        return false;
      }
      else
        acutPrintf(_T("\nSuccessfully written %s"), imagePath);
 
    }
 
    return true;
  }
  else
  {
    return snapGSView(pView, iImageWidth, iImageHeight, fieldHeight, fieldWidth, position, target, upVector, imagePath);
  }
}
 
bool snapGSView(AcGsView *pView, int width, int height, double &fieldWidth, double &fieldHeight, AcGePoint3d &position, AcGePoint3d &target, AcGeVector3d &upVector, const TCHAR *imagePath)
{
  Atil::Size size(width, height);
  int nBytesPerRow = Atil::DataModel::bytesPerRow(width, Atil::DataModelAttributes::k32);
  unsigned long nBufferSize = height * nBytesPerRow;
 
  // Create an ATIL image for accepting the rendered image.
  std::auto_ptr<char> apCharBuffer = std::auto_ptr<char>(new char[nBufferSize]);
  char *pSnapshotData = apCharBuffer.get();  //  auto_ptr still owns the buffer.
 
  // in shaded mode (from GS)
  Atil::Image * pImage = NULL;
  pImage = constructAtilImg(pSnapshotData, nBufferSize, nBytesPerRow, width, height, 32, 0);
  std::auto_ptr<Atil::Image> autodeleter = std::auto_ptr<Atil::Image>(pImage); // auto_ptr now owns the image
  pView->getSnapShot(pImage, AcGsDCPoint(0, 0));
 
  // add a temp image to invert the image. do we have a better way to turn an image around?
  Atil::Image imgTempForInverted(pImage->read(pImage->size(), Atil::Offset(0, 0), Atil::kBottomUpLeftRight));
  *pImage = imgTempForInverted;
 
  if (!writeImageFile(pImage, kBMP, imagePath))
  {
    acutPrintf(_T("\nFailed to write image file %s"), imagePath);
    return false;
  }
  else
    acutPrintf(_T("\nSuccessfully written %s"), imagePath);
 
  // record the view data
  fieldHeight = pView->fieldHeight();
  fieldWidth = pView->fieldWidth();
  position = pView->position();
  target = pView->target();
  upVector = pView->upVector();
 
  return true;
}
 
bool writeImageFile (Atil::Image *pImageSource, eFormatType formatType,
  wchar_t const *pFileName)
{
  _ASSERT(NULL != pImageSource);
  if(NULL == pImageSource)
    return false;
 
  _ASSERT(pImageSource->isValid());
  if(!pImageSource->isValid())
    return false;
 
  if(PathFileExists(pFileName))
    DeleteFile(pFileName);
 
  /*if(PathFileExists(pFileName)) {
  if(IsFileReadOnly(pFileName)) {
  RemoveReadonlyAttribute(pFileName);
  DeleteFile(pFileName);
  }
  }*/
 
  if(PathFileExists(pFileName))
    return false;
 
  Atil::RowProviderInterface* pPipe = pImageSource->read(pImageSource->size(),
    Atil::Offset(0,0));
  _ASSERTE(NULL != pPipe);
  if(!pPipe)
    return false;
 
  Atil::FileWriteDescriptor  *pFWD = NULL;
  Atil::ImageFormatCodec     *pCodec = NULL;
 
  if (formatType == kJPG)
    pCodec = new JfifFormatCodec();
  else if (formatType == kPNG)
    pCodec = new PngFormatCodec();
  else if (formatType == kTIF)
    pCodec = new TiffFormatCodec();
  else if (formatType == kBMP)
    pCodec = new BmpFormatCodec();
 
  _ASSERTE(NULL != pCodec);
  if(NULL == pCodec)
    return false;
 
  if(!Atil::FileWriteDescriptor::isCompatibleFormatCodec(pCodec,
    &(pPipe->dataModel()), pPipe->size())) {
      delete pCodec;
      return false;
  }
 
  pFWD = new Atil::FileWriteDescriptor(pCodec);
  _ASSERTE(NULL != pFWD);
 
#ifdef UNICODE
#ifndef _ADESK_MAC_
  Atil::FileSpecifier fs(Atil::StringBuffer((lstrlen(pFileName) + 1) * sizeof(TCHAR),
    (const Atil::Byte *) pFileName, Atil::StringBuffer::kUTF_16),
    Atil::FileSpecifier::kFilePath);
#else
  Atil::FileSpecifier fs(Atil::StringBuffer((lstrlen(pFileName) + 1) * sizeof(TCHAR),
    (const Atil::Byte *) pFileName, Atil::StringBuffer::kUTF_32),
    Atil::FileSpecifier::kFilePath);
 
#endif
#else
  Atil::FileSpecifier fs(Atil::StringBuffer(lstrlen(pFileName) + 1,
    (const Atil::Byte *) pFileName, Atil::StringBuffer::kASCII),
    Atil::FileSpecifier::kFilePath);
#endif
 
  if (!pFWD->setFileSpecifier(fs))
    return false;
 
  pFWD->createImageFrame(pPipe->dataModel(), pPipe->size());
 
  if (formatType == kPNG) {
    Atil::FormatCodecPropertyInterface* pProp = pFWD->getProperty(Atil::FormatCodecPropertyInterface::kCompression);
    if (pProp != NULL) {
      PngCompression* pPngComp = (PngCompression*)(pProp);
      if ( pPngComp != NULL ) {
        // Why not compress all we can?
        pPngComp->selectCompression(PngCompressionType::kHigh);
        pFWD->setProperty(pPngComp);
      }
      delete pProp;
      pProp = NULL;
    }
  }
  else if (formatType == kTIF) {
    Atil::FormatCodecPropertyInterface* pProp = pFWD->getProperty(Atil::FormatCodecPropertyInterface::kCompression);
    if (pProp != NULL) {
      TiffCompression* pComp = (TiffCompression*)(pProp);
      if ( pComp != NULL ) {
        // G4 is only valid for 1 bit images.
        if ( pComp->selectCompression(TiffCompressionType::kCCITT_FAX4) == false ) {
          // So if that fails, resort to LZW now that it is patent free
          if ( pComp->selectCompression(TiffCompressionType::kLZW) == false ) {
            // If that fails (and is shouldn't, be) then set none.
            pComp->selectCompression(TiffCompressionType::kNone);
          }
        }
        pFWD->setProperty(pComp);
      }
      delete pProp;
      pProp = NULL;
    }
  }
// get the current vp
int getCVPort()
{
  struct resbuf rb;
  ads_getvar(_T("CVPORT"), &rb);
  return rb.resval.rint;
}
 
Atil::DataModel* colorSpace (char *&pRGBData, int colorDepth, int paletteSize)
{
  _ASSERT(NULL != pRGBData);
 
  // Setup a color space, with palette if needed
  Atil::DataModel *pDm = NULL;
  if (colorDepth == 8) {
    Atil::RgbColor space[256];
 
    Atil::RgbPaletteModel *pPM = new Atil::RgbPaletteModel();
    _ASSERT(NULL != pPM);
    if(!pPM)
      return NULL;
 
    pDm = pPM;
    char *palette = pRGBData;
    pRGBData += paletteSize;
    for (int i = 0; i < paletteSize; i += 4)
      space[i / 4] = Atil::RgbColor(palette[i+2],palette[i+1],palette, 255);
    pPM->setEntries(0, 256, (Atil::RgbColor *)&space);
  } else
    pDm = new Atil::RgbModel(32);
 
 
  _ASSERT(NULL != pDm);
  return pDm;
}
 
Atil::Image *constructAtilImg(char *pRGBData,
  unsigned long bufferSize, unsigned long rowBytes,
  unsigned long xSize, unsigned long ySize, int colorDepth, int paletteSize)
{
  if ((8 != colorDepth) && (32 != colorDepth))
  {
    return NULL;
  }
 
  if (paletteSize)
  {
    if ((paletteSize < 0) || (paletteSize > 255))
    {
      return NULL;
    }
  }
 
  if ((xSize <= 0) || (ySize <= 0))
  {
    return NULL;
  }
 
  Atil::Image *pImg = NULL;
  Atil::Size size(xSize, ySize);
 
  // construct the Atil::Image object
  if (pRGBData) {
 
    // Check the buffer for size and definition
    if (bufferSize) {
      if (!rowBytes) {
        return NULL;
      }
 
      // did they allocate enough?
      if (rowBytes * ySize > bufferSize) {
        return NULL;
      }
    }
    else {
      return NULL;
    }       
 
    Atil::DataModel *pM = colorSpace(pRGBData, colorDepth, paletteSize);
    _ASSERT(NULL != pM);
    if(NULL == pM)
      return NULL;
 
    try {
      // BEWARE: pRGBData may be moved in colorSpace
      pImg = new Atil::Image(pRGBData, bufferSize,
        rowBytes, size, pM); 
    } catch (Atil::ATILException* pExpCon) {
      // image construction failure
      delete pExpCon;
      delete pM;
      pImg = NULL;
      _ASSERT(FALSE);
      return NULL;
    }
 
    delete pM;
  }
  else {
    Atil::RgbModel     rgbM(32);
    Atil::RgbGrayModel gM;
 
    Atil::ImagePixel initialColor(colorDepth == 32 ?
      Atil::DataModelAttributes::kRgba :
    Atil::DataModelAttributes::kGray);
    initialColor.setToZero();
 
    try {
      pImg = new Atil::Image(size,
        colorDepth == 32 ? &rgbM : &gM,
        initialColor);
    } catch (Atil::ATILException* pExpCon) {
      // image construction failure
      delete pExpCon;
      pImg = NULL;
      _ASSERT(FALSE);
      return NULL;
    }
  }
 
  _ASSERT(NULL != pImg);
  return pImg;
}
 
bool getTempImgFile(TCHAR * fileName)
{
  // Here we create a temp bmp file as a transitional file
  TCHAR tempDic[MAX_PATH];
  ::memset(tempDic,0,MAX_PATH);
  DWORD nRetSize = ::GetTempPath(MAX_PATH,tempDic);
  if (nRetSize > MAX_PATH || nRetSize == 0)
  {
    const TCHAR * tempStr = _T("C:\\temp");
    if (wcscpy_s(tempDic,tempStr) != 0)
    {
      return false;
    }
 
    if (::PathFileExists(tempStr) == FALSE &&
      ::CreateDirectory(tempStr,NULL) == FALSE)
    {
      return false;
    }
  }
 
  // create the temp file whose prefix is "img"
  if (::GetTempFileName(tempDic,_T("tmp"),0,fileName) == 0)
  {
    return false;
  }
 
  // now split the filepath into its individual components
  TCHAR drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
  _tsplitpath (fileName, drive, dir, fname, ext);
  _stprintf(fileName, _T("%s%s%s.bmp"), drive, dir, fname);
 
  return true;
}


放CAD2017+VS2015里面调是调通了 也打印出了Success  但是不生成图像文件
修改后的代码在附件里面 直接改了smaples\entity\highlight_dg工程的cpp调的
有大佬实在闲的可以帮忙看看





hilight.cpp

18.66 KB, 下载次数: 9, 下载积分: D豆 -1 , 活跃度 1

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 40个

财富等级: 招财进宝

发表于 2018-11-22 11:50:36 | 显示全部楼层
是图像文件没生成,还是生成图片但是没截到图,全是黑色?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 12个

财富等级: 恭喜发财

 楼主| 发表于 2018-11-22 14:07:24 | 显示全部楼层
newer 发表于 2018-11-22 11:50
是图像文件没生成,还是生成图片但是没截到图,全是黑色?

没有在文件路径下生成目标文件

点评

那就是每执行到生成文件的地方啊 bool writeImageFile (Atil::Image *pImageSource, eFormatType formatType, wchar_t const *pFileName) 你调试下看看执行到这个函数里面没,执行到哪个地方return了  详情 回复 发表于 2018-11-22 14:23
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 20个

财富等级: 恭喜发财

发表于 2018-11-22 14:23:24 | 显示全部楼层
松s_king 发表于 2018-11-22 14:07
没有在文件路径下生成目标文件

那就是每执行到生成文件的地方啊


bool writeImageFile (Atil::Image *pImageSource, eFormatType formatType,
  wchar_t const *pFileName)

你调试下看看执行到这个函数里面没,执行到哪个地方return了
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 12个

财富等级: 恭喜发财

 楼主| 发表于 2018-11-22 14:38:44 | 显示全部楼层
本帖最后由 松s_king 于 2018-11-22 14:39 编辑
marting 发表于 2018-11-22 14:23
那就是每执行到生成文件的地方啊

在调用这个函数的时候都有这一段  而在插件运行结束 都会在控制台打印Successfully written filename 这一段 应该能说明 已经执行了这个函数吧if (!writeImageFile(pImage, kBMP, imagePath))
  {
    acutPrintf(_T("\nFailed to write image file %s"), imagePath);
    return false;
  }
  else
    acutPrintf(_T("\nSuccessfully written %s"), imagePath);


点评

别猜啊,加上打印语句,你那个函数里面好几个return呢,可能是pImage=NULL呢,那就是创建图像的地方有问题。  详情 回复 发表于 2018-11-22 14:46
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 12个

财富等级: 恭喜发财

 楼主| 发表于 2018-11-22 14:45:35 | 显示全部楼层
在生成图像文件后 程序还会获取窗口的一些参数 后来发现这些参数也是有问题的 在排查是不是这些参数设置导致写入文件的不成功

  // record the view data
  fieldHeight = pView->fieldHeight();
  fieldWidth = pView->fieldWidth();
  position = pView->position();
  target = pView->target();
  upVector = pView->upVector();


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 13个

财富等级: 恭喜发财

发表于 2018-11-22 14:46:26 | 显示全部楼层
松s_king 发表于 2018-11-22 14:38
在调用这个函数的时候都有这一段  而在插件运行结束 都会在控制台打印Successfully written filename 这 ...

别猜啊,加上打印语句,你那个函数里面好几个return呢,可能是pImage=NULL呢,那就是创建图像的地方有问题。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 12个

财富等级: 恭喜发财

 楼主| 发表于 2018-11-22 14:50:55 | 显示全部楼层
LoveArx 发表于 2018-11-22 14:46
别猜啊,加上打印语句,你那个函数里面好几个return呢,可能是pImage=NULL呢,那就是创建图像的地方有问 ...

这还真不是我猜...我自己单步跟进去 是进了snapGSview 然后也的确是在snapGSview里面打印输出的

点评

生成图片文件的函数是 writeImageFile , 代码能进到这个里面,并且pImage不为NULL,才会创建文件  详情 回复 发表于 2018-11-22 15:29
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 20个

财富等级: 恭喜发财

发表于 2018-11-22 15:29:30 | 显示全部楼层
本帖最后由 marting 于 2018-11-22 15:30 编辑
松s_king 发表于 2018-11-22 14:50
这还真不是我猜...我自己单步跟进去 是进了snapGSview 然后也的确是在snapGSview里面打印输出的

生成图片文件的函数是 writeImageFile , 代码能进到这个里面,并且pImage不为NULL,才会创建文件
如果你过了writeImageFile 里面前面的几个return, 那么还生成不了,那你就看看你给的目录是否有权限写文件吧。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 12个

财富等级: 恭喜发财

 楼主| 发表于 2018-11-22 15:46:37 | 显示全部楼层
marting 发表于 2018-11-22 15:29
生成图片文件的函数是 writeImageFile , 代码能进到这个里面,并且pImage不为NULL,才会创建文件
如果 ...

文件路径在非系统盘根目录下
换了几次 不行还是

点评

你在 writeImageFile 这个函数里面适当位置,加上几个打印语句,看看执行到这个地方什么情况 你要离创建文件最近的上面加。  详情 回复 发表于 2018-11-22 16:05
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 40个

财富等级: 招财进宝

发表于 2018-11-22 16:05:05 | 显示全部楼层
松s_king 发表于 2018-11-22 15:46
文件路径在非系统盘根目录下
换了几次 不行还是

你在 writeImageFile 这个函数里面适当位置,加上几个打印语句,看看执行到这个地方什么情况
你要离创建文件最近的上面加。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 12个

财富等级: 恭喜发财

 楼主| 发表于 2018-11-22 16:30:15 | 显示全部楼层
newer 发表于 2018-11-22 16:05
你在 writeImageFile 这个函数里面适当位置,加上几个打印语句,看看执行到这个地方什么情况
你要离创建 ...

TIM图片20181122162839.png

另外这个异常是什么意思啊
捕获.PNG
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2018-11-22 23:41:31 | 显示全部楼层
https://forums.autodesk.com/t5/o ... -issue/td-p/4942172
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-4-18 20:15 , Processed in 0.257565 second(s), 62 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表