Ugh! I was just forced to write a lisp (first one in a long time). It works but if anyone wants to clean it up or make any improvements...Please, feel free.
I found the
getpointobj and
stringstrip-end functions lying around so my job was a little easier.
This lisp is supposed to set the scale of a MASKBLOCK when a user picks a point. We use MASKBLOCKS for pipe and duct breaks (using AutoCAD MEP). -e.g. If the user picks the end of a duct this will find the scale the MASKBLOCK should be set to.
(defun mask_add
( mask
-block
-name
/ x obj scale
)
(defun getpointobj
( pt
/ obj pt
) ;; disable xref objects from the list of items.
1
;; otherwise just create an object from picked point.
obj )
(defun stringstrip
-end
( str char
) ;; Strip the end of a string off.
;; e.g. (StringStrip-End "This is a test" "i")
;; -> "This "
(defun liststriper
(lst dec
) (cdr lst
) (liststriper
(cdr lst
) dec
))) (vl-list->string
(princ "\nYou did not select a point, please try again. "))
(setq obj
(getpointobj x
))
(obj
(stringstrip-end
)
(command "_.maskadd" "NA" mask
-block
-name
"x" scale
"y" scale
"z" scale x
) )
)