mien Posted October 4, 2009 Posted October 4, 2009 how can i set text style using VBA..now im set the text using this code. but it no work....thanks.. ThisDrawing.SendCommand "-style" & vbCr & "HDP_HYDRO" & vbCr & "romans" & vbCr & "0" & vbCr & "0.75" & vbCr & "15" & vbCr & "N" & vbCr & "N" & vbCr & "N" & vbCr i try to set text style for this text Set cllyr = ThisDrawing.Layers.Add("Level 1") cllyr.color = Val(cl1) Set point = ThisDrawing.ModelSpace.AddPoint(dblPt) point.Layer = "Level 1" 'convert sign value If optLand.Value = True Then strTemp = Round(arrText(2), acc) Set cllyr = ThisDrawing.Layers.Add("Level 1") cllyr.color = Val(cl1) Set actext = ThisDrawing.ModelSpace.AddText(Round(arrText(2), acc), dblPt, 2) actext.Alignment = acAlignmentCenter ElseIf optHydro.Value = True Then strTemp = Fix(arrText(2)) Set cllyr = ThisDrawing.Layers.Add("Level 1") cllyr.color = Val(cl1) Set actext = ThisDrawing.ModelSpace.AddText(Fix(-(arrText(2))), dblPt, 2) actext.ObliqueAngle = 15 actext.Alignment = acAlignmentRight End If actext.Rotation = 2 * pi actext.Layer = "Level 1" actext.TextAlignmentPoint = dblPt actext.Update If optHydro.Value = True Then strTemp = Right(arrText(2), 1) Set cllyr = ThisDrawing.Layers.Add("Level 1") cllyr.color = Val(cl1) Set actext = ThisDrawing.ModelSpace.AddText(Right(arrText(2), 1), dblPt, 1.5) actext.ObliqueAngle = 15 actext.Alignment = acAlignmentMiddleLeft actext.Rotation = 2 * pi actext.Layer = "Level 1" actext.TextAlignmentPoint = dblPt actext.Update End If 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.