Lisp search

Status
Not open for further replies.

P.C.

Usenet Archive
Joined
Oct 27, 2000
Messages
218
Reaction score
0
Hi.

skrev i en meddelelse

Is there a method of finding / highlighting all forced dimensions in a drawing, using lisp. Possibly adding a NTS suffix an underline or simply a colour change, this would be an invaluable tool in the checking of drawings.

Want it to blink then ,there are lisp functions for that ;)) P.C. http://w1.1396.telia.com/~u139600113/a
 
wrote:

Is there a method of finding / highlighting all forced dimensions in a drawing, using lisp. Possibly adding a NTS suffix an underline or simply a colour change, this would be an invaluable tool in the checking of drawings.

sure, here's one that turns all them nasty non-associative dims red...
Dave

;;routine to check dimensions for associativity
;;and changes non-associative dim text red color
(defun c:dimchk (/ selDim eprDim intNumIncr intRun entDim) (setvar "cmdecho" 0) (command "undo" "be") (if (not (setq selDim (ssget "x" (list (cons 0 "DIMENSION"))))) (progn (alert "No dimensions found") (exit)) (progn (princ "\nChecking dimensions. ") (setq intNumIncr 0) (repeat (sslength selDim) (setq eprDim (entget (ssname selDim intNumIncr))) (if (/= (cdr (assoc 1 eprDim)) "") (mh_dim_text_modify) ) (setq intNumIncr (1+ intNumIncr)) ) ) ) (command "._regenall") (princ "...Done") (command "undo" "e") (princ)
)

(defun mh_dim_text_modify
(setq eprDim (entget (tblobjname "BLOCK" (cdr (assoc 2 eprDim))))) (setq intRun 1) (while intRun (setq entDim (entnext (cdr (assoc -1 eprDim)))) (if (not entDim) (setq intRun nil) (progn (setq eprDim (entget entDim)) (if (= (cdr (assoc 0 eprDim)) "MTEXT") (progn (entmod (subst (cons 62 1) (assoc 62 eprDim) eprDim)) ;change the (cons 62 x) to change the highlight text color (setq intRun nil) ) ) ) ) )
)
 
And just to show you how giving these guys are...back when this happened in the 1st place... after Bernd posted...
along came Walter with this:

Subject: Re: Visibly Associative Dimensions
View this article only

And for those who prefer VBA. It changes the dimension text to yellow and reports the number of instances found:

Sub ad_VerifyDims
Dim adDimension As AcadDimension
Dim adSS As AcadSelectionSet
Dim fType(0 To 1) As Integer, fData(0 To 1)
Dim adOverRideCount As Integer
adOverRideCount = 0
Set adSS = ThisDrawing.SelectionSets.Add("adSS")
If Err Then Set adSS = ThisDrawing.SelectionSets.Add("adSS") adSS.Clear fType(0) = 0: fData(0) = "DIMENSION": fType(1) = 100: fData(1) = "*" adSS.Select acSelectionSetAll, , , fType, fData For Each adDimension In adSS If adDimension.TextOverride "" Then adDimension.TextColor = acYellow adOverRideCount = adOverRideCount + 1 End If Next adDimension ThisDrawing.Application.Update MsgBox adOverRideCount & " dimension override(s) found..." adSS.Delete End Sub

-- Walter -- http://www.ActiveDwg.com

"John Payne" wrote:

From a search on google.groups.com:

Subject: Re: Visibly Associative Dimensions
View: Complete Thread (8 articles) | Original Format

Here you go guys.

snipped

wrote:
<<Is there a method of finding / highlighting all forced dimensions in a drawing, using lisp. Possibly adding a NTS suffix an underline or simply a colour change, this would be an invaluable tool in the checking of drawings.>>
 
Status
Not open for further replies.

Latest threads

Back
Top