云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > SetcurrentVPORT及封装ARX函数

SetcurrentVPORT及封装ARX函数

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 1:22:51

extern \acedSetCurrentVPort( AcDbViewport* pVp);

pVp Input pointer to viewport to make current

This function sets the current viewport from the AcDbViewport object pointed to by pVp.

SysVarWillChange and SysVarChanged notification are generated by this function.

You must be in model space for this function to work properly. This can be done using the following steps:

1. Turn TILEMODE off and switch to paper space if necessary. 2. Create a viewport using acedCommand/MVIEW.

3. Use acedCommand/zoom-extents to ensure that the view was on the

screen. 4. Make sure that the viewport was turned on using acedCommand MVIEW/ON

last.

5. Switch to model space using acedCommand /MSPACE.

6. Set CVPORT to the number of your viewport to ensure that your

viewport is active. Alternatively, to avoid the use of acedCommand, you can use the following steps:

1. Instantiate a viewport object

2. Turn TILEMODE off and switch to paper space if necessary.

3. Use acedSetCurrentView to zoom out to make sure that the viewport

is viewable.

4. Open the viewport for write, and ensure that it is activated. 5. Switch to model space using acedSetCurrentView. 6. Close the viewport. Returns Acad::eOk if successful.

Returns Acad::eOutOfRange if the specified viewport isn't valid for the current environment.

Returns Acad::eNullObjectPointer if pVP is NULL.

Acad::ErrorStatus acedSetCurrentVPort( int vpnumber);

vpnumber Input index number of viewport to make current

This function sets the current viewport from the viewport index vpnumber. Viewport index numbers are the numbers reported by the CVPORT system variable.

SysVarWillChange and SysVarChanged notification are generated by this function.

Returns Acad::eOk if successful.

Returns Acad::eOutOfRange if vpnumber isn't valid for the current environment.

Include File

aced.h

Acad::ErrorStatus acedSetCurrentView(

AcDbViewTableRecord * pVwRec, AcDbViewport * pVP);

pVwRec Input pointer to ViewTableRecord to read data from pVP

Input pointer to Viewport to set view within

This function uses the information from the AcDbViewTableRecord pointed to by pVwRec to set the view in the AcDbViewport pointed to by pVP (if pVP != NULL) or in the current viewport (if pVP == NULL).

Note The ViewTableRecord pointed to by pVwRec should be opened for read, not for write.

If pVwRec points to a ViewTableRecord defining a non-paper space view, paper space is active, and pVP is not NULL, then the current viewport is changed to pVP.

If the pVwRec ViewTableRecord points to a paper space view, and paper space is not currently active, then an attempt is made to switch to paper space. Trans-space view changes are not allowed.

This function cannot be used while an acedCommand is active. Returns Acad::eOk on success.

Returns Acad::eCommandWasInProgress if a trans-space view change is attempted or an acedCommand is in progress and fastzoom is off. Returns Acad::eNullObjectPointer if pVwRec is NULL. Returns the same if pVP is NULL, pVwRec points to a ViewTableRecord that defines a non-paper space view, and paper space is active.

Returns Acad::eBadPaperspaceView if the pVwRec points to a paper space view, and paper space is not active.

Returns Acad::eNotInPaperspace if an attempt is made to switch to paper space, but tilemode is 1.

Include File

aced.h

Re: Paperspace activate

Acad::ErrorStatus acedPspace(AcDbDatabase* db); Andy

Discussion Groups Index > AutoCAD Groups > Autodesk ObjectARX > CurrentView You currently have browse capabilities only. Please log in for additional capabilities.

CurrentView (7 replies) Posted by: alex

Date: Jul/04/04 - 03:41 (GMT)

Hello group,

Is there a Get method parallel to acedSetCurrentView() ? I can't seem to find one in the docs. Thanks, alex

--------------------------------------------------------------------------------

Reply From: Justavian Date: Jul/09/04 - 00:05 (GMT)

Re: CurrentView

I'm pretty sure that you have to manually assemble the current system values in order to get an AcDbViewTableRecord of the current view. What are you hoping to retrieve? Here are some useful system variables:

VIEWMODE VIEWCTR VIEWDIR VIEWSIZE VIEWTWIST BACKZ FRONTZ

LENSLENGTH TARGET

Using the values stored in those variables, you can create an

AcDbViewTableRecord of the current view. If you're a member of the ADN, i believe there's an article on this. If you're not, just look at the documentation for the AcDbViewTableRecord - there's a function for setting most of those values. So just retrieve the system variable and call the associated function to set it in the view record.

Let me know if you need some more tips...

搜索更多关于: SetcurrentVPORT及封装ARX函数 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

extern \acedSetCurrentVPort( AcDbViewport* pVp); pVp Input pointer to viewport to make current This function sets the current viewport from the AcDbViewport object pointed to by pVp. SysVarWillChange and SysVarChanged notification are generated by this function. You must be in model space for this function to work properly. This can be done using the following steps:

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com