Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Help: Rotate text and block by viewport ucs rotation
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Help: Rotate text and block by viewport ucs rotation (Read 853 times)
0 Members and 1 Guest are viewing this topic.
PM
Guest
Help: Rotate text and block by viewport ucs rotation
«
on:
July 31, 2022, 01:01:53 PM »
Hi. I am using this code to rote the text (to be easy to read) when i rotate viewport ucs (in case to print a drawing). I need help to update this code. I want to select multiple block and text or Mtext
Code - Auto/Visual Lisp:
[Select]
(
defun
c:ROV
(
/
ss2 i vta tmp
)
(
vl-load-com
)
(
prompt
"
\n
Select TEXT and MTEXT to rotate "
)
(
setq
ss2
(
ssget
'
(
(
0
.
"*TEXT"
)
)
)
i
0
vta
(
-
0
(
getvar
"viewtwist"
)
)
)
(
repeat
(
sslength
ss2
)
(
setq
tmp
(
vlax
-
ename
->
vla-object
(
ssname
ss2 i
)
)
)
(
if
(
eq
(
vla-get-ObjectName
tmp
)
"AcDbText"
)
(
progn
(
vlax-put
tmp
"Rotation"
vta
)
(
vlax-put
tmp
"Alignment"
acAlignmentLeft
)
)
(
progn
(
vlax-put
tmp
"Rotation"
0.0
)
(
vlax-put
tmp
"AttachmentPoint"
acAttachmentPointTopLeft
)
)
)
(
setq
i
(
1+
i
)
)
)
)
Thanks
Logged
BIGAL
Swamp Rat
Posts: 1409
40 + years of using Autocad
Re: Help: Rotate text and block by viewport ucs rotation
«
Reply #1 on:
July 31, 2022, 07:46:25 PM »
Not sure how you want to pick blocks, (setq ss2 (ssget '((0 . "*TEXT,INSERT")))
Mtext supports the auto rotation in a viewport your homework.
Logged
A man who never made a mistake never made anything
Crank
Water Moccasin
Posts: 1503
Re: Help: Rotate text and block by viewport ucs rotation
«
Reply #2 on:
August 01, 2022, 01:20:15 PM »
@PM:
If you have the expresstools installed, then look at the TORIENT command. (You can find the lisp in ACETTXT.lsp)
Logged
Vault Professional 2023 + AEC Collection
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Help: Rotate text and block by viewport ucs rotation