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
»
.NET
»
Topic:
Overriding font on a block attribute
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Overriding font on a block attribute (Read 1806 times)
0 Members and 1 Guest are viewing this topic.
chriskroll
Guest
Overriding font on a block attribute
«
on:
January 15, 2015, 01:35:04 PM »
I need to override the font in a block attribute to be Arial. I have tried the following code, but nothing seems to work. Anyone have any insight?
Code - C#:
[Select]
if
(
attRef
.
IsMTextAttribute
)
{
// This method sets the attRef.MTextAttribute.Contents correctly,
// but leaves the attRef.TextString empty so that nothing shows
// up for this attribute in the drawing.
attRef
.
TextString
=
"{
\\
fArial|b0|i0|c0|p82;Hello Swamp!}"
attRef
.
UpdateMTextAttribute
(
)
;
// This does nothing at all.
attRef
.
MTextAttribute
.
Contents
=
"{
\\
fArial|b0|i0|c0|p82;Hello Swamp!}"
// This causes AutoCAD to crash.
MText mt
=
new
MText
(
)
;
mt
.
Contents
=
"{
\\
fArial|b0|i0|c0|p82;Hello Swamp!}"
;
attRef
.
MTextAttribute
=
mt
;
}
«
Last Edit: January 15, 2015, 01:47:54 PM by chriskroll
»
Logged
chriskroll
Guest
Re: Overriding font on a block attribute
«
Reply #1 on:
January 15, 2015, 02:38:19 PM »
Nevermind, I found out that the string I was assigning to Contents was not properly formatted. This was causing it to fail to update the TextString property.
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
Overriding font on a block attribute