Message 1 of 6
vba copy dimension set currect size problem

Not applicable
01-08-2006
09:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need some help finding out why dimension arrowheads are coming in at
distance of 450' in a 50 scale drawing.
I placed a sample in the customer-area.
This is driving me crazy, I copied an existing dimstyle "dec50" which
appears to have everything set property.
drawing scale is 50, so the dimscale is 50 and asz = .18 then why does it
insert the arrowhead at 450' when they should be 9'
any hints or comments are welcomed
Have a great day,
John Coon
running autocad 2002
Dim CurDimStyle As AcadDimStyle
Dim NewDimstyle As AcadDimStyle
'Save copy of current dimstyle
Set CurDimStyle = ThisDrawing.ActiveDimStyle
Dim dDimScale As Double
Dim darrowsize As Double
dDimScale = ThisDrawing.GetVariable("Dimscale")
darrowsize = ThisDrawing.GetVariable("dimasz")
darrowsize = 0.18
'Create new dimstyle
Set NewDimstyle = ThisDrawing.DimStyles.Add("PapiText")
NewDimstyle.CopyFrom ThisDrawing
ThisDrawing.ActiveDimStyle = NewDimstyle
ThisDrawing.SetVariable "DimTad", 1
ThisDrawing.SetVariable "Dimtmove", 2
ThisDrawing.SetVariable "dimasz", darrowsize
Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(DIMpoint1, DIMpoint2,
DIMlocation)
dimObj.TextMovement = acMoveTextNoLeader
dimObj.ScaleFactor = 1
dimObj.PrimaryUnitsPrecision = acDimPrecisionTwo
dimObj.TolerancePrecision = acDimPrecisionTwo
dimObj.TextHeight = strDIMTXSTY
dimObj.TextGap = 1
dimObj.ExtensionLineExtend = 2#
dimObj.ExtensionLineOffset = 1#
'dimObj.VerticalTextPosition = acAbove
dimObj.TextRotation = 0
distance of 450' in a 50 scale drawing.
I placed a sample in the customer-area.
This is driving me crazy, I copied an existing dimstyle "dec50" which
appears to have everything set property.
drawing scale is 50, so the dimscale is 50 and asz = .18 then why does it
insert the arrowhead at 450' when they should be 9'
any hints or comments are welcomed
Have a great day,
John Coon
running autocad 2002
Dim CurDimStyle As AcadDimStyle
Dim NewDimstyle As AcadDimStyle
'Save copy of current dimstyle
Set CurDimStyle = ThisDrawing.ActiveDimStyle
Dim dDimScale As Double
Dim darrowsize As Double
dDimScale = ThisDrawing.GetVariable("Dimscale")
darrowsize = ThisDrawing.GetVariable("dimasz")
darrowsize = 0.18
'Create new dimstyle
Set NewDimstyle = ThisDrawing.DimStyles.Add("PapiText")
NewDimstyle.CopyFrom ThisDrawing
ThisDrawing.ActiveDimStyle = NewDimstyle
ThisDrawing.SetVariable "DimTad", 1
ThisDrawing.SetVariable "Dimtmove", 2
ThisDrawing.SetVariable "dimasz", darrowsize
Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(DIMpoint1, DIMpoint2,
DIMlocation)
dimObj.TextMovement = acMoveTextNoLeader
dimObj.ScaleFactor = 1
dimObj.PrimaryUnitsPrecision = acDimPrecisionTwo
dimObj.TolerancePrecision = acDimPrecisionTwo
dimObj.TextHeight = strDIMTXSTY
dimObj.TextGap = 1
dimObj.ExtensionLineExtend = 2#
dimObj.ExtensionLineOffset = 1#
'dimObj.VerticalTextPosition = acAbove
dimObj.TextRotation = 0