Dimension measurement doesn't match with Dimension Text

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
Is it possible to match dimension measurement to dimension text?
I have a small code; it extract measurement from dimension line and insert into text as a field (measurement). There is a case that the dimension measurement is differ from dimension text when the dimension is in the board line between of precision (1/16”).
As shown on the picture, the dimension text shows 2-10 15/16” but it is shown as 2’-10 7/8” in dimension measurement. In other case, it shows 1’-0 13/16” in dimension but it shows as 1’-0 3/4”.
Is there any to fix for it?
Or add a review processes to compare the string value of dimension text and dimension measurement so if they are not same, add an alert,
(alert "Dimension text does not match with Dimension measurement. \nPlease review it"))
Please refer to attached dwg file for the sample.
Many thanks in advance.
(defun c:test (/ ent dtxt)
(vl-load-com)
(and (setq ent (car (entsel "\nSelect Dimension: ")))
(eq "DIMENSION" (cdr (assoc 0 (entget ent))))
(setq dtxt (car (entsel "\nSelect Destination: ")))
(wcmatch (cdr (assoc 0 (entget dtxt))) "*TEXT")
(vla-put-TextString
(vlax-ename->vla-object dtxt)
(strcat
"%<\\AcObjProp.16.2 Object(%<\\_ObjId "
(itoa (vla-get-ObjectId (vlax-ename->vla-object ent))) ">%).Measurement \\f \"%lu6%zs13\">%")))
(vla-put-layer (vlax-ename->vla-object dtxt) "0")
(princ))=