乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 13|回复: 2

[编程交流] Insert and explode a block - w

[复制链接]

77

主题

298

帖子

232

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
394
发表于 2022-7-6 08:39:48 | 显示全部楼层 |阅读模式
Hey guys,
 
Ive got this routine ive been working on - to draw a squiggly boundary around enlarged details... but im having trouble getting the block to insert and explode with the polyline being left as a result.
 
Im sure im overlooking something pretty simple... any help and advice would be greatly appreciated.
 
  1. (defun C:sdb (/ PT1 PT2 Xdist Ydist)  (setvar "cmdecho" 0)  (setq PT1 (GETPOINT "\nPick Insertion Point (bottom left corner of detail)... "))  (setvar "orthomode" 0)  (setq PT2 (GETPOINT PT1 "\nPick point on opposite side of detail (top right corner of detail)... "))  (setvar "osmode" 0)  (setq Xdist (abs (- (car Pt1) (car Pt2))))  (setq Ydist (abs (- (cadr Pt1) (cadr Pt2))))  (COMMAND "INSERT" "sdb" PT1 Xdist Ydist "" "explode" "L")  (terpri))
 
is the code... the block DWG is attached.
 
What im finding is that when i insert the block (which contains a simple polyline) - it will be inserted as a BLOCK REFERENCE.  If i explode this BLOCK REFERENCE (after the insert command) im left with a bunch of lines (not a joined, closed polyline).  It seems there are 2 explodes being executed.
 
If i try to explode the block during the insert routine (ie "-insert" "*SDB")... then the scale factor is applied uniformly and the routine will not be executed correctly.
 
Hopefully there is a simple fix for this.
 
cheers.
 
SDB.DWG
回复

使用道具 举报

8

主题

1133

帖子

1164

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 09:18:14 | 显示全部楼层
I think that you are being banjaxed by AutoCAD.
 
If you insert and explode a block with equal scaling, then a polyline stays a polyline. If you insert a block with unequal scaling, then the polyline does NOT stay a polyline.  
 
You will have to add a bit to reconstitute your polyline.
回复

使用道具 举报

77

主题

298

帖子

232

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
394
发表于 2022-7-6 10:09:02 | 显示全部楼层
hi eldon, thanks a lot for your reply.
 
so this is on of the rules of polyline/block inserting built into AutoCAD?
 
Thanks for the info - i shall pursue another avenue to achieve this.
 
Cheers.
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-7 08:54 , Processed in 0.675811 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表