乐筑天下

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

[编程交流] Re-ordering layout tabs?

[复制链接]

11

主题

35

帖子

28

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
53
发表于 2022-7-6 14:41:24 | 显示全部楼层 |阅读模式
Does anybody know of a custom or built in way to re-order the layout tabs?  I have a drawing with about 200 tabs in there (different site locations).  I like to keep them alphabetical so I can find then when needed.  Right now I have to drag the tab into it's proper place (which can be time consuming).  I'd like to be able to automatically alphabetize them.
 
In a somewhat related question, does anybody know how I could export all layout tabs (based on their current page setup) at once?  I would prefer if it dropped the suffix and prefix (BTW, can you change these?) from the file name.  The prefix is the drawing name and the suffix is the "(1)" it puts on there.  I'd love to not have to delete that every time I export it.
回复

使用道具 举报

0

主题

252

帖子

290

银币

限制会员

铜币
-8
发表于 2022-7-6 14:47:21 | 显示全部楼层
I think it can be done, I seem to remember doing that a long time ago.  Let me look through my code archive
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 14:50:47 | 显示全部楼层
Couldn't resist:
 
  1. [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] c:sortlay  [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] lst[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vlax-for[/color][/b] lay   [b][color=RED]([/color][/b][b][color=BLUE]vla-get-layouts[/color][/b]     [b][color=RED]([/color][/b][b][color=BLUE]vla-get-ActiveDocument[/color][/b]       [b][color=RED]([/color][/b][b][color=BLUE]vlax-get-acad-object[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]   [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] lst [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] lay lst[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] lst [b][color=RED]([/color][/b][b][color=BLUE]vl-remove-if[/color][/b]             [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]               [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]y[b][color=RED])[/color][/b]                 [b][color=RED]([/color][/b][b][color=BLUE]eq[/color][/b] [b][color=#ff00ff]"Model"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]vla-get-Name[/color][/b] y[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] lst[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b]   [b][color=RED]([/color][/b][b][color=BLUE]function[/color][/b]     [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b]x[b][color=RED])[/color][/b]       [b][color=RED]([/color][/b][b][color=BLUE]vla-put-TabOrder[/color][/b] x         [b][color=RED]([/color][/b][b][color=BLUE]1+[/color][/b]           [b][color=RED]([/color][/b][b][color=BLUE]vl-position[/color][/b]             [b][color=RED]([/color][/b][b][color=BLUE]vla-get-Name[/color][/b] x[b][color=RED])[/color][/b]               [b][color=RED]([/color][/b][b][color=BLUE]acad_strlsort[/color][/b]                 [b][color=RED]([/color][/b][b][color=BLUE]mapcar[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=BLUE]vla-get-Name[/color][/b] lst[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] lst[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b]
回复

使用道具 举报

11

主题

35

帖子

28

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
53
发表于 2022-7-6 14:53:03 | 显示全部楼层
I get an error when running that:
 
回复

使用道具 举报

4

主题

940

帖子

961

银币

初来乍到

Rank: 1

铜币
12
发表于 2022-7-6 14:58:50 | 显示全部楼层
add this near the top (or add it to your acaddoc.lsp file)
  1. (vl-load-com)
回复

使用道具 举报

11

主题

35

帖子

28

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
53
发表于 2022-7-6 15:01:45 | 显示全部楼层
thanks, that works great!  Have any of you ever seen a way to do the export question I had?
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:03:54 | 显示全部楼层
Sorry about that error Chris, I have (vl-load-com) in my ACADDOC.lsp, so I don't notice any problems if I have left it out - my apologies.
 
When you say "export" layout tabs, what exactly do you mean? I can easily modify the Layout tab names, but I am not sure exactly what you want done with them
回复

使用道具 举报

11

主题

35

帖子

28

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
53
发表于 2022-7-6 15:07:19 | 显示全部楼层
 
Well, I have hundreds of layouts in my drawing.  each one is named for the site they represent (these are well sites in a large field of hundreds of wells).  An example of the layout name might be:
 
"Echo_Springs_Federal_2_26"
 
I want to be able to export all the layout tabs in the drawing with only using the layout name to a defined workspace.  Currently when I export them to PDFs the default is:
 
drawingname layoutname "(1)"
 
I don't want the drawing name or the "(1)" appended to it.  I've been trying to find a setting to fix that but I can't.
 
any ideas?
 
I thought of writing a script to strip the drawing name and the "(1)" off there, but it won't work because Autocad puts those spaces in there.  And besides, I don't have the other part figured out either (to export them all at once).
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 15:12:03 | 显示全部楼层
Ok, I understand about the layout names, but how do you export them?
 
Excuse my AutoCAD ignorance, I am really only into the programming side and haven't actually used AutoCAD that much.
 
Lee
回复

使用道具 举报

11

主题

35

帖子

28

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
53
发表于 2022-7-6 15:16:40 | 显示全部楼层
I use the plot button/command and the name of the plotter is "Adobe PDF"
 
In case it matters, the properties on all layouts are the same (size, orientation, etc).  All those setting are saved within the layout though, so I doubt any of that would need to be included in any LISP.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-5 00:32 , Processed in 0.975297 second(s), 72 queries .

© 2020-2025 乐筑天下

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