Jump to content

Recommended Posts

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...