当前位置:网站首页>CAD ARX gets the current viewport settings
CAD ARX gets the current viewport settings
2022-07-06 07:57:00 【zxt_ net】
AcDbViewTableRecord GetCurrentView()
{
AcDbViewTableRecord view;
struct resbuf rb;
struct resbuf wcs, ucs, dcs; // Coordinate system mark used when converting coordinates
wcs.restype = RTSHORT;
wcs.resval.rint = 0;
ucs.restype = RTSHORT;
ucs.resval.rint = 1;
dcs.restype = RTSHORT;
dcs.resval.rint = 2;
// Get the current viewport's “ see ” Pattern
acedGetVar(“VIEWMODE”, &rb);
view.setPerspectiveEnabled(rb.resval.rint & 1);
view.setFrontClipEnabled(rb.resval.rint & 2);
view.setBackClipEnabled(rb.resval.rint & 4);
view.setFrontClipAtEye(!(rb.resval.rint & 16));
// The center point of the view in the current viewport (UCS coordinate )
acedGetVar(“VIEWCTR”, &rb);
acedTrans(rb.resval.rpoint, &ucs, &dcs, 0, rb.resval.rpoint);
view.setCenterPoint(AcGePoint2d(rb.resval.rpoint[X],
rb.resval.rpoint[Y]));
// The focal length of the lens in the perspective view of the current viewport ( In millimetres )
acedGetVar(“LENSLENGTH”, &rb);
view.setLensLength(rb.resval.rreal);
// The position of the target point in the current viewport ( With UCS Coordinate representation )
acedGetVar(“TARGET”, &rb);
acedTrans(rb.resval.rpoint, &ucs, &wcs, 0, rb.resval.rpoint);
view.setTarget(AcGePoint3d(rb.resval.rpoint[X],
rb.resval.rpoint[Y], rb.resval.rpoint[Z]));
// The viewing direction of the current viewport (UCS)
acedGetVar(“VIEWDIR”, &rb);
acedTrans(rb.resval.rpoint, &ucs, &wcs, 1, rb.resval.rpoint);
view.setViewDirection(AcGeVector3d(rb.resval.rpoint[X],
rb.resval.rpoint[Y], rb.resval.rpoint[Z]));
// View height of the current viewport ( Graphic units )
acedGetVar(“VIEWSIZE”, &rb);
view.setHeight(rb.resval.rreal);
double height = rb.resval.rreal;
// The size of the current viewport in pixels (X and Y value )
acedGetVar(“SCREENSIZE”, &rb);
view.setWidth(rb.resval.rpoint[X] / rb.resval.rpoint[Y] * height);
// The view twist angle of the current viewport
acedGetVar(“VIEWTWIST”, &rb);
view.setViewTwist(rb.resval.rreal);
// Make the model tab or the last Layout tab current
acedGetVar(“TILEMODE”, &rb);
int tileMode = rb.resval.rint;
// Set the identification code of the current viewport
acedGetVar(“CVPORT”, &rb);
int cvport = rb.resval.rint;
// Is it a view of model space
bool paperspace = ((tileMode == 0) && (cvport == 1)) ? true : false;
view.setIsPaperspaceView(paperspace);
if (!paperspace)
{
// The offset of the front clipping plane from the target plane in the current viewport
acedGetVar(“FRONTZ”, &rb);
view.setFrontClipDistance(rb.resval.rreal);
// Get the offset value from the back clipping plane of the current viewport to the target plane
acedGetVar(“BACKZ”, &rb);
view.setBackClipDistance(rb.resval.rreal);
}
else
{
view.setFrontClipDistance(0.0);
view.setBackClipDistance(0.0);
}
return view;
}
边栏推荐
- [1. Delphi foundation] 1 Introduction to Delphi Programming
- Force buckle day31
- Cf1036c class numbers solution
- National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
- Luogu p4127 [ahoi2009] similar distribution problem solution
- [非线性控制理论]9_非线性控制理论串讲
- Google may return to the Chinese market after the Spring Festival.
- Nc204382 medium sequence
- [redis] Introduction to NoSQL database and redis
- shu mei pai
猜你喜欢

. Net 6 learning notes: what is NET Core
Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
![[1. Delphi foundation] 1 Introduction to Delphi Programming](/img/14/272f7b537eedb0267a795dba78020d.jpg)
[1. Delphi foundation] 1 Introduction to Delphi Programming

【T31ZL智能视频应用处理器资料】

Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center

Solution: système de surveillance vidéo intelligent de patrouille sur le chantier

It's hard to find a job when the industry is in recession

数据治理:主数据的3特征、4超越和3二八原则

将 NFT 设置为 ENS 个人资料头像的分步指南

octomap averageNodeColor函数说明
随机推荐
Nc204382 medium sequence
C # display the list control, select the file to obtain the file path and filter the file extension, and RichTextBox displays the data
"Designer universe": "benefit dimension" APEC public welfare + 2022 the latest slogan and the new platform will be launched soon | Asia Pacific Financial Media
Type of data in energy dashboard
xpath中的position()函数使用
Opencv learning notes 9 -- background modeling + optical flow estimation
Machine learning - decision tree
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
Learn Arduino with examples
opencv学习笔记九--背景建模+光流估计
数据治理:误区梳理篇
Simulation of holographic interferogram and phase reconstruction of Fourier transform based on MATLAB
Go learning notes (3) basic types and statements (2)
49. Sound card driven article collection
Is the super browser a fingerprint browser? How to choose a good super browser?
Artcube information of "designer universe": Guangzhou implements the community designer system to achieve "great improvement" of urban quality | national economic and Information Center
PHP - Common magic method (nanny level teaching)
C # connect to SQLite database to read content
A Closer Look at How Fine-tuning Changes BERT
CAD ARX 获取当前的视口设置