First, welcome to AUGI. Second, just a bit of etiquette : Surround your code inside of code tags. In the advanced editor click the hash (#) button or type:
[ code ]... your code here ... [ /code ] (without the spaces of course). It just makes your code more readable.
Now to try and answer your question:
- The 1st item in a while loop is the predicate. I.e. if it returns nil the while loop stops, otherwise it continues to perform all the other items in the loop.
- Your first item is the princ, which means effectively that your while loop will never stop, since it will always return the string printed to the command line (i.e. not nil).
- Depending on if your Light_Pole block definition is set to be scaled uniformly or not, it expects either just a scale or a scale for XYZ (one each). So the command call needs to account for this before the rotate happens.
- The msc thingy is not defined in the code you posted, I'm not sure what it's meant to do. If I test your code it sends a nil to the insert command causing an ESC being pressed - and thus stopping all lisp.
- To cleanly stop a command defun, add a blank princ at the end so it doesn't print out whatever the last thing was inside the defun.
So here's an alternative which might work:
Code:
(defun c:1301 ()
(command "layer" "s" "Utility_Pole" "")
(while (setq pt (getpoint "\n1301 Light Pole: "))
(command "insert" "Light_Pole" pt "" ""))
(princ))
See how much nicer it looks when you surround your code with code tags?
Edit: BTW, you could use the Make option for Layer instead of Set. If the layer exists then it acts the same as set, but if it doesn't in makes the layer before it set it as current.