<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: eInvalidInput FontDescriptor in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-fontdescriptor/m-p/2342918#M73539</link>
    <description>After posting I realized that the LispFunction wrapper disappeared due to the attempt at formatting in these text boxes... so just to clarify, the last three functions are all LispFunctions named (leroy), (leroy2) and (kroy), respectively... that's why they have the args parameter.</description>
    <pubDate>Mon, 15 Sep 2008 12:56:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-09-15T12:56:45Z</dc:date>
    <item>
      <title>eInvalidInput FontDescriptor</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-fontdescriptor/m-p/2342917#M73538</link>
      <description>This one really has me stumped... whenever I attempt to create a TextStyleTableRecord of a particular font name, I get "Runtime.Exception: eInvalidInput". The textstyle function works for other fonts, just not this particular one. The font folder is in both the Support File Search Path and Working Support File Search Path... not only that, but the font that doesn't work shows up inside of AutoCAD with the STYLE command. Here is the AddTextStyle code, as well as the function calls (two that work, the one that doesn't).&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
    Public Shared Sub AddTextStyle(ByVal TextStyleName As String, ByVal FontName As String, ByVal width As Double)&lt;BR /&gt;
        Dim myDWG As ApplicationServices.Document&lt;BR /&gt;
        Dim myDB As DatabaseServices.Database&lt;BR /&gt;
        Dim myTransMan As DatabaseServices.TransactionManager&lt;BR /&gt;
        Dim myTrans As DatabaseServices.Transaction&lt;BR /&gt;
&lt;BR /&gt;
        myDWG = ApplicationServices.Application.DocumentManager.MdiActiveDocument&lt;BR /&gt;
        myDB = myDWG.Database&lt;BR /&gt;
        myTransMan = myDWG.TransactionManager&lt;BR /&gt;
        myTrans = myTransMan.StartTransaction&lt;BR /&gt;
&lt;BR /&gt;
        Dim myTST As DatabaseServices.TextStyleTable&lt;BR /&gt;
        Dim myTSTR As DatabaseServices.TextStyleTableRecord = New DatabaseServices.TextStyleTableRecord&lt;BR /&gt;
&lt;BR /&gt;
        Try&lt;BR /&gt;
            myTST = myDB.TextStyleTableId.GetObject(DatabaseServices.OpenMode.ForWrite)&lt;BR /&gt;
            myTSTR.Name = TextStyleName&lt;BR /&gt;
            Dim myFont As New GraphicsInterface.FontDescriptor(FontName, False, False, 0, 0)&lt;BR /&gt;
            myTSTR.Font = myFont&lt;BR /&gt;
            myTSTR.XScale = width&lt;BR /&gt;
            myTST.Add(myTSTR)&lt;BR /&gt;
            myTrans.AddNewlyCreatedDBObject(myTSTR, True)&lt;BR /&gt;
        Catch ex As Exception&lt;BR /&gt;
            If ex.Message = "eDuplicateRecordName" Then&lt;BR /&gt;
                ' style is already present&lt;BR /&gt;
                myTSTR.Dispose()&lt;BR /&gt;
                myTrans.Dispose()&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox(ex.ToString)&lt;BR /&gt;
                myTSTR.Dispose()&lt;BR /&gt;
                myTrans.Dispose()&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            End If&lt;BR /&gt;
        End Try&lt;BR /&gt;
&lt;BR /&gt;
        myTrans.Commit() : myTrans.Dispose()&lt;BR /&gt;
        myDWG.Database.Textstyle = myTSTR.ObjectId&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here are the two functions that work perfectly:&lt;BR /&gt;
&lt;BR /&gt;
    &lt;LISPFUNCTION&gt; _&lt;BR /&gt;
    Public Sub leroy(ByVal args As ResultBuffer)&lt;BR /&gt;
        AddTextStyle("LEROY", "romans", 0.85)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
    &lt;LISPFUNCTION&gt; _&lt;BR /&gt;
    Public Sub leroy2(ByVal args As ResultBuffer)&lt;BR /&gt;
        AddTextStyle("LEROY2", "romand", 0.85)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
And here is the one that fails miserably:&lt;BR /&gt;
&lt;BR /&gt;
&lt;LISPFUNCTION&gt; _&lt;BR /&gt;
    Public Sub kroy(ByVal args As ResultBuffer)&lt;BR /&gt;
        AddTextStyle("KROY", "au102s01", 0.85)&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Please help?&lt;/LISPFUNCTION&gt;&lt;/LISPFUNCTION&gt;&lt;/LISPFUNCTION&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:53:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-fontdescriptor/m-p/2342917#M73538</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-09-15T12:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: eInvalidInput FontDescriptor</title>
      <link>https://forums.autodesk.com/t5/net-forum/einvalidinput-fontdescriptor/m-p/2342918#M73539</link>
      <description>After posting I realized that the LispFunction wrapper disappeared due to the attempt at formatting in these text boxes... so just to clarify, the last three functions are all LispFunctions named (leroy), (leroy2) and (kroy), respectively... that's why they have the args parameter.</description>
      <pubDate>Mon, 15 Sep 2008 12:56:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/einvalidinput-fontdescriptor/m-p/2342918#M73539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-09-15T12:56:45Z</dc:date>
    </item>
  </channel>
</rss>

