作者sjgau (sjgau)
看板Cad_Cae
标题Re: [推荐] AUTOLISP使用心得
时间Sun Jan 3 06:30:11 2010
JY 大大的需求是,需要把 output 的座标值,
由 原先的 世界座标,转换成 当时的 UCS 座标,
需要用到以下的 AutoLISP 系统所提供的 函数。
(setq p2 (trans p1 0 1))
; 然後,把 p2 write 出去,即为所求。
以下为 AutoCAD 2010 版,关於 (trans ) 的部份解释。
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)
※ 引述《jyhchyunlu (jyhchyunlu)》之铭言:
: 这几天为了做一份报告
: 需要把AUTOCAD上点的座标值汇出成TXT档
: 於是开始上板上爬文
: 结果找了一篇2007年 sjgau板友发表的文章
: 用AUTOLISP撷取座标直
: 原本就对AUTOCAD不熟的我
: 第一次听到AUTOLISP觉得很新奇
: 也觉得这种东西很厉害
: 可以依照自己的需求去写程式
: 完成AUTOCAD自身很难完成的事情
: 於是在此推荐新手
: 如果在AUTOCAD上有特殊需求
: 可以朝着AUTOLISP这方面去解决问题
: 熟练的话
: 这会是一个很强大的功能
: 在此也谢谢sjgau板友
: 不但提供程式
: 还帮我修改成完整符合我所需的功能
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.20.138.178