乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 102|回复: 14

[编程交流] AutoLISP Move only Z-Coord.?

[复制链接]

2

主题

4

帖子

2

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 14:53:40 | 显示全部楼层 |阅读模式
I am trying to find or build a LISP that will move any object that is selected in the Z-Coord. I know many ways to change the elevation of an object I would just like to be able to run a command other than move @0,0,?
 
thanks
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 15:00:52 | 显示全部楼层
Here's something to get you started:
  1. (defun c:mvz ()(setq ss1 (ssget)        rz (rtos (getreal "Enter relative Z distance: "))        rd (strcat "0,0," rz));setq(command "move" ss1 "" "0,0,0" rd));defun
回复

使用道具 举报

2

主题

4

帖子

2

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 15:06:05 | 显示全部楼层
Thanks, Im new to the whole LISP process but it should help me get some work done faster.
回复

使用道具 举报

2

主题

4

帖子

2

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 15:08:30 | 显示全部楼层
Awsome, It is exactly what I was looking for
 
Thanks Again,
 
Patrick
回复

使用道具 举报

106

主题

1万

帖子

101

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1299
发表于 2022-7-6 15:13:52 | 显示全部楼层
you can do any of the 3 x y z
 
x  rd (strcat rz ",0,0" )
y  rd (strcat "0," rz ",0" )
回复

使用道具 举报

5

主题

45

帖子

40

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-6 15:17:21 | 显示全部楼层
Can you please add an option to pick the value of Z as well. Thank you.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:21:56 | 显示全部楼层
Perhaps :
 
  1. (defun c:mvz  (/ ss1 rz rd) (setq    ss1 (ssget)   rz  (rtos (getdist "Enter relative Z distance: "))   rd  (strcat "0,0," rz)) (command "move" ss1 "" "0,0,0" rd) (princ))
回复

使用道具 举报

5

主题

45

帖子

40

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-6 15:26:04 | 显示全部楼层
Thanks Lee, but it does not work.
Lisp must request to pick a text of Z value first.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:31:17 | 显示全部楼层
This works in the same way as previously posted, except the user can click and specify a distance on screen. I'm not quite sure what you were expecting, but if you could clarify things it'd make it much easier.
回复

使用道具 举报

5

主题

45

帖子

40

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-6 15:34:13 | 显示全部楼层
If there are some text: 3.45, 2.55 ...in drawing. We just select this number but not have to "Enter relative Z distance". Cheers.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 22:11 , Processed in 0.327308 second(s), 72 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表