cart: empty [ Login ]

Dimension Style not working for Radial Dimensions - CadLib 4.0

1 
Joe B
3/5/2014 4:00 PM
I am having trouble getting a Dimension Style to display correctly on a Radial Dimension when initially viewing a DWG file with that dimension in it inside of AutoCAD. Here is a picture illustrating it: The rightmost dimension was placed there by my sample CadLib application against the Arc drawn there. The leftmost dimension was created by me in AutoCAD by copying the other dimension and pasting it back into the drawing. Basically until you manually update the Radial dimension somehow in AutoCAD it won't show the updated dimension style and just falls back to the default. Note that the left dimension has a different font and the arrow is set to point from the outside. I've done work with Linear dimensions and they do not seem to have this problem and correctly display different Fonts and end markers without issue immediately upon opening a drawing in AutoCAD. I've updated to the latest version of CadLib available as of last week (4.0.35.85) just to be sure nothing has changed and still am having this problem. My sample application is very simplified in that it just creates an Arc, and puts the dimension on it with a few changes to the style for it (namely the Font and arrow placement). I even put in extra code to pull the dimension back out from the Model and run GenerateBlock() on it per some advice from Wout in another thread on the forum, but that didn't seem to change anything. I've attached a copy of a drawing that I pulled the screenshot from. I'm not sure if I am just using CadLib incorrectly here, if this is an AutoCAD bug, or if there is some issue with Dimension Styles and Radial Dimensions in CadLib. If you need code snippets or additional material please let me know.
Wout
3/6/2014 10:28 AM
Hi, Code snippet would be useful indeed to see what is done exactly. (E.g. you can modify the dimension style, or just the overrides for the dimension, or creating a new dimension style and not adding it to DxfModel.DimensionStyles). - Wout
Wout
3/6/2014 12:11 PM
There is a duplicate text style MARVSTANDARD in the file, this might have something to do with it. - Wout
Joe B
3/6/2014 7:47 PM
Oops, thanks for pointing that out. Fixed that issue but my previous problem still persists. I've attached an updated drawing with everything stripped out, and here is a condensed function I put together of what we are using:
Visual Basic Code:
Dim dimLayer As New DxfLayer("dim") dimLayer.Color = Colors.Cyan model.Layers.Add(dimLayer) Dim dimTextStyle As New DxfTextStyle("MARVSTANDARD", "stylu.ttf") dimTextStyle.WidthFactor = 1.0 model.TextStyles.Add(dimTextStyle) Dim dimStyle As New DxfDimensionStyle(model, "RAD_GUY") dimStyle.TextMovement = TextMovement.MoveLineWithText dimStyle.TextStyle = dimTextStyle dimStyle.ScaleFactor = 16 dimStyle.TextOutsideHorizontal = False dimStyle.TextAboveDimensionLine = True dimStyle.TextInsideHorizontal = False dimStyle.TextAlignment = TextAlignment.Centered dimStyle.TextColor = Colors.ByLayer dimStyle.DimensionLineColor = Colors.ByLayer dimStyle.LinearUnitFormat = LinearUnitFormat.Fractional dimStyle.DecimalPlaces = 6 dimStyle.AlternateUnitFormat = AlternateUnitFormat.FractionalStacked dimStyle.AlternateUnitDecimalPlaces = 0 dimStyle.AlternateDimensioningSuffix = String.Empty dimStyle.DimensionLineExtension = 0.0625 dimStyle.DimensionLineGap = 0.0625 dimStyle.DimensionLineIncrement = 0.375 dimStyle.ExtensionLineColor = Colors.ByLayer dimStyle.ExtensionLineExtension = 0.0938 dimStyle.ExtensionLineOffset = 0.0938 dimStyle.PostFix = """ RAD." dimStyle.SeparateArrowBlocks = True dimStyle.TextHeight = 0.09375 dimStyle.ToleranceDecimalPlaces = 6 model.DimensionStyles.Add(dimStyle) Dim d As New DxfDimension.Radial(dimStyle) d.Text = "33 1/2"" RO RAD" d.UseTextMiddlePoint = True d.TextMiddlePoint = New Point3D(-0.5, 33.5, 0) d.ArcLineIntersectionPoint = New Point3D(9.665476, 23.3345242, 0) d.Center = New Point3D(33.0, 0, 0) d.Layer = dimLayer model.Entities.Add(d) d.GenerateBlock()
Model is just a DxfModel object that is passed in to this function.
Wout
3/10/2014 11:05 PM
Thank you for the code snippet. I've fixed the problem with the text style and improved the dimension line positioning. There's probably a little more refinement needed, but I think it should be a lot more usable now. I've uploaded a new CadLib 4.0 version, so feel free to try it out. - Wout
Joe B
3/14/2014 12:52 PM
Got the latest CadLib 4.0 and this looks to be working much better now. Thanks for the help.
1