做Autocad二次开发(VBA语言)的大侠帮忙写段小程序!!!
目的是一键修改两种线性:1,只要是CONTINUOUS线型,改为0粗实线层,颜色为,线型保持不变,线粗为2,只要是HIDDEN线型,改为4虚线层,颜色为,线型保持不变,线...
目的是一键修改两种线性:
1,只要是CONTINUOUS线型,改为0粗实线层,颜色为
,线型保持不变,线粗为
2,只要是HIDDEN线型,改为4虚线层,颜色为
,线型保持不变,线粗为
麻烦给写段VBA代码,谢谢! 展开
1,只要是CONTINUOUS线型,改为0粗实线层,颜色为
,线型保持不变,线粗为
2,只要是HIDDEN线型,改为4虚线层,颜色为
,线型保持不变,线粗为
麻烦给写段VBA代码,谢谢! 展开
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
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
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |