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

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

SetcurrentVPORT及封装ARX函数

  • 62 次阅读
  • 3 次下载
  • 2025/5/1 23:36:47

alex

\

If tilemode == 0, then you can use acedGetCurViewportObjectId() to get the objectId of the current AcDbViewport, open that and read the view information from it.

If tilemode == 1, then you can use acedVports2VportTableRecords() to force the *active records to be updated to match the current views on screen. After that, the first *active record will be for the currently active view.

Don't use acedVports2VportTableRecords() any more than absolutely necessary because it erases the existing *active records and creates new ones for the current views, so every time you use this function you will increase memory usage because erased objects stay in memory until the drawing is closed.

\Hi Art,

If I understand you correctly, there is no way to get the current view info other than going thru' the

[get System var + AcDbViewTableRecord.setXX()] process. And there are 17 of them. Pity. Thanks, alex n.b.

To be sure, I don't need the zoom prev info, just the current view parameters.

[Attachment: att1.html]

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

Reply From: Art Cooney Date: Jul/12/04 - 04:48 (GMT)

Re: CurrentView

For tilemode == 1 you can use acedSetCurrentVPort() (in aced.h) to try and set the current viewport index to a value greater than 2. If that succeeds, then there are multiple views.

For tilemode == 0 you can use acedGetCurViewportObjectId() (in aced.h) to get the objectId of the currently active viewport. Then open that viewport and use AcDbViewport methods on it to get the information you want.

\Hi Art,

Thanks for the help.

One more question (actually two): how can I check - in tilemode == 1 - if there is only one view or the

screen is split into views.

Also, I'm not clear about the setup in acad2000/samples/Campus.dwg: how do I know - programatically - what is the current view (tilemode == 0), perspective mode and space (paper or model). alex

\

If tilemode == 0, then you can use acedGetCurViewportObjectId() to get the objectId of the current AcDbViewport, open that and read the view information from it.

If tilemode == 1, then you can use acedVports2VportTableRecords() to force the *active records to be updated to match the current views on screen. After that, the first *active record will be for the currently active view.

Don't use acedVports2VportTableRecords() any more than absolutely necessary because it erases the existing *active records and creates new ones for the current views, so every time you use this function you will increase memory usage because erased objects stay in memory until the drawing is closed.

\Hi Art,

If I understand you correctly, there is no way to get the current view info other than going thru' the

[get System var + AcDbViewTableRecord.setXX()] process. And there are 17 of them. Pity. Thanks, alex n.b.

To be sure, I don't need the zoom prev info, just the current view parameters.

[Attachment: att1.html]

? Copyright 2006 Autodesk, Inc. All rights reserved. Legal Notices & Trademarks - Privacy Policy

封装ARX函数

2010年03月24日 星期三 下午 04:11 选择指定图层上的所有实体

Acad::ErrorStatus selectEntityInLayer(const char* nLayerName,AcDbObjectIdArray& nIDs) {

Acad::ErrorStatus es = Acad::eOk; ads_name ents;

struct resbuf *rb;

rb=acutNewRb(AcDb::kDxfLayerName); rb->restype=8;

rb->resval.rstring=(char*)nLayerName; rb->rbnext=NULL;

acedSSGet(\long entNums=0;

acedSSLength(ents,&entNums); if (entNums == 0)

es = Acad::eInvalidInput; else {

for (long a = 0; a < entNums ; a ++) {

AcDbObjectId objId; ads_name ent;

acedSSName(ents,a,ent);

acdbGetObjectId(objId, ent); nIDs.append(objId); } }

acedSSFree(ents); acutRelRb(rb); return es; }

设置当前层

Acad::ErrorStatus SetCurLayer(const char* lpLayerName, AcDbDatabase* pDb/* = NULL */) {

AcDbDatabase* pCurDb = pDb; if (pCurDb == NULL)

pCurDb = acdbHostApplicationServices()->workingDatabase(); AcDbLayerTableRecordPointer spRecord(lpLayerName, pCurDb, AcDb::kForRead);

Acad::ErrorStatus es = spRecord.openStatus(); if (es == Acad::eOk) {

es = pCurDb->setClayer(spRecord->objectId()); }

return es; }

生成新组

//生成新组(sGroupName)

//追加数组中所有实体到该组中 //组名字 , Id数组

int createGroup(CString sGroupName, const AcDbObjectIdArray *idArr) {

AcDbGroup *pGroup = new AcDbGroup((LPSTR)(LPCTSTR)sGroupName); AcDbObjectId groupObjectId;

AcDbDictionary *pGroupDict = NULL;

acdbHostApplicationServices()->workingDatabase() ->getGroupDictionary(pGroupDict, AcDb::kForWrite); pGroupDict->setAt(sGroupName, pGroup, groupObjectId); pGroupDict->close(); pGroup->close();

acdbOpenObject(pGroup, groupObjectId, AcDb::kForWrite); for (int i = 0; i < idArr->length(); i++) {

groupObjectId = idArr->at(i); pGroup->append(groupObjectId); }

pGroup->close(); return TRUE; }

建立文本格式表函数

AcDbObjectId CreateNewTextStyle() {

AcDbTextStyleTable *pTextStyleTable;

AcDbTextStyleTableRecord *pTextStyleTableRcd AcDbObjectId textId;

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

共分享92篇相关文档

文档简介:

alex \If tilemode == 0, then you can use acedGetCurViewportObjectId() to get the objectId of the current AcDbViewport, open that and read the view information from it. If tilemode == 1, then you can use acedVports2VportTableRecords() to force the *active records to be updated to match the current views on screen. After that, the first *active record will be for the current

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价: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