Visual LISP, AutoLISP and General Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Need LISP to draw line / pline to match TEXT rotation!
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2011 08:15 AM in reply to:
Kent1Cooper
Saving UCS as Temp, in reply to Kent, etal: Yep, and your "P" for Previous is the better way, for that case, and for most cases.
Save the UCS is a debug habit, not normally required.
S
Re: Need LISP to draw line / pline to match TEXT rotation!
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2011 10:54 AM in reply to:
stevor
Just account for the UCS being something other than world...
(defun c:Test (/ e d p)
(vl-load-com)
(setvar 'ERRNO 0)
(if
(and
(progn
(while (progn (setq e (car (entsel "\nSelect *Text object for angle: ")))
(cond ((eq (getvar 'ERRNO) 7) (princ "\nMissed, try again."))
((eq (type e) 'ENAME)
(if (not (wcmatch (cdr (assoc 0 (setq d (entget e)))) "MTEXT,TEXT"))
(princ "\nInvalid object!")
)
)
)
)
)
e
)
(setq p (getpoint "\nSpecify first point: "))
)
(progn
(vl-cmdf
"_.line"
"_non"
p
(strcat
"<"
(angtos (if (and (eq (cdr (assoc 0 d)) "TEXT") (zerop (getvar 'WORLDUCS)))
(- (cdr (assoc 50 d))
(angle '(0. 0. 0.) (trans (getvar 'UCSXDIR) 0 (trans '(0. 0. 1.) 1 0 T) T))
)
(cdr (assoc 50 d))
)
(getvar 'AUNITS)
4
)
)
PAUSE
)
(while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (vl-cmdf ""))
)
)
(princ)
)
Re: Need LISP to draw line / pline to match TEXT rotation!
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2011 11:08 AM in reply to:
stevor
PERFECT! Thank you very very much!
Re: Need LISP to draw line / pline to match TEXT rotation!
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2011 03:52 PM in reply to:
econnerly
To Econnerly;
1. Notice the post of alanjt: I do not recall if my post included UCS translations.
2. And notice that you can change the Layer and LINE offset down distance, in the code.
And remove the temp UCS, as per Kent1's post.
S
Re: Need LISP to draw line / pline to match TEXT rotation!
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-11-2011 03:56 PM in reply to:
econnerly
I was actually thinking of another alternative that goes something like this:
(setq p1 (cdr (assoc 10 (setq b (entget (car (entsel)))))))
(command ".xline" p1 (polar p1 (cdr (assoc 50 b)) 1) "")
Yes, it's tested!
:-)



