katto01 Posted June 18, 2018 Posted June 18, 2018 Hello, I have this routine to add text in AutoCAD. I was wondering if I could set the font size, type and color. Could not find any reference to this. Thank you Public Sub AddMyTextHeight(xx, yy, HEIGHT, XC, textString) Dim textObj As AcadText Dim insertionPoint(0 To 2) As Double insertionPoint(0) = xx insertionPoint(1) = yy insertionPoint(2) = 0 Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, HEIGHT) textObj.color = XC End Sub Quote
spiff88 Posted June 18, 2018 Posted June 18, 2018 You can assign a style, but not a font. If you setup a style first, like "Arial" using the Arial font - you could do this: textObj.StyleName = "Arial" Font size would be the Height property textObj.Height = 12 Color isn't listed as property for AcadText, but I can assign it. There is also the TrueColor property, using RGB values You can get more information at this AutoDesk page on AcadText for more information. https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-ActiveX/files/GUID-ED298AC7-19E0-4E54-8983-48439EF70116-htm.html Quote
dlanorh Posted June 18, 2018 Posted June 18, 2018 Hello,I have this routine to add text in AutoCAD. I was wondering if I could set the font size, type and color. Could not find any reference to this. Thank you Find and open your "acadauto.chm" file. It's invaluable. Try looking in c:\program files\common files\autodesk shared\ I would attach a copy but i can't upload it Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.