明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1583|回复: 6

组码里的插入点的位置与实际不符是什么原因?

[复制链接]
发表于 2007-6-9 19:39 | 显示全部楼层 |阅读模式

 ((-1 . <图元名: 7b6a7f20>) (0 . "INSERT") (330 . <图元名: 7b6a7cf8>) (5 .
"9C") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "Fitting") (100 .
"AcDbBlockReference") (66 . 1) (2 . "Support") (10 169.801 718.382 -985.22) (41
. 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.785398) (70 . 0) (71 . 0) (44 . 0.0) (45 .
0.0) (210 -0.707107 -0.408248 0.57735))

一个块,查其组码如上,可得插入点位置为:
(10 169.801 718.382 -985.22)————1

但是在图上,其实际插入位置如下:
(10 1140.75 462.542 17.7393)—————2


问题是,二者不同的原因是什么,最主要的是:如何由1换算出2来?
(注:图元经过了旋转操作,跟这个有关么?另外我发现文本也有类似情况,而直线却没有)

发表于 2007-6-9 20:03 | 显示全部楼层
看看是不是坐标系的问题.
发表于 2007-6-11 12:38 | 显示全部楼层
我想应该与旋转有关,图旋转了坐标系没动,值肯定不同
发表于 2007-6-11 19:38 | 显示全部楼层
insert 实体的插入点为实体坐标系(OCS),要转换成用户坐标系(UCS)才能与图中指示的位置一致。
 楼主| 发表于 2007-6-11 19:52 | 显示全部楼层

如何转换?

可以凭借以上组码换算出来么

发表于 2007-6-11 20:40 | 显示全部楼层

用(trans pt ename 1)

参见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  aper 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.

If you use an entity name for the from or to argument, it must be passed in the format returned by the entnext, entlast, entsel, nentsel, and ssname functions. This format lets you translate a point to and from the Object Coordinate System (OCS) of a particular object. (For some objects, the OCS is equivalent to the WCS; for these objects, conversion between OCS and WCS is a null operation.) A 3D extrusion vector (a list of three reals) is another method of converting to and from an object's OCS. However, this does not work for those objects whose OCS is equivalent to the WCS.

 楼主| 发表于 2007-6-12 19:40 | 显示全部楼层

就是它了

谢谢

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-6 03:33 , Processed in 0.173713 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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