Microstation V8中文件扫描时范围限制的问题

由于VJ(SE,95)到V8的变化较大,大部分V8以前的MDL程序需要作相应的改动,本文将对文件扫描这一问题进行讨论。下面是升级后的一段代码:&nbsp
…..&nbsp
pPoint->x=3020435529.5423102,&nbsp
pPoint->y=2645572566.3975053.&nbsp
lRangeUors=10000;&nbsp
#if&nbspdefined&nbsp(V8)&nbsp
>&nbsp
>&nbspRscanList.xlowlim&nbsp=&nbsp(long)(pPoint->x&nbsp-&nbsp);&nbsp
>&nbspRscanList.ylowlim&nbsp=&nbsp(long)(pPoint->y&nbsp-&nbsplRangeUors);&nbsp
>&nbspRscanList.zlowlim&nbsp=&nbsp(long)(pPoint->z&nbsp-&nbsplRangeUors);&nbsp
>&nbspRscanList.xhighlim&nbsp=&nbsp(long)(pPoint->x&nbsp+&nbsplRangeUors);&nbsp
>&nbspRscanList.yhighlim&nbsp=&nbsp(long)(pPoint->y&nbsp+&nbsplRangeUors);&nbsp
>&nbspRscanList.zhighlim&nbsp=&nbsp(long)(pPoint->z&nbsp+&nbsplRangeUors);&nbsp
>&nbsp
>&nbsp#else&nbsp
>&nbspRscanList.xlowlim&nbsp=&nbspmdlCnv_toScanFormat((long)&nbsppPoint->x&nbsp-&nbsp
lRangeUors);&nbsp
>&nbspRscanList.ylowlim&nbsp=&nbspmdlCnv_toScanFormat((long)&nbsppPoint->y&nbsp-&nbsp
lRangeUors);&nbsp
>&nbspRscanList.zlowlim&nbsp=&nbspmdlCnv_toScanFormat((long)&nbsppPoint->z&nbsp-&nbsp
lRangeUors);&nbsp
>&nbspRscanList.xhighlim&nbsp=&nbspmdlCnv_toScanFormat((long)&nbsppPoint->x&nbsp+&nbsp
lRangeUors);&nbsp
>&nbspRscanList.yhighlim&nbsp=&nbspmdlCnv_toScanFormat((long)&nbsppPoint->y&nbsp+&nbsp
lRangeUors);&nbsp
>&nbspRscanList.zhighlim&nbsp=&nbspmdlCnv_toScanFormat((long)&nbsppPoint->z&nbsp+&nbsp
lRangeUors);&nbsp
>&nbsp#endif&nbsp
…….&nbsp
可是程序在V8下运行时范围限制部起作用,这是为什么呢?察看一下RscanList结构的定义就知道了,原V7以前的版本xlowlim采用的时是32bit,而V8采用的时是64bit(int64),所以强制转换成long是不行的,应该转换为&nbsp
int64.&nbsp
另外,V8也提供了相应的函数使用起来特别方便,请参阅帮助文档。例如:&nbspmdlCnv_dRange3dToScanRange&nbsp,mdlCnv_dRangeToScanRange&nbsp等等。&nbsp

发表评论

您的邮箱不会被公开。* 为必填项