做Autocad二次开发(VBA语言)的大侠帮忙写段小程序!!!

2024年11月22日 09:31
有1个网友回答
网友(1):

Dim allEnt As AcadEntity
Dim CONEnt As AcadEntity
Dim HIDEnt As AcadEntity

For Each allEnt In ThisDrawing.ModelSpace

If allEnt.Linetype = "CONTINUOUS" Then
Set CONEnt = allEnt
CONEnt.Layer = "0"
CONEnt.TrueColor.ColorIndex = acByLayer
CONEnt.Lineweight=acLnWtByLayer
End If

If allEnt.Linetype = "HIDDEN" Then
Set HIDEnt = allEnt
HIDEnt.Layer = "4"
HIDEnt.TrueColor.ColorIndex = acByLayer
HIDEnt.Lineweight=acLnWtByLayer
End If

Next allEnt