Lisp to Size Pipes

Lisp to Size Pipes

107199
Enthusiast Enthusiast
1,794 Views
4 Replies
Message 1 of 5

Lisp to Size Pipes

107199
Enthusiast
Enthusiast

 

hi,

 

is there is any ideas how to make lisp with these steps:

 

1-find all text contain "L/S"

2-copy all these text "350mm" up

3-replace these text each with "pipe size" which depend on the flow "L/S" according to table in attached photo with suffix "mm"


this picture for the final output

 

2.JPGSize.JPG

0 Likes
1,795 Views
4 Replies
Replies (4)
Message 2 of 5

Ranjit_Singh
Advisor
Advisor

It seems like it should be possible with a fairly simple routine. Is that an AutoCAD table or OLEObject? Post a drawing.

0 Likes
Message 3 of 5

alanjt_
Collaborator
Collaborator

What if the L/S value doesn't match anything in the table? (eg. 0.063 Vs)

0 Likes
Message 4 of 5

_Tharwat
Advisor
Advisor

Hi,

 

Actually it should be less or equal:

 

(defun pipesize (lps / ps)
(vl-some
'(lambda (v) (and (<= lps (car v)) (setq ps (cadr v))))
'((0.3 20) (0.57 25) (1.21 32)))
ps)

 OP, just add the rest of your table as per my adds in the above sub-function.

Message 5 of 5

scot-65
Advisor
Advisor
Looks like a dynamic block with a LOOKUP linked
to a Visible State would do the trick.

The L/S shown in the screen capture has values that
are not showing in the table.
"< 0.30"
"< 0.57"
"< 1.21"
... seem to be the appropriate Lookup display.

My question would be:
Are L/S values fixed?

If not, include an attribute in the block for L/S?

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes