iyant Posted March 6, 2014 Posted March 6, 2014 i use this code to import text, but i cant rotating text. need help from anyone. Sub Txt() Dim ACAD As AcadApplication Dim txObj As acadText Dim rotObj As AcRotationAngle Dim ws As Range Dim CrdNo(0 To 2) As Double Dim TxNo As String Dim hNo As Double Dim angl As Double Dim LastRow As Double Dim i As Integer Dim j As Integer Dim k As Integer Set ws = Worksheets("SCR").Cells LastRow = ws(Rows.Count, 20).End(xlUp).Row hNo = 0.3 angl = 90 For i = 2 To LastRow CrdNo(0) = ws(i, 20): CrdNo(1) = ws(i, 21): CrdNo(2) = "0" TxNo = ws(i, 21) Set txObj = AcadApplication.ActiveDocument.ModelSpace.AddText(TxNo, CrdNo, hNo) 'Set rotObj = AcadApplication.ActiveDocument.ModelSpace.AddHatch.Rotate(CrdNo, angl)' Next i End Sub Thanks for Help Quote
RICVBA Posted March 6, 2014 Posted March 6, 2014 just use txObj.Rotation = angl but remember that angle is in radians. if you want a 90 degrees rotation you must set angl = 1.5708 for other small issues see http://forums.augi.com/showthread.php?155004-VBA-import-Text bye Quote
iyant Posted March 6, 2014 Author Posted March 6, 2014 Thanks RICVBA, its Work now.. *THUMBs UP* 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.