明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2882|回复: 6

[讨论] 如何用Vlisp设置UCS?

[复制链接]
发表于 2010-9-16 16:31 | 显示全部楼层 |阅读模式

(command "_ucs" "ob")通过选择一个实体设置UCS,如何用Vlisp实现呢?不用command命令,可以透明使用。请高手指教

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2010-9-16 16:46 | 显示全部楼层

The collection of all user coordinate systems (UCSs) in the drawing.

VBA class name:

AcadUCSs 

Create using:

N/A 

Access via:

Document.UserCoordinateSystems 

其实选择对象选择的是一个面,,,,,参考

Signatures: Overview

Blocks 

RetVal = object.Add(InsertionPoint, Name) 

UCSs 

RetVal = object.Add(Origin, XAxisPoint, YAxisPoint, Name) 

 楼主| 发表于 2010-9-16 16:51 | 显示全部楼层

主要是不明白怎么把实体的一些数据转换成:Origin, XAxisPoint, YAxisPoint

发表于 2010-9-16 17:02 | 显示全部楼层

原来好像有一个读取3DSOLID的坐标点的程序,这个处理过程个人感觉应该还是很难的,因为就算实体的坐标及面的信息转化出来,点取的点好像还要经过一系列的转换来判断具体选择到哪个面上,,,,,,,,,,

 楼主| 发表于 2010-9-17 08:40 | 显示全部楼层

 搜到这个贴子:但似乎不能正确使用,懂的给看一下为什么

set to the WCS coordinates of the point picked on the region, this sets
the current UCS to the plane of the selected region:

{code}
( (eq entype "REGION" )
(setq normal (vlax-get obj 'Normal))
(setq regUCS ;;create UCS parallel to the region
(vla-add
(vla-get-usercoordinateSystems actdoc)
(vlax-3D-point (trans '(0 0 0) normal 0))
(vlax-3D-point (trans '(1 0 0) normal 0))
(vlax-3d-point (trans '(0 1 0) normal 0))
"zztemp02"
)
)
(vla-put-origin regUCS (vlax-3d-point newOrig 0 1)) ;;move
UCS origin to point picked on region
(vla-put-activeUCS actDoc regUCS) ;;update UCS
...
{code}

 

发表于 2010-9-17 11:53 | 显示全部楼层
这个是点取面域来设置ucs的程序,不是点取3DSOLID的,关键是如何确定点取的是3DSOLID的哪个面?这个才是重点,或者可以这样:先把3DSOLID炸开为面域,根据选择点获得面域,转换为面域的ucs(上面的程序),然后取消炸开,,,和选择3DSOLID差不多的,因为选择3DSOLID实际上就是选择面,,,,
 楼主| 发表于 2010-9-17 16:54 | 显示全部楼层

这方面没有了解,如读天书。。。

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

本版积分规则

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

GMT+8, 2024-3-29 06:43 , Processed in 0.173074 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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