您可以为创建的对象指定线型比例。 比例越小,每个绘图单元生成的图案重复次数就越多。默认情况下,AutoCAD 使用全局线型比例 1.0,它等于一个图形单位。您可以更改所有图形对象、属性参照和组的线型比例。 若要更改线型刻度,请使用该属性。LinetypeScale AutoCAD CELTSCALE 系统变量为新创建的对象设置线型比例。LTSCALE 全局更改现有对象和新对象的线型比例。要使用 AutoCAD ActiveX Automation 更改系统变量的值,请使用该方法。SetVariable 更改圆的线型比例Sub Ch4_ChangeLinetypeScale()
' Save the current linetype
Set currLineType = ThisDrawing.ActiveLinetype
' Change the active linetype to Border, so the scale change will
' be visible.
' First see if the Border linetype is already loaded
On Error Resume Next 'Turn on error trapping
ThisDrawing.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 If
On Error GoTo 0 ' Turn off error trapping
' Create a circle object in model space
Dim center(0 To 2) As Double
Dim radius As Double
Dim circleObj As AcadCircle
center(0) = 2
center(1) = 2
center(2) = 0
radius = 4
Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
circleObj.Update
MsgBox ("Here is the circle with the original linetype")
' Set the linetype scale of a circle to 3
circleObj.LinetypeScale = 3#
circleObj.Update
MsgBox ("Here is the circle with the new linetype")
' Restore original active linetype
ThisDrawing.ActiveLinetype = currLineType
End Sub
相关概念父主题: |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-29 05:55
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.