Inventor Customization

Valued Contributor
Posts: 68
Registered: ‎03-23-2012
Message 1 of 3 (202 Views)
Accepted Solution

Custom Table coming out with garbled text ??

202 Views, 2 Replies
09-20-2012 08:30 AM

I am using to generate a custom table in my .idw files to make a plot stamp.  The table is showing up, however, the text is garbled.  When you open the .idw, the table properties show the text correctly but the display is coming out messed up.  I have attached a picture of what each looks like.  I moved the table off the sheet for clarity.


The code:


Public Sub PlotStamp()

        Dim oDrawDoc As DrawingDocument
        oDrawDoc = _invApp.ActiveDocument
        Dim oInvSheet As Sheet
        oInvSheet = oDrawDoc.ActiveSheet

        Dim oTitles_Plot(0) As String
        oTitles_Plot(0) = CurrentFilename

        Dim position_Plot As Point2d = _invApp.TransientGeometry.CreatePoint2d((oInvSheet.Border.RangeBox.MinPoint.X), (oInvSheet.Border.RangeBox.MinPoint.Y - 0.125))

        Dim oCustomTable_Plot As CustomTable
        oCustomTable_Plot = oInvSheet.CustomTables.Add(" ", position_Plot, 1, 1, oTitles_Plot)

        oCustomTable_Plot.ShowTitle = False
        oCustomTable_Plot.Columns.Item(1).TitleHorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft
        oCustomTable_Plot.Columns.Item(1).ValueHorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft
        Dim oFormat_Plot As TableFormat
        oFormat_Plot = oInvSheet.CustomTables.CreateTableFormat
        oFormat_Plot.OutsideLineColor = _invApp.TransientObjects.CreateColor(255, 255, 255)
        oFormat_Plot.InsideLineColor = _invApp.TransientObjects.CreateColor(255, 255, 255)
        oCustomTable_Plot.OverrideFormat = oFormat_Plot

    End Sub

 Where CurrentFilename is:


CurrentFilename = (CurrentDirectory & "\Submittal_Sheet_" & drawing_count & ".pdf")


ADN Support Specialist
Posts: 467
Registered: ‎08-14-2012
Message 2 of 3 (184 Views)

Re: Custom Table coming out with garbled text ??

09-25-2012 04:01 AM in reply to: nickv02

I can reproduce this problem in Inventor 2013.
You are right – strings with combinations of backslash “\” with some characters (e.g., \T, \S, etc.) are displayed with defects in custom table and column titles.  Sorry.
As a temporary workaround you may consider the following convertor for this kind of strings in column titles:

Function TransformTitle(ByVal St As String) As String
  Dim ChArray() As Char = { _
        "A"c, "B"c, "C"c, "F"c, "G"c, "H"c, _
        "I"c, "L"c, "O"c, "S"c, "T"c, "W"c, _
        "X"c, "Y"c, "b"c, "c"c, "f"c, "i"c, _
        "l"c, "o"c, "q"c, "x"c, "y"c}
  For Each Ch As Char In ChArray
    St = St.Replace("\" & Ch, "\\" & Ch)
  Return St
End Function

Changes in your code:

Dim oTitles_Plot(0) As String
oTitles_Plot(0) = TransformTitle(CurrentFilename) 


Thank you very much for this case.

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Valued Contributor
Posts: 68
Registered: ‎03-23-2012
Message 3 of 3 (175 Views)

Re: Custom Table coming out with garbled text ??

09-25-2012 05:40 AM in reply to: Vladimir.Ananyev

That fixed the garbled text.  Thank you for the solution !

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community

Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor