Jump to content

Recommended Posts

Posted

Version 2009

 

I have written the following VBA code and for some reason it will not

change the drawing dimscale in version 2009. How do I change

drawing dimscale with this code? Dimscale scale code is at

'?????? in the following code.

 

 

Private Sub CommandButton2_Click()

Dim objDimension As AcadDimension

Dim varPickedPoint As Variant

Dim objDimStyle As AcadDimStyle

Dim strDimStyles As String

Dim strChosenDimStyle As String

Dim stg As String

On Error Resume Next

Me.hide

ThisDrawing.Utility.GetEntity objDimension, varPickedPoint, _

"Picked a dimension whose style you wish to set"

If objDimension Is Nothing Then

MsgBox "You failed to pick a dimension object"

Exit Sub

End If

stg = "Textheight"

 

'MsgBox objDimension.TextRotation

'ThisDrawing.SetVariable "CLAYER", objDimension.DimensionLinelayer

 

MsgBox objDimension.Layer

ThisDrawing.SetVariable "CLAYER", objDimension.DimensionLinelayer

 

MsgBox objDimension.DimensionLineColor

ThisDrawing.SetVariable "DIMCLRD", objDimension.DimensionLineColor

 

MsgBox objDimension.ExtensionLineColor

ThisDrawing.SetVariable "DIMCLRE", objDimension.ExtensionLineColor

MsgBox objDimension.color

'Dim text color

ThisDrawing.SetVariable "DIMCLRT", objDimension.color

 

MsgBox objDimension.ScaleFactor

'ThisDrawing.SetVariable "DIMSCALE", objDimension.ScaleFactor

'??????ThisDrawing.SetVariable "DIMSCALE", objDimension.ScaleFactor

ThisDrawing.SetVariable "dimscale", objDimension.ScaleFactor

 

MsgBox objDimension.VerticalTextPosition

ThisDrawing.SetVariable "DIMTAD", objDimension.VerticalTextPosition

 

MsgBox objDimension.TextHeight

ThisDrawing.SetVariable "DIMTXT", objDimension.TextHeight

 

MsgBox objDimension.TextStyle

MsgBox objDimension.TextGap

 

ThisDrawing.SetVariable "DIMJUST", objDimension.TextGap

 

MsgBox objDimension.ArrowheadSize

ThisDrawing.SetVariable "DIMASZ", objDimension.ArrowheadSize

 

MsgBox objDimension.ExtensionLineExtend

 

MsgBox objDimension.ExtensionLineOffset

Set objDimStyle = ThisDrawing.DimStyles.Add("YourNamedStyle")

objDimStyle.CopyFrom ThisDrawing

ThisDrawing.ActiveDimStyle = objDimStyle

'Make your changes here....................

objDimStyle.CopyFrom ThisDrawing

'"YourNameStyle"

objDimStyle.Name = "YourNamedStyle"

 

End Sub

 

Thank you,

Posted

Is your style Annotative? it wont change the dimscale if yes

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...