明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 934|回复: 7

[求助]请教高手一个关于“坐标”的问题。

[复制链接]
发表于 2008-8-1 12:45 | 显示全部楼层 |阅读模式

坐标由变成后,下面这段程序就会出错,哪位高手帮忙解决一下?

(SETQ PT1 (GETPOINT "\n请确定起点 :"))
(SETQ PT2 (GETPOINT PT1 "\n请确定终点 :"))
(SETQ PT1 (POLAR PT1 (ANGLE PT2 PT1) 4))
(SETQ PT5 (POLAR PT1 (ANGLE PT1 PT2) 10))
(entmake (list
'(0 . "LINE") '(100 . "AcDbEntity") '(100 . "AcDbLine")
(cons 10 pt1) (cons 11 pt5)
))

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
"觉得好,就打赏"
还没有人打赏,支持一下
 楼主| 发表于 2008-8-1 15:25 | 显示全部楼层

也就是:在非世界坐标系中标注值的问题。

发表于 2008-8-1 16:46 | 显示全部楼层

对象扩展数据的使用

本帖最后由 作者 于 2008-8-1 16:49:31 编辑

绘图前把坐标转换成世界坐标就可以了 利用函数(trans pt from to [disp])  用法查看帮助

发表于 2008-8-1 16:48 | 显示全部楼层

Translates a point (or a displacement) from one coordinate system to another

(trans pt from to [disp])   

Arguments

pt

A list of three reals that can be interpreted as either a 3D point or a 3D displacement (vector).

from

An integer code, entity name, or 3D extrusion vector identifying the coordinate system in which pt is expressed. The integer code can be one of the following:

0 World (WCS)

1 User (current UCS)

2 If used with code 0 or 1, this indicates the Display Coordinate System (DCS) of the current viewport. When used with code 3, it indicates the DCS of the current model space viewport.

3 Paper space DCS (used only with code 2)

to

An integer code, entity name, or 3D extrusion vector identifying the coordinate system of the returned point. See the from argument for a list of valid integer codes.

disp

If present and is not nil, this argument specifies that pt is to be treated as a 3D displacement rather than as a point.

 楼主| 发表于 2008-8-1 17:03 | 显示全部楼层

我知道这个,但不知道怎么用呀

发表于 2008-8-1 17:46 | 显示全部楼层

加上

(setq pt1 (trans pt1 1 0))
(setq pt5 (trans pt5 1 0))

 楼主| 发表于 2008-8-3 07:40 | 显示全部楼层
非常感谢byghbcx.
 楼主| 发表于 2008-8-5 07:42 | 显示全部楼层
还有一个问题,想问大家,为什么在布局空间的视口里执行不了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-12 02:39 , Processed in 0.180500 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表