Over 1.091.000 registered users (EN+CZ).
AutoCAD tips, Inventor tips, Revit tips.
Try the new precise Engineering calculator.
New AutoCAD 2026 commands and variables.
Discussion forum
?CAD discussions, advices, exchange of experience

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
add mttext with color |
Post Reply ![]() |
Author | |
katto01 ![]() Newbie ![]() Joined: 24.Jun.2009 Location: Japan Using: ZWCAD Status: Offline Points: 19 |
![]() ![]() ![]() ![]() ![]() Posted: 20.Nov.2024 at 10:33 |
Hello,
I am trying to plot a few text objects with different colors. Here is the code I have. the color is black rather than red. Any suggestions? Thanks Sub AddMTextWithTrueColor() ' Declare variables Dim mTextObj As Object Dim insertionPoint(0 To 2) As Double Dim textContent As String Dim trueColor As Long ' Set the insertion point for the MText (e.g., 0,0,0) insertionPoint(0) = 0 insertionPoint(1) = 0 insertionPoint(2) = 0 ' Set the text content textContent = "This is an example of MText with True Color." ' Set the True Color (e.g., RGB(255, 0, 0) = Red) trueColor = RGB(255, 0, 0) ' Red color ' Create MText object at the specified insertion point Set mTextObj = ThisDrawing.ModelSpace.AddMText(insertionPoint, 50, textContent) ' Set the True Color of the MText object mTextObj.Color = trueColor ' Use Color property to set the True Color ' Optionally, you can set the text height, width, rotation, etc. mTextObj.TextHeight = 2 ' Set the text height to 2 units ' Zoom to the new object for better visibility ThisDrawing.ActiveViewport.ZoomExtents End Sub |
|
Katto Ishimura
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,061 seconds.