orourkestuart792771
2020-12-03, 06:44 AM
I've got a LISP that currently works on a block attribute 'CODE' and I've got a .csv used for translating drawing layers from one nomenclature to another.
If in the csv column 1 is 'CODE' and column 2 is 'LAYER' how do I tell the LISP I've got to exchange CODE for LAYER? This is the basic LISP:
(defun c:ASLX ( / )
(varopen)
(setq Blnamex (car(entsel "\nSelect:")))
(setq SIZE () material () code ())
(GATTRIB Blnamex)
(CoordBL Blnamex)
(MatSiText Size Material)
(setq leadlay (strcat code "-TEXT"))
(COMMAND "-LAYER" "M" leadlay "")
(COMMAND "_MLEADER" coord PAUSE TX)
(Varclose)
(princ)
)
I know there's a lot of other functions happening in here, but I just need some way of using the CODE variable to look-up a csv and return the LAYER valu. ATM I've got a long workaround that uses the CODE and suffixes it with -TEXT so I can isolate and manually shift the Mleaders into the required layers. ANy help appreciated.
If in the csv column 1 is 'CODE' and column 2 is 'LAYER' how do I tell the LISP I've got to exchange CODE for LAYER? This is the basic LISP:
(defun c:ASLX ( / )
(varopen)
(setq Blnamex (car(entsel "\nSelect:")))
(setq SIZE () material () code ())
(GATTRIB Blnamex)
(CoordBL Blnamex)
(MatSiText Size Material)
(setq leadlay (strcat code "-TEXT"))
(COMMAND "-LAYER" "M" leadlay "")
(COMMAND "_MLEADER" coord PAUSE TX)
(Varclose)
(princ)
)
I know there's a lot of other functions happening in here, but I just need some way of using the CODE variable to look-up a csv and return the LAYER valu. ATM I've got a long workaround that uses the CODE and suffixes it with -TEXT so I can isolate and manually shift the Mleaders into the required layers. ANy help appreciated.