vba copy dimension set currect size problem

vba copy dimension set currect size problem

Anonymous
Not applicable
543 Views
5 Replies
Message 1 of 6

vba copy dimension set currect size problem

Anonymous
Not applicable
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
0 Likes
544 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
John, one thing; To create a dim style you must set the variables then use copyfrom not the other way around
0 Likes
Message 3 of 6

Anonymous
Not applicable
And another thing, if the drawing is 50 Scale why are you setting the
ScaleFactor to 1? This should be left to the Dimstyle, not the DimObject.

wrote in message news:5053518@discussion.autodesk.com...
John, one thing; To create a dim style you must set the variables then use
copyfrom not the other way around
0 Likes
Message 4 of 6

Anonymous
Not applicable
Jeff & Bryco,

Made edits from your suggestions and it works fine.

Q, If you have to make edits to the style before you copy what would you do
if you wanted the original dim style to remain? would you make the edit as
you noted and then make the changes again setting the values back to what
they were before you copied the style as you get out of the routine.

Thanks for all your help.
John Coon


"Jeff Mishler" wrote in message
news:5053533@discussion.autodesk.com...
And another thing, if the drawing is 50 Scale why are you setting the
ScaleFactor to 1? This should be left to the Dimstyle, not the DimObject.

wrote in message news:5053518@discussion.autodesk.com...
John, one thing; To create a dim style you must set the variables then use
copyfrom not the other way around
0 Likes
Message 5 of 6

Anonymous
Not applicable
Make as many as you want and then make the original current again, very similar to using the dimstyle manager
0 Likes
Message 6 of 6

Anonymous
Not applicable
Bryco,

Thanks

have a great day
John Coon
wrote in message news:5053799@discussion.autodesk.com...
Make as many as you want and then make the original current again, very
similar to using the dimstyle manager
0 Likes