默认情况下,对象将继承创建它们的图层的线型。 若要更改对象的线型,请使用为该对象提供的属性。该属性采用要分配给对象的线型的名称作为输入。LinetypeLinetype 注意:在将线型指定给对象之前,必须将线型加载到当前图形中。若要将线型加载到图形中,请使用该方法。Load
更改圆的线型本示例创建一个圆圈。然后,它尝试从 acad.lin 文件加载线型“CENTER”。如果线型已存在,或者文件不存在,则会显示一条消息。最后,它将圆的线型设置为“CENTER”。 Sub Ch4_ChangeCircleLinetype() On Error Resume Next ' Create a circle Dim circleObj As AcadCircle Dim center(0 To 2) As Double Dim radius As Double center(0) = 2: center(1) = 2: center(2) = 0 radius = 1 Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius) Dim linetypeName As String linetypeName = "CENTER" ' Load "CENTER" line type from acad.lin file ThisDrawing.Linetypes.Load linetypeName, "acad.lin" If Err.Description <> "" Then MsgBox Err.Description ' Assign the circle the linetype "CENTER" circleObj.Linetype = "CENTER" circleObj.Update End Sub |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:13
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.