乐筑天下

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

[编程交流] acad-push-dbmod in script

[复制链接]

1

主题

2

帖子

0

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 17:24:46 | 显示全部楼层 |阅读模式
So I'm having a small problem at the junction of LISP, VBA, scripting and (acad-push-dbmod).
 
My company makes heavy use of scripting, through a external application that creates a script file to apply to multiple drawings. This is used to make large sections of drawing package, change revision levels and plot packets. I have been given the task of making a uniform, base set of the template files that our application uses. The more complex tasks have actually been fairly simple for me to standardize.
 
At this present time, I'm trying to deal with our plot templates. I want it to open the drawing, plot the drawing, and then close it without saving. But it needs to work in both MDI and SDI mode.
 
Following is a sample output script file. We already have (acad-pop-dbmod) in our standard acad2004doc.lsp file. When I execute this script by copying and pasting it into my command window, it runs flawlessly. However, when I attempt to run this .scr via the script command, it fails out, asking if I want to discard my changes on the first drawing.  
 
Included are two custom lisp defined commands, which are vbarun calls to VBA macros. The first, 1w11 is an intelligent and automated plot command which requires no user input. It alters the page layout and plots the drawing. In addition to the call from acad2004.doc, this macro beings with
  1. activedocument.sendcommand "(acad-pop-dbmod) "
and ends with
  1. activedocument.sendcommand "(acad-push-dbmod) "
the much simpler closemdi is included after the script code.
 
  1. open"C:\Documents and Settings\sseyler\Local Settings\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Template\ANSI B TITLE BLOCK.DWG"(acad-push-dbmod)1w11closemdiopen"C:\Documents and Settings\sseyler\Local Settings\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Template\ANSI C TITLE BLOCK.DWG"(acad-push-dbmod)1w11closemdiopen"C:\Documents and Settings\sseyler\Local Settings\Application Data\Autodesk\AutoCAD 2004\R16.0\enu\Template\ANSI D TITLE BLOCK.DWG"(acad-push-dbmod)1w11closemdi
closemdi:
  1. Sub CloseMDI()   If Not Application.Preferences.System.SingleDocumentMode Then       If Documents.Count > 1 Then           ActiveDocument.Close False           For Each Ite In Documents               Ite.Activate               Exit For           Next       End If   Else       'MsgBox "SDI"       'ActiveDocument.SendCommand "(acad-pop-dbmod) "   End IfEnd Sub
 
So, would anyone here have any ideas as to why this works by hand but not in script? Or more directly, a way to put 0 on the stack so that (acad-pop-dbmod) will ALWAYS clear the saved state of a drawing?
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-4 17:12 , Processed in 0.408976 second(s), 54 queries .

© 2020-2025 乐筑天下

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