Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Can anyone help me figure out how to write a specific section of my code? I am still new to lisp and I need some help figuring out the proper way to write the end of my lisp. I wanted to make an incremental lisp that creates MTEXT and it goes up in increments of 1 from whatever starting integer that I input. This command is for numbering lots for plan sets. I wanted to try making this instead of using TCount because I dont like using that command. This is what I have currently:
(defun c:LotNumbers ( / StartingLotNumber Lot LotText NextlotNumber)
(setq StartingLotNumber (getint "\nStarting Lot Number :"))
(while
(setq Lot (getpoint "\nSelect Lot to Place Number :"))
(if Lot
(setq LotText (entmake (list (cons 0 "MTEXT")
(cons 100 "AcDbEntity")
(cons 100 "AcDbMText")
(cons 8 "H-LOT$")
(cons 10 Lot)
(cons 40 5)
(cons 7 "ROMANS")
(cons 1 (rtos StartingLotNumber 2 1))
(cons 71 5)
);end of list
)) ;end of entmake and setq functions
(entmod (list (cons 10 Lot) LotText))
(setq StartingLotNumber (1+ StartingLotNumber))
) ;end of if function
) ;end of while function
(princ)
)
--------------------------------------------------------------------------------------------------------------------------
I am under the impression that the code stops working at the "(setq StartingLotNumber (1+ StartingLotNumber))" line. It is adding 1 to the integer and not being converted into a string when entmake is used again for the next MTEXT entity. Can anyone help me write that out properly?
Solved! Go to Solution.