Display full version of the post: incremental numbers into mapbook tiles
fbastian
27.05.2009, 11:23
Hello, I have been producing mapbooks using CAD 3D 2009 for a short while.
On my key maps I show the map book in tiles. In the center of these tiles I manually insert a number as a presentaion purpose. However this is very time consuming and prone to error.
I found and downloaded from your site the Lisp InsertC.
I tried using it but, the truth is that I lack the experience in CAD to make this work.
Do I have to make the tiles into blocks? If so how do I do that?As far as I can see the tiles are polyline objects.
Any suggestions or help would be very much appreciated.
thank you very much.
Fred
msplcdykee69
29.05.2009, 17:32
Here is a simple lisp called LOTNO Copy this lisp routine below into a text file and just make sure you have a text size you have selected as current is the size it becomes You can select the text style under your toolbar "Styles". This is a simple auto numbering lisp routine
;Lotno.lsp;This is a program to insert incremented lot numbers;using current text.
(defun lotn ( / p p1 p2 n1 scmde) (setq n1 (getint "Enter starting lot number: ")) (setq p1 (getpoint "\nText location: ")) (setq scmde (getvar "cmdecho")) (while p1 (setvar "cmdecho" 0) (setq p2 p1) (if (= 0.0 (cdr (assoc 40 (tblsearch "style" (getvar "textstyle"))))) (command "text" "J" "MC" (setq p p1) (setq p "") (setq p "") (setq p n1) ) (command "text" "J" "MC" (setq p p1) (setq p "") (setq p n1) ) );if (setq n1 (+ n1 1)) (setq p1 (getpoint "\nText location: ")) (if (= p1 p2) (setq p1 nil)) ) (setvar "cmdecho" scmde) (princ)) (defun C:LOTNO () (lotn))(princ "Type LOTNO to begin.")(princ)
fbastian
01.06.2009, 04:57
Hi, I tried by saving the code as a lsp file and then uploading it into the CAD file. I could see the propmt "type lotno to begin" but when i typed 2 it gave me "unknown command".
I need to understand how to run lsp files onto the current CAD file. I must be doing something wrong.
can you help me further please?
There isnt a space for attaching files here otherwise i would so you can see what i am talking about.
Thanks for your help.
Vladimir Michl
01.06.2009, 07:39
You should type "lotno" (verbatim, the command name) to start the command.
If you have Express Tools installed, you can also use the TCOUNT command. Our InsertC can be used also but you should have a block with an attribute to be used as the counter label.