Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So, I am kinda new to the AutoLisp world and I wanted to create a lisp that defines a command named "FF" to insert specific blocks. For example, the user types FF, then defines the first point and then types a string like "TFN". The thing is, in this string all characters are blocks, F corresponds to a block, and so do N and T. Here is the code:
(defun c:FF ()
(setq P (getpoint "Define origin:"))
(setvar aux 1)
(setq seq (getstring "Define the sequence of blocks:"))
(foreach str seq
(command "insert" str (polar P (* pi 2) (aux*2)))
(incf aux)
)
)
It's supossed to look like this:
By the way, the "aux" variable is used to create separation between the blocks.
Autocad 2010 does recognize the command FF, then requires a point, but when the point is defined it returns this: error: bad argument type: (or stringp symbolp): nil
Solved! Go to Solution.