Jump to content

Dim Style overrides & changing dim style variables.


muck

Recommended Posts

AutoCAD VBA

 

In AutoCAD 2004 I use the following code to change my

dimstyle variables by picking the dimension.

 

In AutoCAD 2009 the following code does not do this.

I think is changes dim style overrides? What ever that

is?

 

I would like to simply change my dim variables in current

dim style. How can the following code be modified to do

this?

 

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

'DIMTAD

ThisDrawing.SetVariable "DIMTAD", objDimension.VerticalTextPosition

 

MsgBox objDimension.TextHeight

ThisDrawing.SetVariable "DIMTX", 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

 

End Sub

 

Thank you,

Link to comment
Share on other sites

     Set objDimStyle = ThisDrawing.DimStyles.Add("YourNamedStyle")
     objDimStyle.CopyFrom ThisDrawing
     ThisDrawing.ActiveDimStyle = objDimStyle
Make your changes here....................
     objDimStyle.CopyFrom ThisDrawing

Link to comment
Share on other sites

How do I get the Annotative text variable and the Dimstyle variable???

 

I think that is what I need to make this thing work??

Thank you,

Link to comment
Share on other sites

If your looking for a variable to make a style annotative, that is the one thing I have not been able to do. What do you mean by dimstyle var? That seems to open the dim manager

Link to comment
Share on other sites

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