乐筑天下

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

[综合讨论] How do I get 'copy'

[复制链接]

3

主题

12

帖子

9

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-7 00:08:26 | 显示全部楼层 |阅读模式
Hi, I'm a new poster currently trying to speed up the production of my pre-cast floor drawings.
 
What I want to do is to select a dynamic block (already inserted into the drawing) and press a button to insert a copy of it, a set distance away from the original. I then want the newly created block to be selected, so that I can press the button again, or press another button (set to another distance) to produce another copy; and so on.
 
I am struggling to get the new block to be selected at the end of the macro. I have tried using single selection, and Last; but the block does not stay selected.
 
Can anybody out there help please?
 
My current script is :  ^C^Ccopy;D;@0,521
 
Thanks
回复

使用道具 举报

JGA

1

主题

69

帖子

69

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-7 00:17:45 | 显示全部楼层
A script will be no use for this - it will have to be a macro assigned to a toolbar etc.
The above script will always copy the block to the same relative position - is this what you want?
Rather than try Last, use Previous.
回复

使用道具 举报

3

主题

12

帖子

9

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-7 00:26:02 | 显示全部楼层
Thanks for the reply.
 
This will be a macro assigned to a button on a toolbar.
 
The blocks represent pre-cast concrete floor units which go in at regular spacings. Each unit is spaced a set distance from the last one inserted. There are 3 standard spacings (525, 300, or 128 so I will have 3 buttons.
 
So, I want to select a block, press a button to insert a copy, say 525 away; then have the new block already selected, so that I can then insert another new block by pressing a button, say 525 (or 300 or 128 away from that one.
 
At the moment I have to select, press button, select new unit, press button... etc.
回复

使用道具 举报

JGA

1

主题

69

帖子

69

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-7 00:28:01 | 显示全部楼层
Would an array (acad 2012) or dynamic block be worth while option to look at?
回复

使用道具 举报

3

主题

12

帖子

9

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-7 00:34:29 | 显示全部楼层
The block being inserted is a dynamic block, which is usually exactly the same as the first, but often will require the length being changed, and then copying can continue.
 
I do use arrays; but when there are restrictions as to where the blocks can be placed, this can be counterproductive. Sometimes it is quicker to insert the blocks individually to avoid columns, or drainage penetrations.
 
Hence the requirement to select a unit, then copy, copy, copy, copy, without reselecting every time.
回复

使用道具 举报

JGA

1

主题

69

帖子

69

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-7 00:40:21 | 显示全部楼层
See if this works for you; I used a toolpallete to work on (saves reloading the CUI file with each tweak).
This could be done with more finesse with LISP, but we work with LT.
Best I can come up with for you. Hope it helps.
 
^C^C_.Copymode;1;_.Copy;L;;D;1000,0;_.Copymode;0
 
Break down;-
Cancel all current or previous commands
Copymode set to single copy
Copy command starts, picks last object
D (displacement) sets the last point picked as the co-ords to copy from
Copies the object by 1000 (x) & 0 (y)
Resets copymode back to multiple.
回复

使用道具 举报

3

主题

12

帖子

9

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-7 00:46:34 | 显示全部楼层
Many thanks for your help JGA. It's a step closer to what I am trying to achieve. It will certainly help until I can get things as I'd really like them.
 
It does work, but not quite as I had intended. The problem is that if I add a dimension or any other object, the 'Last' selects that object, rather than the block I wish to start copying from.
 
Ideally I would select first, then copy, copy, copy etc.
回复

使用道具 举报

JGA

1

主题

69

帖子

69

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-7 00:52:54 | 显示全部楼层
^C^C_.Copymode;1;_.Copy;/;;D;1000,0;_.Copymode;0
回复

使用道具 举报

3

主题

12

帖子

9

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-7 01:02:19 | 显示全部楼层
That doesn't seem to work.
回复

使用道具 举报

3

主题

12

帖子

9

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-7 01:06:59 | 显示全部楼层
Hi JGA
 
I've modified your code and I think it's solved the problem.
 
The new code is
 
^C^C_.Copymode;1;_.Copy;P;;D;0,525;select;L;;_.Copymode;0
 
So I select my block, run the macro which copies the block (using previous),then selects the new block using 'Last', which is then re-selected when I run the macro again. I think...
 
Thanks again, so far so good.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-9 22:02 , Processed in 0.379893 second(s), 72 queries .

© 2020-2025 乐筑天下

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