明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1761|回复: 6

我想把Polyline转为LightWightPolyline,请版主赐教!

[复制链接]
发表于 2003-7-14 08:41:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2003-7-14 16:06:34 编辑

在CAD下List显示为Polyline,在VBA下显示为AcDbPolyFaceMesh,我想把它转为LightWightPolyline,有没办法,请版主赐教!
下面是DWG文件:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2003-7-14 23:27:00 | 显示全部楼层
先把plinetype参数的值改为2,然后重新画一条就可以了!
 楼主| 发表于 2003-7-15 08:19:00 | 显示全部楼层
但是线条太多了,全部重画代价太大,用VBA怎么实现?
发表于 2003-7-15 23:41:00 | 显示全部楼层
当然要用VBA实现,本站有教程,在CAD下载!里面有用VBA创建pline线的方法!
发表于 2003-7-15 23:50:00 | 显示全部楼层
这个程序给你参考一下!原来差不多多,唯一的区别就是我这里是变直线,但多段线也差不多,只是把二维变为三维!

Sub jczx() '加粗直线程序

Dim sset As AcadSelectionSet
Dim Ftype(0) As Integer
Dim Fdata(0) As Variant
Dim i As Integer
Dim entity As AcadEntity
Dim plineobj As AcadLWPolyline
Dim spnt As Variant
Dim epnt As Variant
Dim ver(0 To 3) As Double


Ftype(0) = 0
Fdata(0) = "Line"

For i = 0 To ThisDrawing.SelectionSets.Count - 1
ThisDrawing.SelectionSets.Item(i).Clear
ThisDrawing.SelectionSets.Item(i).Delete
Next

Set sset = ThisDrawing.SelectionSets.Add("linesset")
sset.SelectOnScreen Ftype, Fdata
For Each entity In sset
spnt = entity.StartPoint
epnt = entity.EndPoint
ver(0) = spnt(0): ver(1) = spnt(1)
ver(2) = epnt(0): ver(3) = epnt(1) '

Set plineobj = ThisDrawing.ModelSpace.AddLightWeightPolyline(ver)
plineobj.ConstantWidth = 0.5
entity.Delete
Next



End Sub
发表于 2003-7-22 15:17:00 | 显示全部楼层
试一试"convert"命令
发表于 2003-7-22 23:29:00 | 显示全部楼层
不错!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-9-29 06:40 , Processed in 0.161539 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表