乐筑天下

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

[编程交流] Automatic Text Numbering V4, s

[复制链接]

1

主题

10

帖子

9

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:08:14 | 显示全部楼层 |阅读模式
Firstly thank you very much for this site.
 
Today i downloaded and used "automatic text numbering V4" lisp. Very useful and successful.
 
I need more property in this lisp. When i use this lisp i want that numbered text will be consist specific distance ( X or Y direction ) from cursor point.
 
Thanks in advance.
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-6 08:11:44 | 显示全部楼层
Not as well rounded and efficient as ATN_V4 but works nonetheless
 
  1. (Defun c:CMI  (/ parseStr _inccopy TxtObj fp sp dst ang)     (vl-load-com)     [color=blue](defun parseStr  (str / strA pr v)[/color][color=blue]            (setq strA (if (zerop (atoi (setq v str)))[/color][color=blue]                          (setq pr (vl-string-right-trim "0123456789" str))[/color][color=blue]                              (progn (setq pr "") v)))[/color][color=blue] (strcat pr (itoa (1+ (atoi (if (eq  strA str) strA (vl-string-trim strA str)  )))))[/color][color=blue]           )[/color]     [color=blue](defun _inccopy (e p1 p2)[/color][color=blue]           (vla-move (setq e (vla-copy e))[/color][color=blue]                      (vlax-3d-point p1)[/color][color=blue]                      (vlax-3d-point p2))[/color][color=blue]           (vla-put-textstring e[/color][color=blue]  (parseStr (vla-get-textstring e)))[/color][color=blue]           e[/color][color=blue]           )         [/color]     (cond ((and                  (setq TxtObj (ssget "[b][color=blue]_[/color][/b]:L:S:E" '((0 . "TEXT"))))                  (setq TxtObj (vlax-ename->vla-object                                     (ssname TxtObj 0)))                  (setq fp (getpoint "\nPick first point: "))                  (setq sp (getpoint fp "\nPick second point: "))                  (setq dst (distance                                  (setq fp (trans fp 1 0))                                  (setq sp (trans sp 1 0)))                        ang (angle fp sp))                 [color=blue] (setq TxtObj (_inccopy TxtObj fp sp))[/color]                  [color=blue](princ "\nLeft Click to Copy Increment:")[/color]                  (while [color=blue](= (car (grread nil 10)) 3)[/color]                        (setq TxtObj[color=blue] (_inccopy TxtObj fp sp))[/color]                        (setq fp sp                              sp (polar sp ang dst))                        )                  )             )           )(princ)     )
 
HTH
 
EDIT: Modified Code
回复

使用道具 举报

1

主题

10

帖子

9

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:16:39 | 显示全部楼层
thanks pBE.
 
i couldn't understand and use that lisp.
 
I want to see additional function in dialog box of ATM V4 lisp. If you can do that it will be perfect.
 
When i use ATM V4 lisp, i want to specify distance from cursor point for text location. After my click for text location, numbered text will be consist specific distance ( X or Y direction ) from clicked point.
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-6 08:20:29 | 显示全部楼层
Thats too bad.
 
I'm sure it would be, but i cant very well do anything about ATN V4.lsp as I'm not the author.
 
The snippet i posted should be able to do that. (that is if i correctly understand your reqeust)
 
EDIT: thinking about it, i'm probably off with the code i posted
Can you explain this line?
....consist specific distance ( X or Y direction ) from clicked point....
回复

使用道具 举报

1

主题

10

帖子

9

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:22:54 | 显示全部楼层
It means, for example I want to gove numbers just out of a circle but I want to click center of the circle. I will give number to X and Y larger than the diameter of the circle so that when I click center of the circle, number will be placed just out of it as I wanted. That is why I wanted that thing. Thanks.
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-6 08:26:28 | 显示全部楼层
 
....  I think I'll pass on this one .....
 
BTW: Welcome to the forum
回复

使用道具 举报

1

主题

1069

帖子

1050

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
69
发表于 2022-7-6 08:27:27 | 显示全部楼层
Check this snippet again please
I want the same but the code above isn't working on my end
Maybe some lines was lost by copy-paste....
Regards,
Oleg
回复

使用道具 举报

1

主题

10

帖子

9

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:33:13 | 显示全部楼层
thanks pBE.
回复

使用道具 举报

1

主题

10

帖子

9

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 08:36:32 | 显示全部楼层
Can't anybody help me for this lisp?
回复

使用道具 举报

pBe

32

主题

2722

帖子

2666

银币

后起之秀

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

铜币
211
发表于 2022-7-6 08:38:53 | 显示全部楼层
 
By george you are right!! Thank you for testing Oleg.
 
Code Updated
 
But i still dont think thats what the OP wants.
At any rate... what it does is increment the string value by 1 and continues to add and copy as you Left-Click the mouse at the same angle and distance from first point and second point.
 
Cheers
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-9 09:14 , Processed in 0.677672 second(s), 72 queries .

© 2020-2025 乐筑天下

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