乐筑天下

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

[编程交流] Scaling dwg from 1:100 to 1:50

[复制链接]

11

主题

117

帖子

133

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 11:54:06 | 显示全部楼层 |阅读模式
Does anybody know if there's an easy way to scale a drawing from 1:100 to 1:50 while the background xref stays the same scale?  The basepoint of each blocks/text/... will have to be the same, so "scale" command will not work as it will just "shrink" the drawing.  I know I'll probably have to shift a few things after the change.
The problem I have is I have a about ten 1:100 drawings and need to do MANY detail layouts of different rooms in 1:50 scale on each drawing.  Everything is already drawn in 1:100 scale and I need to make it 1:50 scale.  
Another problem I see is that the blocks are in scale=2 while the text is in 200mm height, so not exactly straight forward.
 
So basically I need to scale the whole drawing down while keeping the basepoints of all the blocks/text/leaders/lines,etc the same.  Please help.
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 11:57:43 | 显示全部楼层
Can't you use viewports with different scale factors?
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

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

铜币
438
发表于 2022-7-6 12:01:57 | 显示全部楼层
 
Would def. make life a lot easier.
回复

使用道具 举报

11

主题

117

帖子

133

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 12:04:21 | 显示全部楼层
Haaa, I wish it was that simple.  Our company standard has certain size of block/text/arrow size/etc.  So if I just use the viewport, everything will be double in size.
回复

使用道具 举报

8

主题

1647

帖子

1647

银币

初来乍到

Rank: 1

铜币
36
发表于 2022-7-6 12:08:38 | 显示全部楼层
 
I don't know if you created these drawings, or if you inherited them, but this is a perfect example of why you should Always draw at 1:1. :wink:
回复

使用道具 举报

11

主题

117

帖子

133

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 12:13:07 | 显示全部楼层
Actually, this is a floor plan with electrical symbols.  So can't really draw 1:1.  If it was a detail of an equpiment, then yes always 1:1.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:14:31 | 显示全部楼层
Written quickly, just an idea really, may need more filters:
 
  1. (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg)   (and uF (vla-EndUndoMark doc))   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")       (princ (strcat "\n** Error: " msg " **")))   (princ)) (setq blks (vla-get-Blocks              (setq doc (vla-get-ActiveDocument                          (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L"))   (progn     (setq uF (not (vla-StartUndoMark doc)))     (while (setq ent (ssname ss (setq i (1+ i))))       (setq obj (vlax-ename->vla-object ent))       (cond (  (eq "INSERT" (cdr (assoc 0 (entget ent))))                (if (not (eq :vlax-true                           (vla-get-isXRef                             (vla-item blks (vla-get-Name obj)))))                                    (vla-ScaleEntity obj                    (vla-get-InsertionPoint obj) scl)))             (  (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT")                (vla-ScaleEntity obj                  (vlax-get-property obj                    (if (eq "AcDbText" (vla-get-ObjectName obj))                      (if (eq acAlignmentLeft (vla-get-Alignment obj))                            'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl))             (t (vla-getBoundingBox obj 'Mi 'Ma)                (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma)))                (vla-ScaleEntity obj                  (vlax-3D-point                    (polar (car ptLst)                              (apply (function angle)    ptLst)                           (/ (apply (function distance) ptLst) 2.))) scl))))          (setq UF (vla-EndUndoMark doc))))  (princ))                           
回复

使用道具 举报

11

主题

117

帖子

133

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
52
发表于 2022-7-6 12:18:06 | 显示全部楼层
Wow Lee, thanks so much.  That seems to do the trick for the most part.  The only thing I notice is the arrows gets screw up.  The leader lines changes somehow.  Also, can the arrow head size be scaled by the same factor?  You are the best!
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 12:22:19 | 显示全部楼层
Might have to just add a filter for them in the COND statement, and do them another way.
 
  1. (defun c:sclAll (/ *error* BLKS DOC ENT I MA MI OBJ PTLST SCL SS UF) (vl-load-com) (defun *error* (msg)   (and uF (vla-EndUndoMark doc))   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")       (princ (strcat "\n** Error: " msg " **")))   (princ)) (setq blks (vla-get-Blocks              (setq doc (vla-get-ActiveDocument                          (vlax-get-acad-object))))) (initget 7) (setq scl (getreal "\nSpecify Scale Factor: ")) (if (setq i -1 ss (ssget "_:L"))   (progn     (setq uF (not (vla-StartUndoMark doc)))     (while (setq ent (ssname ss (setq i (1+ i))))       (setq obj (vlax-ename->vla-object ent))       (cond (  (eq "INSERT" (cdr (assoc 0 (entget ent))))                (if (not (eq :vlax-true                           (vla-get-isXRef                             (vla-item blks (vla-get-Name obj)))))                                    (vla-ScaleEntity obj                    (vla-get-InsertionPoint obj) scl)))             (  (wcmatch (cdr (assoc 0 (entget ent))) "*LEADER"))             (  (wcmatch (cdr (assoc 0 (entget ent))) "*TEXT")                (vla-ScaleEntity obj                  (vlax-get-property obj                    (if (eq "AcDbText" (vla-get-ObjectName obj))                      (if (eq acAlignmentLeft (vla-get-Alignment obj))                            'InsertionPoint 'TextAlignmentPoint) 'InsertionPoint)) scl))             (t (vla-getBoundingBox obj 'Mi 'Ma)                (setq ptLst (mapcar (function vlax-safearray->list) (list Mi Ma)))                (vla-ScaleEntity obj                  (vlax-3D-point                    (polar (car ptLst)                              (apply (function angle)    ptLst)                           (/ (apply (function distance) ptLst) 2.))) scl))))          (setq UF (vla-EndUndoMark doc))))  (princ))
回复

使用道具 举报

41

主题

301

帖子

265

银币

后起之秀

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

铜币
209
发表于 2022-7-6 12:24:30 | 显示全部楼层
 
Annatotive?
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 10:21 , Processed in 0.491511 second(s), 72 queries .

© 2020-2025 乐筑天下

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