Tyke Posted August 24, 2010 Share Posted August 24, 2010 Hi, I am having a problem justifying text that I create in a VBA routine. When I use this code: If ThisDrawing.ActiveSpace = acModelSpace Then Set txtPNum = ThisDrawing.ModelSpace.AddText(strPNum, varPNumIns, dblTHeight) Else Set txtPNum = ThisDrawing.PaperSpace.AddText(strPNum, varPNumIns, dblTHeight) End If txtPNum.Alignment = acAlignmentRight txtPNum.Update The text is inserted at 0,0,0 If I comment out the alignment line the text is inserted in the expected position. I also have some MText that I insert and I can't seem to find a method to set its alignment. In the AutoCAD Properties window there is an alignment property. :-( Has anyone else encounted these problems and does anyone see what I'm doing wrong? Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 24, 2010 Share Posted August 24, 2010 does this thread help? http://www.cadtutor.net/forum/showthread.php?41740-position-text-with-VBA Quote Link to comment Share on other sites More sharing options...
Tyke Posted August 24, 2010 Author Share Posted August 24, 2010 Dave, That works a treat for the text. Any ideas on the MText, it's not that important, but it's just bugging me. Many thanks. Quote Link to comment Share on other sites More sharing options...
dbroada Posted August 24, 2010 Share Posted August 24, 2010 sorry but I've never used MTEXT in VBA. Quote Link to comment Share on other sites More sharing options...
Tyke Posted August 24, 2010 Author Share Posted August 24, 2010 Thats ok. Many thanks for your help. Quote Link to comment Share on other sites More sharing options...
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.