With all due respect, I explained this in clear English, unless English is your second language, of which I shall explain it again.
The purpose of this lisp is to compare a User given point or datum to the ordinate dimension datum. So for instance, lets say that the correct datum is 0,0,0. And through drawing editing, the ordinate dimensions that are on the drawing somehow get moved from 0,0,0. Say one gets moved to 1,0,1 and another is moved to 1,1,0. The lisp routine will scan all the ordinate dimensions and compare their datums to the user given datum of 0,0,0. Those two ordinate dimension datum that are 1,0,1 and 1,1,0 will be flagged and the lisp will draw a line from their points, indicating that they are incorrect while ignoring other ordinate dimension datums that are 0,0,0.
Yeah, I don't learn code well outside a classroom. I'm one who needs finished code to learn how to construct new code.
Bigal:
Now I'm going to get back to the lisp routine that was posted. I tried to follow your code, but I don't understand why you nullified the first IF statement.
I've tried to switch the IF statement from BKT to saying NOT EQUAL, but the lisp keeps throwing an error.
- (defun c:ordinatecheck2 (/ origin ss obj StPt EdPt x) (setq origin (getpoint "Pick a point or type coordinate: ")) (command "-layer" "m" "DIM_WRONG" "c" "red" "DIM_WRONG" "p" "n" "DIM_WRONG" "s" "DIM_WRONG" ""); (if T; ((10 . *) (100 . "AcDbOrdinateDimension") = !origin); (progn (nil)); (/= origin); (setq ss (ssget "X" (list (cons 0 "DIMENSION")(cons 100 "AcDbOrdinateDimension")))) (if (setq ss (ssget "X" (list (cons 0 "DIMENSION")(cons 100 "AcDbOrdinateDimension")))) (repeat (setq x (sslength ss)) (setq obj (entget (ssname ss (setq x (- x 1))))) (setq StPt (cdr (assoc 10 obj))) (setq EdPt (cdr (assoc 11 obj))); (alert (strcat "x="(rtos (car StPt) 2 2) " y="(rtos (cadr StPt) 2 2))) ;; Changed to StPt? (if ([b][color=red]not[/color][/b] equal origin StPt) ;; Changed "=" to "equal"; (progn (entmake (list '(0 . "LINE") '(100 . "AcDbLine") (cons 10 StPt) ;; Changed to StPt (cons 11 EdPt) ;; Changed to EdPt; (foreach))))))(princ))
A 'too many arguments' crops up. Otherwise the lisp draws lines on every ordinate dimension in the drawing. I'm trying to drop this down to either one of two things:
Drawing the line on WRONG ordinate dimensions and coloring the line RED to indicate as such. Then the user can correct those that are wrong.
OR
Drawing the line on CORRECT ordinate dimensions and coloring the line GREEN to indicate as such. Then the user can ignore those that are right and fix those that are wrong.
Please use the code I posted with the red NOT. The other has problems with the layer part. |