乐筑天下

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

[编程交流] ExportToAutocad: Stop Prompts

[复制链接]

1

主题

1

帖子

0

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 06:07:16 | 显示全部楼层 |阅读模式
I'm am attempting to export models from Plant 3D using ExportToAutoCAD. However, I don't want to be prompted as to whether I want to overwrite, I just want it to save these files out, whether the file exists or not.
 
My lisp skills are sorely lacking but I thought I might try this statement, but my syntax is incorrect:
 
((if(findfile DWGN2))(command "-EXPORTTOAUTOCAD" "2010" DWGN2 "y")(command "-EXPORTTOAUTOCAD" "2010" DWGN2))
 
What is the correct way to write this?
 
There is probably much better way to accomplish this task so any help would be much appreciated!
 
Thanks,
Mitch
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 06:57:33 | 显示全部楼层
Hi Mitch, and welcome to CADTutor.
 
Firstly, I would recommend that you read the Code Posting Guidlines, so that you know how to format code for future posts.
 
Now, regarding the code, assuming the variable DWGN2 contains a valid filename, I think:
 
  1. (if (findfile DWGN2)   (command "_.-exporttoautocad" "_F" "2010" "" DWGN2 "_Y")   (command "_.-exporttoautocad" "_F" "2010" "" DWGN2))
 
Note, however, that this doesn't allow for the case in which the filename already exists and is in use.
回复

使用道具 举报

16

主题

68

帖子

52

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
80
发表于 2022-7-6 07:20:15 | 显示全部楼层
Ok this works, but how to overwrite the file? (use same file name of the file that the lisp is used at)
 
This should be done using script so one could create new file with suffix or prefix, than close the file, delete original, rename new file to old file name and reopen it...
anybody knows how to script it?
and batch ...?
 
Oh, and more important of all,
how to prevent loss of page setups and named views when using the exporttoautocad command?!
The loss of above is bloody irritating....
 
this is what i use to avoid all the dialogs
 
  1. (command "-exporttoautocad" "_F" "2013" "_B" "N" "_T" "I" "_M" "N" "_P" "1_" "_S" "." "" "")
it produces the file in 2013 format, no xrefs binded, with 1_ prefix in file name.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 18:48 , Processed in 0.427350 second(s), 58 queries .

© 2020-2025 乐筑天下

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