当前位置:网站首页>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;
}
边栏推荐
- Solution: intelligent site intelligent inspection scheme video monitoring system
- Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
- "Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
- [Yugong series] February 2022 U3D full stack class 011 unity section 1 mind map
- Sanzi chess (C language)
- 【Redis】NoSQL数据库和redis简介
- National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
- [非线性控制理论]9_非线性控制理论串讲
- 合规、高效,加快药企数字化转型,全新打造药企文档资源中心
- 珠海金山面试复盘
猜你喜欢
Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
[nonlinear control theory]9_ A series of lectures on nonlinear control theory
In the era of digital economy, how to ensure security?
让学指针变得更简单(三)
数字经济时代,如何保障安全?
esRally国内安装使用避坑指南-全网最新
It's hard to find a job when the industry is in recession
Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
成为优秀的TS体操高手 之 TS 类型体操前置知识储备
随机推荐
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
A Closer Look at How Fine-tuning Changes BERT
Interview Reply of Zhuhai Jinshan
Vit (vision transformer) principle and code elaboration
[Yugong series] February 2022 U3D full stack class 011 unity section 1 mind map
The difference between TS Gymnastics (cross operation) and interface inheritance
[untitled]
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
Data governance: misunderstanding sorting
Type of data in energy dashboard
实现精细化生产, MES、APS、ERP必不可少
DataX self check error /datax/plugin/reader/_ drdsreader/plugin. Json] does not exist
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
"Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
TS 体操 &(交叉运算) 和 接口的继承的区别
Get the path of edge browser
解决方案:智慧工地智能巡檢方案視頻監控系統
esRally国内安装使用避坑指南-全网最新
Wonderful use of TS type gymnastics string