pBe Posted January 13, 2012 Posted January 13, 2012 I wrote this code earlier. inserting a diameter symbol on the dimension string as prefix. but not %%c but a square symbol wtih a line to mimic the diameter symbol (defun c:test (/ aDoc selset e str data p1 ) (defun MtexInfo ( mt / db dl ds );;LM snippet (if (and (wcmatch (cdr (assoc 0 (setq dl (entget mt)))) "*DIMENSION") (setq db (tblobjname "BLOCK" (cdr (assoc 2 dl)))) ) (while (and (setq db (entnext db)) (not ds)) (if (eq "MTEXT" (cdr (assoc 0 (setq dl (entget db))))) (setq ds (mapcar '(lambda (j) (cdr (assoc j dl))) '(42 43 50 7 10)))) ) ) ds ) (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (setq selset (ssget '((0 . "DIMENSION")))) (repeat (sslength selset) (setq e (vlax-ename->vla-object (ssname selset 0)) ) (vla-put-Textprefix e "{\\Fgdt|c0;\\H0.75x;o} " ) (setq data (mtexinfo (ssname selset 0))) (entmakex (list (cons 0 "LINE") (cons 10 (setq p1 (polar (polar (last data) (+ pi (caddr data)) (- (/ (car data) 2.0) (* (/ (cadr data) 2.0) (* (cdr (assoc 41 (tblsearch "STYLE" (nth 3 data))) ) 0.75 ) ) ) ) (+ (* pi 1.5) (caddr data)) (/ (cadr data) 2.0) ) ) ) (cons 11 (polar p1 (+ (/ pi 2.0) (caddr data)) (cadr data))) ) ) (ssdel (ssname selset 0) selset) ) ) (princ) ) Question is , How to tie the line (|) with the dimension? I'm a bit rusty with reactors and reluctant to push forward with the coding until i'm sure via object reactor is the best (or the ONLY) approach. Any thoughts? Quote
ReMark Posted January 13, 2012 Posted January 13, 2012 The symbol is for square feet? Isn't there a font that has that as part of its character set already? Quote
pBe Posted January 13, 2012 Author Posted January 13, 2012 The symbol is for square feet? Isn't there a font that has that as part of its character set already? I'm sure there is.. but AFAICT its limited to a particular font type. need one that can be used from an "out-of-the box" / un-customized cad pacakge, plus not sure where to look Quote
pBe Posted January 18, 2012 Author Posted January 18, 2012 Whoa.. i'm surprise this query did not get any response suggestions/advise Anyhoo... guess i'll just shelve this code for now Thanks Quote
flopo Posted January 19, 2012 Posted January 19, 2012 I would like to help you , pBe, but i can't Quote
Lee Mac Posted January 19, 2012 Posted January 19, 2012 Maybe this program will point you in the right direction, it is also associating one object with another. 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.