马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
问题:
Problem with LISP (trans) function not accepting coordinates larger/greater than 1.0E+99
解答:
In Visual LISP, you will get an error if you use the TRANS function with a large input value - For example, type the following LISP expression at the command prompt:
(trans (0.0 0.0 3.0e+099) 0 1)
To solve this issue, best thing is to use the ActiveX TranslateCoordinates() method of the Utility class.
The following code shows how the TranslateCoordinates() method is successful for an input point of (0.0 0.0 3e+99), where…
(trans (0.0 0.0 3e+099) 0 1)
…would fail.
 - (defun c:Test()
- (vl-load-com)
- (setq poActDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
- (setq poUtility(vla-get-Utility poActDoc))
- (setq poTestPoint (vlax-3d-point '(0.0 0.0 3e+99)))
- (setq poRetPoint(vla-TranslateCoordinates poUtility poTestPoint acUCS acWORLD 0))
- (princ (vlax-safearray->list (vlax-variant-value poRetPoint)))
- (princ)
- )
|