明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 629|回复: 3

想在一个块中画封闭线,在封闭属性上运行出错

[复制链接]
发表于 2015-9-22 22:15:47 | 显示全部楼层 |阅读模式
想在一个块中画封闭线,在封闭属性上运行出错,具体如下:

Sub kk()
  Dim basep(0 To 2) As Double '块基点
  Dim blockunit As AcadBlock
  Dim pnts(0 To 7) As Double

  basep(0) = 0
  basep(1) = 0
  Set blockunit = ThisDrawing.Blocks.Add(basep, "Unit")
  pnts(0) = 0: pnts(1) = 0
   pnts(2) = 0: pnts(3) = 100
   pnts(4) = 100: pnts(5) = 100
   pnts(6) = 100: pnts(7) = 0

  Call blockunit.AddLightWeightPolyline(pnts)
    blockunit.Closed = True    ‘’‘调试发现封闭在块中不能这么用,运行出错,改成AddLightWeightPolyline(pnts).Closed = True也不行,,这里求指教,谢谢!
  End Sub

发表于 2015-9-22 23:11:14 | 显示全部楼层
Sub kk()
  Dim basep(0 To 2) As Double '块基点
  Dim blockunit As AcadBlock
  Dim pnts(0 To 7) As Double

  basep(0) = 0
  basep(1) = 0
  Set blockunit = ThisDrawing.Blocks.Add(basep, "Unit")
  pnts(0) = 0: pnts(1) = 0
   pnts(2) = 0: pnts(3) = 100
   pnts(4) = 100: pnts(5) = 100
   pnts(6) = 100: pnts(7) = 0
Dim objPl As AcadLWPolyline
  Set objPl = blockunit.AddLightWeightPolyline(pnts)
    objPl.Closed = True
  End Sub
 楼主| 发表于 2015-9-29 16:01:51 | 显示全部楼层
zzyong00 发表于 2015-9-22 23:11
Sub kk()
  Dim basep(0 To 2) As Double '块基点
  Dim blockunit As AcadBlock

谢谢老大,搞定了^_^
 楼主| 发表于 2015-9-29 17:53:09 | 显示全部楼层
本帖最后由 baneit319 于 2015-10-1 22:42 编辑
zzyong00 发表于 2015-9-22 23:11
Sub kk()
  Dim basep(0 To 2) As Double '块基点
  Dim blockunit As AcadBlock


谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-25 10:07 , Processed in 0.172981 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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