Jump to content

choose max value around a distance


lucky9

Recommended Posts

I want to fetch the RL at a junction point/Node ( where 2 or more lines meet) and the end node/point,

In my survey data there are 4 to 5 RL's given and I have to pic the max RL nearest to the junction or dead end node/point

 

I need a lisp that can auto scan the lines pic RL place it at each junction and end node.

 

Here is an example:

 

in the given image I have shown the junction and dead end node with a circle.

 

here , there are 2 Dead end nodes and 1 junction Node.

 

The result I want is that after identifying the junction and dead end node the program would pic the highest RL around the Junction and dead end node.

 

the text in green are RLs and text in Pink is the max RL at each Junction/node

 

 

5828fcdae399fd53b8c9dd28f68d93f0.png

 

Regards,

Link to comment
Share on other sites

All you need is a simple lisp that picks a number of text items and just looks at the value, returning the maximum and maybe change colour and zoom in. Do you have any lisp experience ? Start with the 1st step just window around the junctions making a slecetion set.

Link to comment
Share on other sites

All you need is a simple lisp that picks a number of text items and just looks at the value, returning the maximum and maybe change colour and zoom in. Do you have any lisp experience ? Start with the 1st step just window around the junctions making a slecetion set.

 

I can write code in VBA, but I'm in a learning stage at LISP programming. It's looks pretty challenging and I'm still struggling with it. :D

Link to comment
Share on other sites

Here is something to have a look at.

 

; simple compare text formax value
; By Alan H June 2018
(defun C:maxval ( / rad pt1 obj I xy co-ordsxy ss)
(vl-load-com)
(setq rad  (getreal "Enter radius" ))
(While (setq pt1 (getpoint "Pick point"))

(setvar 'osmode 0)
(setq  co-ordsxy '())

(command "polygon" 25 pt1 "I" (* rad 0.9))
(setq obj2 (vlax-ename->vla-object (entlast)))
(setq co-ords (vlax-safearray->list (vlax-variant-value (vlax-get-property obj2 "Coordinates" ))))
(setq I 0)
(repeat (/(length co-ords) 2)
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
(vla-delete obj2)

(setq ss (ssget "wp" co-ordsxy (list (cons 0 "*TEXT"))))
(setq maxv 0.0)
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
(setq val (atof (vla-get-textstring obj )))
(if (/= val nil)
(if (< maxv val)(setq maxv val))
)
)

(alert (strcat "max val is " (rtos maxv 2 3)))
(setq ss nil)
)
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...