Specify Linetype Scale
From AutoCAD ActiveX
You can specify the linetype scale for objects you create. The smaller the scale, the more repetitions of the pattern are generated per drawing unit. By default, AutoCAD uses a global linetype scale of 1.0, which is equal to one drawing unit. You can change the linetype scale for all drawing objects, attribute references, and groups.
To change the linetype scale, use the LinetypeScale property.
The CELTSCALE system variable sets the linetype scale for newly created objects. LTSCALE globally changes the linetype scale of existing objects as well as new objects. To change the values of system variables using AutoCAD ActiveX Automation, use the SetVariable method.
For more information about linetype scales, see “Control Linetype Scale” in the User's Guide.
Change the linetype scale for a circle
Sub Ch4_ChangeLinetypeScale()
' Save the current linetypeSet currLineType = ThisDrawing.ActiveLinetype' Change the active linetype to Border, so the scale change will' be visible.' First see if the Border linetype is already loadedOn Error Resume Next 'Turn on error trappingThisDrawing.ActiveLinetype = ThisDrawing.Linetypes.Item("BORDER")If Err.Number = -2145386476 Then' Error indicates linetype is not currently loaded, so load it.ThisDrawing.Linetypes.Load "BORDER", "acad.lin"ThisDrawing.ActiveLinetype = _ThisDrawing.Linetypes.Item("BORDER")End IfOn Error GoTo 0 'Turn off error trapping' Create a circle object in model spaceDim center(0 To 2) As DoubleDim radius As DoubleDim circleObj As AcadCirclecenter(0) = 2center(1) = 2center(2) = 0radius = 4Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)circleObj.UpdateMsgBox ("Here is the circle with the original linetype")' Set the linetype scale of a circle to 3circleObj.LinetypeScale = 3#circleObj.UpdateMsgBox ("Here is the circle with the new linetype")' Restore original active linetypeThisDrawing.ActiveLinetype = currLineTypeEnd Sub