Text Style Vertical

Text Style Vertical

Anonymous
Not applicable
162 Views
3 Replies
Message 1 of 4

Text Style Vertical

Anonymous
Not applicable
How do I tell if a text style has the vertical flag set? I figured out I
can get Backwards, and upsidedown from the TextGenerationFlag value, but I
don't see any where to get the vertical setting.

This is a snip of what I am trying to do.

Sub test()

Dim textStyles As String
Dim TextEntry As AcadTextStyle

textStyles = ""

For Each TextEntry In ThisDrawing.textStyles
textStyles = textStyles + "textstyle" & "," & TextEntry.Name & "," &
TextEntry.fontFile & "," & _
TextEntry.Height & "," & TextEntry.Width & "," &
TextEntry.ObliqueAngle & "," & TextEntry.TextGenerationFlag & vbCrLf
'How do I get the vertical?
Next

MsgBox textStyles

End Sub

--
Kent Keller
Strobe Data Inc.
www.strobedata.com
Signs of the Times
LOG ON: Makin a wood stove hotter
0 Likes
163 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Kent,

A Text object has a rotation property which I believe is what you are
looking for.

Joe Sutphin
Author of "AutoCAD 2000 VBA Programmers Reference"
ISBN #1861002564 Order it at
http://www.amazon.com/exec/obidos/ASIN/1861002564/o/qid%3D942504788/sr%3D8-1
/002-7788324-2908264

Checkout Sources - the only magazine dedicated to AutoCAD customization
http://vbdesign.hypermart.net/sources/

Kent Keller wrote in message
news:85dfq2$2ek11@adesknews2.autodesk.com...
> How do I tell if a text style has the vertical flag set? I figured out I
> can get Backwards, and upsidedown from the TextGenerationFlag value, but I
> don't see any where to get the vertical setting.
>
> This is a snip of what I am trying to do.
>
> Sub test()
>
> Dim textStyles As String
> Dim TextEntry As AcadTextStyle
>
> textStyles = ""
>
> For Each TextEntry In ThisDrawing.textStyles
> textStyles = textStyles + "textstyle" & "," & TextEntry.Name & "," &
> TextEntry.fontFile & "," & _
> TextEntry.Height & "," & TextEntry.Width & "," &
> TextEntry.ObliqueAngle & "," & TextEntry.TextGenerationFlag & vbCrLf
> 'How do I get the vertical?
> Next
>
> MsgBox textStyles
>
> End Sub
>
>
> --
> Kent Keller
> Strobe Data Inc.
> www.strobedata.com
> Signs of the Times
> LOG ON: Makin a wood stove hotter
>
>
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
Joe

I don't think so, I am not looking at a text object.

What I want to do is check to see if a text style has the vertical
check box checked in the Style dialog box. There doesn't need to
be any text created, and most likely won't be when this is run.
Basically I am trying to take a Textstyle and save it to a *.txt
file so I can recreate the textstyle in another drawing.

--
Kent Keller
Check out the Mechanical Desktop FAQ @
http://webhome.idirect.com/~dfulford/

"Joe Sutphin" wrote in message
news:85e12m$3p356@adesknews2.autodesk.com...
> Kent,
>
> A Text object has a rotation property which I believe is what
you are
> looking for.
>
0 Likes
Message 4 of 4

lando7189
Advocate
Advocate

I know this is a REALLY OLD post, but i'm putting this here incase anybody else encounters it.  You must look to see if bitcode 4 is set within DXF group 70 of the style.  

 

HTH - Lanny

 

 

Public Function EvalLispExpression(lispStatement As String) As Variant
    On Error Resume Next: DoEvents
    EvalLispExpression = ""
    'Exit Function
    
    Dim origSDI As Integer
    origSDI = ThisDrawing.GetVariable("SDI")
    
    If False And origSDI = 1 Then
        ThisDrawing.SetVariable "SDI", 0
    End If
    
    'Dim vlApp As Object
    If vlApp Is Nothing Then
        Set vlApp = CreateObject("VL.Application.16")
    End If

    Dim vlDoc As Object
    Set vlDoc = vlApp.ActiveDocument

    Dim vlFunc As Object
    Set vlFunc = vlDoc.Functions

    Dim vlRead As Object
    Set vlRead = vlFunc.Item("read")

    Dim vlSym As Object
    Set vlSym = vlRead.funcall(lispStatement)

    Dim vlEval As Object
    Set vlEval = vlFunc.Item("eval")

    Dim RetVal As Variant
    RetVal = vlEval.funcall(vlSym)
    If Err Then RetVal = ""

    Set vlSym = Nothing
    Set vlEval = Nothing
    Set vlRead = Nothing
    Set vlFunc = Nothing
    Set vlDoc = Nothing
    Set vlApp = Nothing

    If False And origSDI = 1 Then
        ThisDrawing.SetVariable "SDI", 1
    End If
    
    EvalLispExpression = RetVal
End Function


Public Function IsTextStyleVertical(ts As AcadTextStyle) as Boolean
    IsTextStyleVertical = EvalLispExpression("(= (LOGAND 4 (CDR (ASSOC 70 (TBLSEARCH ""STYLE"" """ & ts.Name & """)))) 4)") <> "True"
End Function

0 Likes