This lisp takes a line that represents a steel beam and changes it to a polyline, makes the width 1.5", and changes the layer to "STR" and the linetype to "CENTER" instead of the center2 that STR is set to. Problem, because I'm a n00b, is that I can only select 1 line per time I use the lisp. I haven't gotten into how to select more than 1 entity without knowing exactly how many will be selected. I've come across multiple selection like this before, but forgot where I saw it at. I'm guessing that in order to do this, all items would be added to a list, then the routine would loop thru all items in the list. Wrong?
The second question has to do with an "IF" statement. What if one of the lines selected is already a polyline? Is there a way to make it skip the first part of the "PEDIT" command and just adjust the width?
If I ask too much, just let me know. I hate being a pain about things I could read up on, but don't have the time (and sometimes patience) for.
;;-----------------------------------------------
;; STEELBEAM.lsp
;; Created by Dominic Cesare
;; 02/05/2004
;;-----------------------------------------------
;;======================
;; Start of Routine
;;======================
(defun c:STEELBEAM()
;;;-------- Select Object to change -----------
(setq BEAM (entsel "\nSelect object to change : "))
;;;-------- Changing BEAM to a Polyline -------
(command "PEDIT" BEAM "Y" "W" "1.5" "")
(setq BEAM (entlast))
;;;-------- Changing BEAM linetype ------------
(command "CHANGE" BEAM "" "P" "LA" "STR" "LT" "CENTER" "")
;;;-------- Ending Routine Cleanly ------------
(princ)
)
(princ)
;;======================
;; End of Routine
;;======================