TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: BazzaCAD on October 21, 2009, 02:58:09 PM
-
I was going through "ACETTXT.LSP" and trying to fix the Torient command to work with Annotative Mtext.
I got to here, then got stuck:
(defun bns_rotate_text ( e1 ang / p1 p2 a)
(setq p1 (acet-geom-textbox e1 0.2))
(setq p1 (acet-geom-midpoint (car p1) (caddr p1)))
(setq a (cdr (assoc 50 e1)))
(setq a (+ ang a))
;(setq e1 (subst (cons 50 a) (assoc 50 e1) e1))
(setq vlo (vlax-ename->vla-object (cdr (assoc -1 e1))))
(vla-put-Rotation vlo a)
;(entmod e1)
;(entupd (cdr (assoc -1 e1)))
;(setq e1 (entget (cdr (assoc -1 e1))))
(setq p2 (acet-geom-textbox e1 0.2))
(setq p2 (acet-geom-midpoint (car p2) (caddr p2)))
(setq a (acet-geom-delta-vector p2 p1))
(setq a (trans a 1 na T))
(setq p1 (cdr (assoc 10 e1)))
(setq p1 (acet-geom-vector-add p1 a))
(setq p2 (cdr (assoc 11 e1)))
(setq p2 (acet-geom-vector-add p2 a))
(vla-put-InsertionPoint vlo (vlax-3D-point p1))
;(setq e1 (subst (cons 10 p1) (assoc 10 e1) e1))
;(setq e1 (subst (cons 11 p2) (assoc 11 e1) e1))
;(entmod e1)
;(entupd (cdr (assoc -1 e1)))
);defun bns_rotate_text
The rotation is working, but the InsertionPoint isn't.
What am I missing? Seems like you "Dynamic Text" guys already figured this out...
-
I'm working on updating it at the moment, but give this a whirl. :)
Works on blocks, text, mtext, multileaders.
-
Thanks for the alternate code, but that's not really what I was looking for.
I'd like to get the "Most Readable" option working in the Torient command.
So it will rotate the text 180 if needed & move it back into it's original location, instead of just rotating it about it's Insertion Point.
So hopefully that's the area you're working on... :)
-
Can you get the bounding box, rotate it, then move it back to the same coordinates?
-
I theory yes, that's what what the old DXF (entmod) code does. I just got stuck updating it VLisp.
I thought Adsk fixed (entmod) in Acad2010 sp1, but the old code still doesn't work...
-
Then use the ' vla-GetBoundingBox ' and ' vla-Move ' methods.
-
Thanks for the alternate code, but that's not really what I was looking for.
I'd like to get the "Most Readable" option working in the Torient command.
So it will rotate the text 180 if needed & move it back into it's original location, instead of just rotating it about it's Insertion Point.
So hopefully that's the area you're working on... :)
No problem, just thought I'd offer.
Actually, that's one of many things I'm working on. :)