乐筑天下

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

[编程交流] Move objects to match x (y,z)

[复制链接]

13

主题

81

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 12:54:26 | 显示全部楼层
By the way - what does this mean:
 
"Seann: ...it went crazy ex-girlfriend on me..."
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 12:57:56 | 显示全部楼层
 
It was part of some explanation Seann wrote out for a problem he was having. I could not stop laughing at his metaphor.
 
 
 
OK, how about this?
 

 
 
  1. (defun c:TZP (/ #SS #Pnt1 #Pnt2 #New) (cond   ((and (setq #SS (ssget "_:L"))         (setq #Pnt1 (getpoint "\nSpecify base point: "))         (setq #Pnt2 (getpoint "\nSpecify point for new Z value: "))    ) ;_ and    (setq #New  (vlax-3D-point (list (car #Pnt1) (cadr #Pnt1) (caddr #Pnt2)))          #Pnt1 (vlax-3D-point (list (car #Pnt1) (cadr #Pnt1) 0))    ) ;_ setq    (vlax-for x (setq                  #SS (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))                ) ;_ setq      (vla-move x #Pnt1 #New)    ) ;_ vlax-for    (vl-catch-all-apply 'vla-delete (list #SS))   ) ) ;_ cond (princ)) ;_ defun
 
 
Dirty command version:
  1. (defun c:TZP (/ #SS #Pnt1 #Pnt2) (and (setq #SS (ssget "_:L"))      (setq #Pnt1 (getpoint "\nSpecify base point: "))      (setq #Pnt2 (getpoint "\nSpecify point for Z value: "))      (command "_.move" #SS "" "_non" #Pnt1 ".Z" "_non" #Pnt2 "_non" #Pnt1) ) ;_ and (princ)) ;_ defun
回复

使用道具 举报

13

主题

81

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 13:01:05 | 显示全部楼层
Yes, it's as perfect as it already was before, with the difference that you use the command tzp now. Might I see the code?
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 13:05:40 | 显示全部楼层
Whoops, might help.
 
Something isn't quite right though.
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 13:09:13 | 显示全部楼层
I went ahead and posted the original attempt, even thought it was WAAAY off.
 
http://www.cadtutor.net/forum/showpost.php?p=280023&postcount=3
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 13:11:35 | 显示全部楼层
So......did it work?
回复

使用道具 举报

13

主题

81

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
65
发表于 2022-7-6 13:15:42 | 显示全部楼层
Yes, it works fine.
 
I just messed up my "Lisp to unload cui" functionality and overwrote my safety copy - what the hell --- must look for the thread ...
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 06:13 , Processed in 0.610515 second(s), 64 queries .

© 2020-2025 乐筑天下

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