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:
Multiple MText entities with varying overridden colors back to Bylayer
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Multiple MText entities with varying overridden colors back to Bylayer (Read 1106 times)
0 Members and 1 Guest are viewing this topic.
jlogan02
Bull Frog
Posts: 327
Multiple MText entities with varying overridden colors back to Bylayer
«
on:
November 17, 2020, 12:26:40 PM »
I have multiple instances of mtext notes that have the color overridden to
colors 1, 15, 30, 150 for standards notes.
This is what I've got that seems to be working. Just want to see if my approach is correct.
Basically, I'll put a separate (progn statement for each instance of Mtext color. Is that the correct approach?
Code - Auto/Visual Lisp:
[Select]
(
if
(
setq
sel
(
ssget
"_X"
'
(
(
0
.
"mtext"
)
)
)
)
;;MTEXT
(
repeat
(
setq
int1
(
sslength
sel
)
)
(
setq
obj1
(
vlax
-
ename
->
vla-object
(
ssname
sel
(
setq
int1
(
1-
int1
)
)
)
)
)
(
progn
(
setq
txt
(
vla-get-textstring
obj1
)
)
(
while
(
vl-string-search
"
\\
C1;"
txt
)
(
setq
txt
(
vl
-
string
-
subst
"
\\
C256;"
"
\\
C1;"
txt
)
)
)
(
vla-put-textstring
obj1 txt
)
)
(
progn
(
setq
txt1
(
vla-get-textstring
obj1
)
)
(
setq
txt1
(
vla-get-textstring
obj1
)
)
(
while
(
vl-string-search
"
\\
C15;"
txt1
)
(
setq
txt1
(
vl
-
string
-
subst
"
\\
C256;"
"
\\
C15;"
txt1
)
)
)
(
vla-put-textstring
obj1 txt1
)
)
)
)
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
Lee Mac
Seagull
Posts: 12929
London, England
WWW
Re: Multiple MText entities with varying overridden colors back to Bylayer
«
Reply #1 on:
November 17, 2020, 12:34:12 PM »
Assuming that you are looking to remove the colour, have you considered using something like
this
?
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
jlogan02
Bull Frog
Posts: 327
Re: Multiple MText entities with varying overridden colors back to Bylayer
«
Reply #2 on:
November 17, 2020, 01:37:02 PM »
Thanks Lee,
I should have said, the example is part of a larger routine that handles color changes for other entities.
Logged
J. Logan
ACAD 2018
I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Multiple MText entities with varying overridden colors back to Bylayer