乐筑天下

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

[编程交流] labelling Easting & Northing c

[复制链接]

2

主题

10

帖子

8

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:12:46 | 显示全部楼层 |阅读模式
hi,
i have received a drawing showing coordinates of various points for example
(E 3456.98, N 4276.87) etc.
how can i find the coordinates of other points in the same drawing.
 
---- i used EN.lisp but it gives wrong coordinates.
 
plz help
回复

使用道具 举报

1

主题

80

帖子

79

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 06:18:05 | 显示全部楼层
This is somewhat rudimentary, but could work. Give it a go and let me know if this is what you were looking for. (You can change the text settings if necessary)
 
  1. (defun c:test ( / point p1 coord xval yval str)   (while       (if           (and               (setq point (car (entsel "\nSelect a point to label : "))                       p1 (entget point)               )               (= (cdr (assoc 0 p1)) "POINT")           )           (progn               (setq p1 (entget point)                     coord (cdr (assoc 10 p1))                     xval (car coord)                     xval (rtos xval 2 2)                     yval (cadr coord)                     yval (rtos yval 2 2)               )               (setq str (strcat "(E " xval ", " "N " yval ")"))                   (command "_.text" "Justify" "bl" coord "2.0" "" str )           )           (princ "\nDid not select a point : ")       )   ) (princ))
回复

使用道具 举报

2

主题

10

帖子

8

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:21:14 | 显示全部楼层
thnx but how to use it plzzzzzzzzzzz....
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-6 06:24:23 | 显示全部楼层
CheSyn
 
The back slash should be forward slash .
 
  1. (defun c:test ([b][color=blue]\[/color][/b] point p1 coord xval yval str)
 
And it is a good practice to check if the selected object is matching your desired object name "POINT" to avoid error message
and crashing the routine .
 
e.g .
 
  1. (and (setq point (car (entsel "\nSelect a point to label : ")))      [color=blue]  (eq (cdr (assoc 0 (entget point))) "POINT")[/color]   )
回复

使用道具 举报

2

主题

10

帖子

8

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:27:13 | 显示全部楼层
im thankful for ur support,......
i did both, forward & backward slash,... but it doesnt give correct coordinates,
plz give ur expertise,..
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:29:52 | 显示全部楼层
Have you tried to ID the place where a coordinate has been written to see whether it gives the same coordinate as the figures?
 
Someone might have written coordinates into the drawing and then moved the whole drawing.
 
I am not familiar with EN.lsp  perhaps you could post the routine.
回复

使用道具 举报

1

主题

80

帖子

79

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 06:33:10 | 显示全部楼层
Load it, and call the command with "test" (you can change this to whatever you want). Select a point, and text will show in its place. The command will loop until a point is selected (if you select another entity type).
 
 
Very good, thank you! Please see the updated code above.
 
 
Kallerman,
 
I have updated the above code - and verified it works in my drawings.
 
Please try it. If it does not work for you, post a copy of the drawing you are working with. I'm sure someone will be able to help you, as I am leaving on vacation for 10 days.
回复

使用道具 举报

2

主题

10

帖子

8

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:36:47 | 显示全部楼层
i tried few routines and the ones u posted, it gives the same answer with all,..
回复

使用道具 举报

2

主题

10

帖子

8

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:40:50 | 显示全部楼层
071251iylll9slqstd99ss.jpg here is attached the bottom left of my drawing area,..
if i set (4400, 3000) as origin the see the results in the screen shot,..
回复

使用道具 举报

2

主题

10

帖子

8

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 06:41:40 | 显示全部楼层
071253v8qptayyy0w3unl8.jpg see the variation in results,....
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 18:21 , Processed in 0.360846 second(s), 74 queries .

© 2020-2025 乐筑天下

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