- [i][size=2];;;Place Room Tag in Middle of Room and Auto Fill 'x' and 'y' Attribute Values[/size][/i][i][size=2](defun c:RoomTag (/ pt1 pt3 rx ry pt5)[/size][/i][i][size=2](initget 1)[/size][/i][i][size=2](setq pt1 (getpoint "\nFirst Corner: "))[/size][/i][i][size=2](initget 1)[/size][/i][i][size=2](setq pt3 (getcorner pt1 "\nOpposite Corner: "))[/size][/i][i][size=2](setq rx ((- (car pt3)(car pt1))))[/size][/i][i][size=2](setq ry ((- (cadr pt3)(cadr pt1))))[/size][/i][i][size=2](setq pt5 (list (+ rx pt1) (+ ry pt1)))[/size][/i][i][size=2](command "_INSERT" "Tag_Room-Dim" pt5 "" "" pause pause "abs rx "x" abs ry" " ")[/size][/i][i][size=2](princ)[/size][/i][i][size=2])[/size][/i]
Thanks Tharwat, That got it off the ground. But now after I click the other corner of the room it gives me a 'bad function: 186.25'.
I think I need to clarify. I am trying to pick two opposite corners to a room and have the lisp automatically put in a block with attributes I've created and fill the 'room dimensions' value of the block with (x'-x'' x y'-y''). The little 'x' between the two dimensions values is plain text. So I also need to find out how to get the values it is giving me for the distances and convert them to architectural equivalents... 186.25 = 15'-6 1/4". And secondly I would like it to round to the nearest whole number. Thanks for any other help. |