乐筑天下

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

[编程交流] Lisp Won't Continue to Ne

[复制链接]

11

主题

968

帖子

919

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
99
发表于 2022-7-6 09:40:41 | 显示全部楼层
I'm actually not too sure why you need the ssget in the first place. The only time that is "necessary" is when you do something like in Tharwat's code.
 
Why not simply have:
  1. (command "._ERASE" "_All" "_Remove")
回复

使用道具 举报

55

主题

325

帖子

274

银币

后起之秀

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

铜币
280
发表于 2022-7-6 09:44:18 | 显示全部楼层
  1. (command "._ERASE" "_All" "_Remove")
 
Will this get everything inside the drawings the same as (ssget"x")?  I am trying to rid the drawing of any invisible items that are hanging out in la la land.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-6 09:48:32 | 显示全部楼层
What are your plans to do specifically ?
回复

使用道具 举报

55

主题

325

帖子

274

银币

后起之秀

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

铜币
280
发表于 2022-7-6 09:51:14 | 显示全部楼层
I have to prepare my drawing files to post to an ftp site for a project I am working on.  I am trying to strip them down to only show our piping.  Sometimes some of the guys in our office have miscellaneous items that are way beyond the boundaries of the building that do not need to be shared for our coordination with other subcontractors.  Sometimes I can see those items, and sometimes they are left over points or nodes that I can't see.  With these invisible objects outside the building area, people are not able to do a zoom extents and get only the building.  It is a smaller scale version of it.  It is also messing up the files that we are using inside Navisworks and Revit.  That is why I need to find a way to grab all of these items and delete them from our drawings before we post them.  Hopefully this helps.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 09:54:35 | 显示全部楼层
If that is your goal, then why not simplify the process and use the WBLOCK command instead?
回复

使用道具 举报

55

主题

325

帖子

274

银币

后起之秀

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

铜币
280
发表于 2022-7-6 09:56:23 | 显示全部楼层
Quite honestly.....I never thought of doing it that way.  I may give that a try.  Thanks for the suggestion.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

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

铜币
358
发表于 2022-7-6 09:59:07 | 显示全部楼层
 
It's been the best choice for lots of users nowadays all over this forum.
回复

使用道具 举报

11

主题

968

帖子

919

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
99
发表于 2022-7-6 10:04:35 | 显示全部楼层
I'd actually say "nowadays" is being a bit obtuse. I remember the first time someone told be to use it to cleanup drawings: must be nearly 20 years ago! 
Anyhow, to ksperopoulos: You're using 2011 right? Have you looked at the command-line version of -purge (note the minus sign in front)? There's an option to purge Zero length entities and empty text. Even using erase all (which does what you're after) or even wblock will still leave some stuff like a line with length of 0.0.
 
Actually my boss has asked me to list everything which needs to be done as and when we receive drawings from outside. In this week, can you believe how deja-vu that felt? Well, under the list of "cleaning the drawing" I had the following (for our case in particular):
 


  • Remap other Consultants’ XRefs: If the issued drawing has XRefs from other consultants, this needs to be remapped to that current version (instead of the one which came with the issue). Also the cross-consultant XRef must not be saved as current anywhere. E.g. say a mechanical drawing XRefs an architectural plan, the architectural plan in the issue must not be saved to either the ME folder, nor to the AR folder. But the ME’s drawing needs to be modified so its XRef points to the current version of that file under the AR folder (or one of its sub-folders). This XRef has to be changed to an Overlay, if not already done so.
  • XRefs: Some files may have several XRefs contained in them. These XRefs need to be saved into the same (base) consultant’s folder where the issued drawing number is saved. The XRef needs to be re-mapped if not already working thus. Easiest way would be to modify the XRef path in the reference manager to omit the prefixed folder path. I.e. only having the filename and no folder path at all. All these XRef files also need to be cleaned through this same set of procedures.
  • Remove Architectural portions: If the consultant’s drawing contains a bound / inserted / exploded / copied version of the architectural drawing, this needs to be erased. If this cannot be easily done through isolating layers (or otherwise), then the consultant needs to be informed to issue such that this is possible. Note some form of correlation needs to be kept for referencing & positioning purposes. Usually the grid would be perfect for such. Change the layer of whatever’s used for such to be NoPlot … thus allowing for it to be seen but not printed when xrefed into one of our drawings.
  • Convert Vertical Objects: Not referring to objects going “upward”, but rather vertical products of AutoCAD such as Mechanical/MEP/Civil/Architecture/etc. These objects cause problems when mixing different versions, causing slowdowns (if not outright crashes) in any drawing they’ve touched (being xrefed into one, using any type of copy / insert from such, etc.). If we have a copy of such vertical (e.g. Architecture) these contain a command ExportToAutoCAD which converts such complex objects to normal AutoCAD entities. If we do not have the relevant vertical product (e.g. Mechanical Desktop), then the standard AutoCAD has an AECtoACAD command, though it would be much more bullet-proof to have the consultant use his vertical and run ExportToAutoCAD.
  • Set All to ByLayer: Everything inside the drawing needs to be set to ByLayer (at least colour, but preferably also line types, line weights and pen styles). The standard AutoCAD command SetByLayer can be used for this.
  • Change Z-Values: If the drawing is meant to be 2D, then all entities need to be modified so they don’t contain different Z values (note some drawings do have benefit as 3D, e.g. site contours for import to Revit). All Z values to be changed to 0.0. Either do this through the properties palette, or use one of the numerous lisp utilities available on the web.
  • Erase all Non-selectable: Some entities may be empty / blank / erroneous. To remove such turn all layers on, thaw & unlock. Zoom extents. Start the Erase command, type All to select everything, type R and select over everything by crossing from right-to-left to remove the selectable items. Press enter to have the non-selectable entities erased. Repeat this for each tab in the drawing, not just the Model tab. After this issue the LayerP command to reset the layer settings to original.
  • Purge Zero/Empty: With newer versions of AutoCAD the command-line version of purge (prefix with minus/hyphen: -PURGE) has 2 new options: “Zero-length geometry” and “Empty text objects”. These may be used as well as the above erase all non-selectable as they complement each other.
  • Purge Registered Applications: This can only be done through the command-line version of purge. Prefic the purge command with a minus/hyphen thus: -PURGE Then use the RegApps option to get rid of any such space- & speed hogging data. This may need to be repeated after performing the normal Purge and Audit.
  • Purge: All non-referenced blocks, text styles, line types, dimension styles, etc. needs to be purged out of the drawing. For this the normal Purge command is sufficient, but may also be done through the command-line version by prefixing a minus/hyphen to the purge command: -PURGE and then using the All option. Though such needs to be done until all nested items are also purged. This purge may need to be repeated after some of the following cleanups have been performed. It may become more efficient to do the purge as the last cleanup in the drawing.
  • Audit/Recover: Perform an Audit on the drawing, if this fails open the drawing through recover. Newer versions have a new command RecoverAll which will recover the DWG and all its XRefs. If this still does not fix all errors, then perform a WBlock of the drawing and select the “Entire drawing” option in the Write Block dialog box. Replace the DWG file with the new DWG created from WBlock.

That's as comprehensive as I could think of at the time.
回复

使用道具 举报

55

主题

325

帖子

274

银币

后起之秀

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

铜币
280
发表于 2022-7-6 10:06:59 | 显示全部楼层
  1. (command "._ERASE" "_All" "_Remove")
 
FYI - This doesn't allow me to proceed to the next command in the lisp routine either.
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:07:55 | 显示全部楼层
 
That has already been (partially) explained, see post #8.
 
Furthermore, you're beating a dead horse... what happened to trying WBLOCK?
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 05:28 , Processed in 0.332824 second(s), 70 queries .

© 2020-2025 乐筑天下

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