muck Posted December 31, 2008 Posted December 31, 2008 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, Quote
CmdrDuh Posted January 2, 2009 Posted January 2, 2009 Is your style Annotative? it wont change the dimscale if yes 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.