当前位置:网站首页>CAD ARX 获取当前的视口设置
CAD ARX 获取当前的视口设置
2022-07-06 07:51:00 【zxt_net】
AcDbViewTableRecord GetCurrentView()
{
AcDbViewTableRecord view;
struct resbuf rb;
struct resbuf wcs, ucs, dcs; // 转换坐标时使用的坐标系统标记
wcs.restype = RTSHORT;
wcs.resval.rint = 0;
ucs.restype = RTSHORT;
ucs.resval.rint = 1;
dcs.restype = RTSHORT;
dcs.resval.rint = 2;
// 获得当前视口的“查看”模式
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));
// 当前视口中视图的中心点(UCS坐标)
acedGetVar(“VIEWCTR”, &rb);
acedTrans(rb.resval.rpoint, &ucs, &dcs, 0, rb.resval.rpoint);
view.setCenterPoint(AcGePoint2d(rb.resval.rpoint[X],
rb.resval.rpoint[Y]));
// 当前视口透视图中的镜头焦距长度(单位为毫米)
acedGetVar(“LENSLENGTH”, &rb);
view.setLensLength(rb.resval.rreal);
// 当前视口中目标点的位置(以 UCS 坐标表示)
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]));
// 当前视口的观察方向(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]));
// 当前视口的视图高度(图形单位)
acedGetVar(“VIEWSIZE”, &rb);
view.setHeight(rb.resval.rreal);
double height = rb.resval.rreal;
// 以像素为单位的当前视口的大小(X 和 Y 值)
acedGetVar(“SCREENSIZE”, &rb);
view.setWidth(rb.resval.rpoint[X] / rb.resval.rpoint[Y] * height);
// 当前视口的视图扭转角
acedGetVar(“VIEWTWIST”, &rb);
view.setViewTwist(rb.resval.rreal);
// 将模型选项卡或最后一个布局选项卡置为当前
acedGetVar(“TILEMODE”, &rb);
int tileMode = rb.resval.rint;
// 设置当前视口的标识码
acedGetVar(“CVPORT”, &rb);
int cvport = rb.resval.rint;
// 是否是模型空间的视图
bool paperspace = ((tileMode == 0) && (cvport == 1)) ? true : false;
view.setIsPaperspaceView(paperspace);
if (!paperspace)
{
// 当前视口中前向剪裁平面到目标平面的偏移量
acedGetVar(“FRONTZ”, &rb);
view.setFrontClipDistance(rb.resval.rreal);
// 获得当前视口后向剪裁平面到目标平面的偏移值
acedGetVar(“BACKZ”, &rb);
view.setBackClipDistance(rb.resval.rreal);
}
else
{
view.setFrontClipDistance(0.0);
view.setBackClipDistance(0.0);
}
return view;
}
边栏推荐
- [t31zl intelligent video application processor data]
- (lightoj - 1410) consistent verbs (thinking)
- Solution: intelligent site intelligent inspection scheme video monitoring system
- Comparison of usage scenarios and implementations of extensions, equal, and like in TS type Gymnastics
- shu mei pai
- 洛谷P1836 数页码 题解
- National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
- C intercept string
- 【Redis】NoSQL数据库和redis简介
- Esrally domestic installation and use pit avoidance Guide - the latest in the whole network
猜你喜欢
. Net 6 learning notes: what is NET Core
Wireshark grabs packets to understand its word TCP segment
Interview Reply of Zhuhai Jinshan
Apache middleware vulnerability recurrence
2.10transfrom attribute
It's hard to find a job when the industry is in recession
National economic information center "APEC industry +": economic data released at the night of the Spring Festival | observation of stable strategy industry fund
opencv学习笔记八--答题卡识别
好用的TCP-UDP_debug工具下载和使用
Pangolin Library: control panel, control components, shortcut key settings
随机推荐
[Yugong series] creation of 009 unity object of U3D full stack class in February 2022
C # display the list control, select the file to obtain the file path and filter the file extension, and RichTextBox displays the data
MySQL view tablespace and create table statements
Codeforces Global Round 19(A~D)
【Redis】NoSQL数据库和redis简介
. Net 6 learning notes: what is NET Core
[factorial inverse], [linear inverse], [combinatorial counting] Niu Mei's mathematical problems
[Yugong series] February 2022 U3D full stack class 010 prefabricated parts
[nonlinear control theory]9_ A series of lectures on nonlinear control theory
洛谷P1836 数页码 题解
edge浏览器 路径获得
File upload of DVWA range
08- [istio] istio gateway, virtual service and the relationship between them
[KMP] template
Significance and measures of encryption protection for intelligent terminal equipment
解决方案:智慧工地智能巡檢方案視頻監控系統
http缓存,强制缓存,协商缓存
Le chemin du navigateur Edge obtient
Leecode-c language implementation -15 Sum of three ----- ideas to be improved
Nc204382 medium sequence