当前位置:网站首页>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;
}
边栏推荐
- Position() function in XPath uses
- Data governance: misunderstanding sorting
- The State Economic Information Center "APEC industry +" Western Silicon Valley will invest 2trillion yuan in Chengdu Chongqing economic circle, which will surpass the observation of Shanghai | stable
- Redis list detailed explanation of character types yyds dry goods inventory
- How to estimate the number of threads
- 21. Delete data
- 解决方案:智慧工地智能巡檢方案視頻監控系統
- 【T31ZL智能视频应用处理器资料】
- Luogu p1836 number page solution
- The Vice Minister of the Ministry of industry and information technology of "APEC industry +" of the national economic and information technology center led a team to Sichuan to investigate the operat
猜你喜欢
[untitled]
Basics of reptile - Scratch reptile
A Closer Look at How Fine-tuning Changes BERT
Database basic commands
Wireshark grabs packets to understand its word TCP segment
Parameter self-tuning of relay feedback PID controller
The Vice Minister of the Ministry of industry and information technology of "APEC industry +" of the national economic and information technology center led a team to Sichuan to investigate the operat
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
opencv学习笔记九--背景建模+光流估计
Epoll and IO multiplexing of redis
随机推荐
Type of data in energy dashboard
Solution: intelligent site intelligent inspection scheme video monitoring system
链表面试题(图文详解)
Webrtc series-h.264 estimated bit rate calculation
The difference between TS Gymnastics (cross operation) and interface inheritance
Google可能在春节后回归中国市场。
Launch APS system to break the problem of decoupling material procurement plan from production practice
软件开发的一点随记
PHP - Common magic method (nanny level teaching)
21. Delete data
MFC 给列表控件发送左键单击、双击、以及右键单击消息
Database addition, deletion, modification and query
HTTP cache, forced cache, negotiated cache
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
二叉树创建 & 遍历
C # display the list control, select the file to obtain the file path and filter the file extension, and RichTextBox displays the data
Flash return file download
Basics of reptile - Scratch reptile
Hackathon ifm
octomap averageNodeColor函数说明