GBS Posted October 18, 2009 Posted October 18, 2009 Hi All First of all I am just a beginner at lisp so this may take a while I need to create some room dimension schedules from cad drawings - My current method of doing this is put dimensions on the drawing for each room label each room with a piece of text and the use the boundary command (as often the rooms are just lines) to get the area of each room i then write these down for each room and transfer these to a excel file output would look a little like this. Lounge 2.00x3.00 6 bathroom 1.50x2.0 3 Kitchen 2.0x3.0x1.0x2.0 8 (Example for a l shaped room) I have been playing with an lisp program to do this for me, my idea is i still put the dimensions on the drawing for each room as required then label each room with text. I could then select the room text and then pick the dimensions in order for the room to give the correct output as above to a txt file. this is what i have so far can anyone help? i can currently get an output for a room with 2 dimensions but it is not correct it seems to double up and then the question what do if there is more than two dimensions per room how do i get it the right output as above and of course i need to get the room area on the end. (defun c:RMSCHEDULE ( / FL1 EN1 RMTXT SS1 DIM I DIMA DIMB RMDIST RMDIST2DP OLDCE OLDERR OLDTE) ) (setq FL1 (open "C:/Documents and Settings/Gareth/My Documents/rmschedule.txt" "a")) (setq EN1 (car (entsel "\nSelect Room Text: "))) (setq RMTXT (cdr (assoc 1 (entget EN1)))) (princ "\nSelect Dimensions In Order: ") (setq SS1 (ssget)) (setq I -1) (while (setq DIM (ssname SS1 (setq I (1+ I)))) (setq DIMA (cdr (assoc 13 (entget DIM)))) (setq DIMB (cdr (assoc 14 (entget DIM)))) (setq RMDIST (DISTANCE DIMA DIMB)) (setq RMDIST2DP (rtos RMDIST 2 2)) (princ "\n" FL1) (princ RMTXT FL1) (princ "\t" FL1) (princ RMDIST2DP FL1) (princ "x" FL1) ) (close FL1) (prin1) ) Any thoughts and help would be appreciated thanks gareth Quote
JohnM Posted October 18, 2009 Posted October 18, 2009 there are a couple of waye to do this. look into tables and fields 2009 has a lot you can do with these i would use a block for the room label and also have attributes for length width and area so all ifo is in one place with lisp you can have it ask of the room name, pick a point for boundary, make the boundary , get length width and area info from the boundary using the getboundingbox function, attach a reactor to the boundary so if it changes it automatically updates the block. then use autocads table to import the block info the export to excell if needed Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.