eldon 发表于 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.

goldy2000 发表于 2022-7-6 12:38:14

Yep you're right Eldon, here is example of my drawing...

eldon 发表于 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.

goldy2000 发表于 2022-7-6 12:43:59

 
No problem, here is small part of dwg file...
example.dwg

eldon 发表于 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.

goldy2000 发表于 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)

eldon 发表于 2022-7-6 12:53:11

The lisp is not complicated, and as long as Lee Mac is not looking, here it is
 

(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 followingbitcodes:
 
0NONe
1ENDpoint
2MIDpoint
4CENter
8NODe
16QUAdrant
32INTersection
64INSertion
128PERpendicular
256TANgent
512NEArest
1024QUIck
2048APParent Intersection
4096    EXTension
8192    PARallel
 
To specify more than one object snap, enter the sum oftheir values. For example, entering 3 specifies theEndpoint (bitcode 1) and Midpoint (bitcode 2) object snaps. Entering 16383 specifies all object snaps.

goldy2000 发表于 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!!!

eldon 发表于 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

goldy2000 发表于 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..
页: 1 [2]
查看完整版本: 有点复杂的Lisp程序。。。阿西