找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1513|回复: 4

[教学]:如何解决在ACAD里运行DOS命令闪黑屏幕的问题。

[复制链接]
发表于 2002-5-22 21:57:38 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
有时候我们还是可以用DOS命令来解决问题,比如建立目录,删除文件,查看目录列表等等,用默认的方式运行时总有闪屏,如何解决呢。

在ACAD。PGP里,这样解释:
没有英文兴趣的朋友可以不看英文部分,只看最后一点中文说明就行了。

command,executable,memory[,
  • prompt[,return_code]]

    command

    The command to enter at the Command prompt. If this name is an internal AutoCAD command name, it is ignored. The name is not case sensitive.

    executable

    This constant string is sent to the operating system when you enter the command name. It can be any command that you can execute at the operating-system prompt. The string can include switches or parameters. The case sensitivity of this string depends on your operating system and the application you are running.

    memory

    This field maintains compatibility with previous versions of AutoCAD. Although AutoCAD does not use the value in this field, a number (typically 0) must be present.

    prompt

    This field is optional. It specifies the prompt to display on the AutoCAD command line. The response to this prompt is appended to the string supplied in the executable field. If the first character of the prompt field is an asterisk (*), the response can contain spaces and the user must press ENTER to terminate it. Otherwise, the response is terminated by either SPACEBAR or ENTER. If no prompt is specified, no input is requested; however, you must add a comma if a return code is to be supplied or if a trailing space is required for the prompt.

    return_code

    This is an optional bit-coded parameter. You can add these integer values together in any combination to achieve the result you want. For example, if values 1 and 2 are required, you use 3 as the return code. The values are defined as follows (codes 0 and 4 are meaningless in a windowed environment and are therefore not included in this listing):
    1  Loads a DXB file. AutoCAD loads the DXB file named $cmd.dxb into the drawing after the command is terminated. After the DXB file is loaded, the $cmd.dxb file is deleted. This action produces the same result as the DXBIN command.

    2  Constructs a block definition from a DXB file. AutoCAD creates a block definition from the DXB file named $cmd.dxb. The response to the prompt field is used as the block name. This name must be a valid block name that does not currently exist in the drawing; therefore, this mode cannot redefine a previously defined block. After AutoCAD loads the DXB file, the $cmd.dxb file is deleted. The default name for the INSERT command is set to the newly defined block.

    The start and cmd Windows commands are very useful when defining external commands. If you specify an executable string that does not use the start or cmd commands, AutoCAD is unavailable until that window is closed.
    The start command starts a separate window and runs a specified program or command. If start is used without any parameters, it opens a new command prompt window. The start command has many command line switches that affect the display of the new window. Under NT 3.51, the /realtime switch forces the new window to be displayed on top of the AutoCAD graphics window (this is not necessary under Windows95 or NT 4.0). This is desirable if you are planning to enter commands at the Windows command prompt. To launch a Windows application, use start without any switches. The start command is also very useful for launching a document that is associated with an application. For example, you can use start to directly open a document created with a word processor or an HTML file.

    The cmd command opens a command prompt window that acts as a shell of AutoCAD. This window must be closed before control returns to the AutoCAD command prompt. Two command line switches are useful for external commands, /c and /k. The /c switch carries out the specified command and then stops (the window closes). The /k switch carries out the specified command and then continues (the window remains open). When using the /k switch, you must close the command window (with the exit command).

    In general, use start to launch a new window or application that is to be a separate process from AutoCAD. Use cmd to run a batch file or command script that does not create a separate window, or to create a window that must be closed before control is passed back to AutoCAD. For more information about these commands, see your Windows command documentation.
    The following example defines three new commands: RUN, LISTSET and DXB2BLK.

    RUN, cmd /c,0,*Batch file to run: ,
    LISTSET,cmd /k SET,0

    DXB2BLK,cmd /c DXBCOPY,0,DXB file: ,2

    The RUN command runs a batch file or command script. The cmd command followed by the /c switch opens a command window, runs the batch file, and then closes.
    The LISTSET command displays the current DOS environment variable settings. Because this example uses cmd /k rather than start, the command window must be closed before returning to AutoCAD. If you want this window to remain active, use start /realtime.
    The DXB2BLK command creates a block definition from the specified DXB file. The DXB file converts all objects into lines. One beneficial by-product of this procedure is that it provides a simple method for exploding text objects into lines.

    DXB2BLK passes the specified DXB file name to the dxbcopy batch file, which copies that file name to the file name $cmd.dxb. AutoCAD then creates a block from the specified DXB file. The name provided to the DXB file prompt is used as the new block name. To create the dxbcopy.cmd file, enter the following at a DOS prompt:

    echo copy %1.dxb $cmd.dxb > dxbcopy.cmd

    This creates the dxbcopy.cmd file in the current directory. Move this file to a directory that is in your DOS path, or explicitly specify the file's location in the acad.pgp file. For example, if the dxbcopy.cmd file is in D:/cad, enter the following in the external commands section of your acad.pgp file.

    DXB2BLK, cmd /c D:\CAD\DXBCOPY,0,DXB file: ,2

    To create a DXB file, choose AutoCAD DXB File Format as the current printer, then plot to a file. For more information about configuring printers, see chapter 2, "Setting Up AutoCAD," in the Installation Guide.

    第一个 command 当然是你希望运行的命令,
    第二个(参数)就是DOS命令,DOS命令可以是含参数的 比如DIR /B>C:1.TXT

    第三个参数是最重要的了,就是解决问题的核心,
    看下面的例子:
    SHELL,     ,               1,*OS Command: ,
    这是ACAD自带的,
    如果把1改成4,用REINIT重新初始化,结果会怎样呢?
    任何DOS命令都不会闪黑屏了
  • 论坛插件加载方法
    发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
    如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
    如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

    已领礼包: 3个

    财富等级: 恭喜发财

    发表于 2002-5-29 03:41:49 | 显示全部楼层
    不是很明白
    论坛插件加载方法
    发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
    如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
    如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
    回复 支持 反对

    使用道具 举报

    发表于 2005-4-23 16:49:52 | 显示全部楼层
    这是在PGP文件里,那如果直接运行SHELL命令呢??
    论坛插件加载方法
    发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
    如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
    如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
    回复 支持 反对

    使用道具 举报

    已领礼包: 1个

    财富等级: 恭喜发财

    发表于 2006-5-19 20:23:56 | 显示全部楼层
    直接运行还是不能解决。
    论坛插件加载方法
    发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
    如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
    如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
    回复 支持 反对

    使用道具 举报

    发表于 2006-5-24 18:42:32 | 显示全部楼层
    可以把系统自带的windows计算器引入cad。代替cad里的cal。
    论坛插件加载方法
    发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
    如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
    如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
    回复 支持 反对

    使用道具 举报

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

    本版积分规则

    QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

    GMT+8, 2025-9-29 09:37 , Processed in 0.171133 second(s), 38 queries , Gzip On.

    Powered by Discuz! X3.5

    © 2001-2025 Discuz! Team.

    快速回复 返回顶部 返回列表