乐筑天下

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

[编程交流] 有点复杂的Lisp程序。。。阿西

[复制链接]

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 12:35:34 | 显示全部楼层
Perhaps you could post a drawing file that has 20 or so of your points. That would give some data, and a better chance of a solution.
回复

使用道具 举报

15

主题

83

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-6 12:38:14 | 显示全部楼层
Yep you're right Eldon, here is example of my drawing...
130055r9wk0h63f9mmzh71.jpg
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 12:39:35 | 显示全部楼层
I think that a drawing file would be of more use than a picture, if you can manage that - thank you.
回复

使用道具 举报

15

主题

83

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-6 12:43:59 | 显示全部楼层
 
No problem, here is small part of dwg file...
example.dwg
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 12:47:26 | 显示全部楼层
Having looked at the file, I would say that a completely automatic lisp would be impossible in places, due to the relative placement of the elevation text in relation to the ground point.
 
For example, the text is not at a consistent displacement left or right. In areas of congested detail, some levels are on top of other ground points, so a programme to search for the closest text would choose the wrong one. In some areas there is no elevation text for a ground point. Some of the ground points are blocks.
 
All in all, I would go for a manual approach.. I hesitate to post my lisp to do this, because last time, I was chided for producing an untidy lisp. All I know is that it works, and for 2000 points, you could do that in an hour or so. With Osnaps set to suitable settings, the work goes quite fast, even if it is one at a time.
回复

使用道具 举报

15

主题

83

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-6 12:50:01 | 显示全部楼层
 
Thx for your time Eldon, manual approach lisp would also be good in this case, maybe much more better solution than automatic lisp8)
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 12:53:11 | 显示全部楼层
The lisp is not complicated, and as long as Lee Mac is not looking, here it is
 
  1. (defun c:grlev ( / p1 tx e zd os); puts 3D point at level shown by text; by eldon 2000   (setvar "OSMODE" 104); set Osnap for picking plan point       (setq p1 (getpoint "\n Pick plan point.....   "))       (setvar "OSMODE" 64)       (setq tx (entsel "\n Pick Level text......   "))   (setvar "OSMODE" 0)       (setq e (entget (car tx)))   (setq zd (atof (cdr (assoc 1 e))))   (setq p1 (list (car p1) (cadr p1) zd))   (command "point" p1))
You have to set up the Osmode variable according to the list below. It is currently set for Node, Insertion and Intersection. It works one point at a time, but by pressing the right mouse button, it starts again. There are no error traps. I hope it works for you.
 
 
Sets running Object Snap modes using the following  bitcodes:
 
0  NONe
1  ENDpoint
2  MIDpoint
4  CENter
8  NODe
16  QUAdrant
32  INTersection
64  INSertion
128  PERpendicular
256  TANgent
512  NEArest
1024  QUIck
2048  APParent Intersection
4096    EXTension
8192    PARallel
 
To specify more than one object snap, enter the sum of  their values. For example, entering 3 specifies the  Endpoint (bitcode 1) and Midpoint (bitcode 2) object snaps. Entering 16383 specifies all object snaps.
回复

使用道具 举报

15

主题

83

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-6 12:57:32 | 显示全部楼层
:shock:YEP, that is it, I found that it makes new points with correct Z coord, after I do this just quick select all Z=0 and erase and this is it!!!!! Thx man, you helped me a lot!!!
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 13:00:00 | 显示全部楼层
Very glad to help.
 
Perhaps you can work out what is happening in the lisp, and then start writing your own. That is how I started 15 years ago, before there was CADTutor
回复

使用道具 举报

15

主题

83

帖子

68

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
75
发表于 2022-7-6 13:03:42 | 显示全部楼层
 
I wanted to do it already, but always find something to do for my work, but think I should do it once:glare:, it seems not so complicated?? To examine some tutorials and think this would be a good start..
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 10:05 , Processed in 1.021501 second(s), 72 queries .

© 2020-2025 乐筑天下

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