Author Topic: Help fix Torient  (Read 2120 times)

0 Members and 1 Guest are viewing this topic.

BazzaCAD

  • Guest
Help fix Torient
« 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:
Code: [Select]
(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...

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Help fix Torient
« Reply #1 on: October 21, 2009, 03:09:03 PM »
I'm working on updating it at the moment, but give this a whirl. :)
Works on blocks, text, mtext, multileaders.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

BazzaCAD

  • Guest
Re: Help fix Torient
« Reply #2 on: October 21, 2009, 05:06:39 PM »
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... :)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Help fix Torient
« Reply #3 on: October 21, 2009, 05:10:26 PM »
Can you get the bounding box, rotate it, then move it back to the same coordinates?
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

BazzaCAD

  • Guest
Re: Help fix Torient
« Reply #4 on: October 21, 2009, 05:17:24 PM »
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...


T.Willey

  • Needs a day job
  • Posts: 5251
Re: Help fix Torient
« Reply #5 on: October 21, 2009, 05:23:02 PM »
Then use the ' vla-GetBoundingBox ' and ' vla-Move ' methods.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Help fix Torient
« Reply #6 on: October 21, 2009, 05:27:23 PM »
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. :)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox