GregGleason 发表于 2022-7-5 15:28:51

全部缩放-不起作用

所以在相当多的程序调用结束后打开一个绘图,在接近过程结束时,我做了一个。。。
 
(command "zoom" "a")(princ),但它不起作用。我在想,一路上发生了一些事情,让它没有反应。
 
有什么想法吗?
 
格雷格

Aftertouch 发表于 2022-7-5 15:42:09

你好
 
请张贴完整的代码,并记住。。。
打开另一个DWG时,lisp不会在该DWG中继续。
lisp文件依赖于DWG。

ReMark 发表于 2022-7-5 16:01:12

“lisp文件依赖于DWG。”嗯……嗯。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。这不取决于lisp例程的加载方式吗?Acad。lsp与阿卡多克。lsp?

GregGleason 发表于 2022-7-5 16:12:54

这是《阿卡多克》中的部分。lsp,缩放都在底部附近:
 
   (princ "\n\n   Start initializatons to dwg ...")   ; Note status
(command "undo" "9")                               ; Undo extra added stuff
(command "zoom" "a")(princ)                        ;_zoom all
(command "insunits" "1")(princ)                  ; drawing-units value set to "inch
(command "units" "4" "16" "2" "3" "0" "N")         ; change to architectural units
(princ)                                          ;
(princ "\n   Move BOM data to TEXT layer ...")   ; Note status
(setq mypath (getvar "dwgprefix"))               ; Read and set current directory path
(setq mylisp "SetWinToLayerTEXT.lsp")            ; Set the lisp routine name
(setq mypatlsp (strcat mypath mylisp))             ; Set the path/file of the lisp routine name
(load mypatlsp)                                    ; Load the lisp routine
(c:SetWinToLayerTEXT)                              ; Run the lisp routine
(princ "\n   Move Layer 0 data to FIC layer ..."); Note status
(setq mylisp "ChgLay0toFIC.lsp")                   ; Set the lisp routine name
(setq mypatlsp (strcat mypath mylisp))             ; Set the path/file of the lisp routine name
(load mypatlsp)                                    ; Load the lisp routine
(c:ChgLay0toFIC)                                 ; Run the lisp routine
(princ "\n   Find/move DIMLDR data to TEXT layer") ; Note status
(setq mylisp "DIMLDRtoTEXT.lsp")                   ; Set the lisp routine name
(setq mypatlsp (strcat mypath mylisp))             ; Set the path/file of the lisp routine name
(load mypatlsp)                                    ; Load the lisp routine
(c:DTT)                                          ; Run the lisp routine
(princ "\n   Explode all DIMLDR blocks      ")   ; Note status
(setq mylisp "ExplodeDimldrBlocks.lsp")            ; Set the lisp routine name
(setq mypatlsp (strcat mypath mylisp))             ; Set the path/file of the lisp routine name
(load mypatlsp)                                    ; Load the lisp routine
(c:EDB)                                          ; Run the lisp routine
(princ "\n   Delete all ATTDEF with large text")   ; Note status
(setq mylisp "DeleteBigText.lsp")                  ; Set the lisp routine name
(setq mypatlsp (strcat mypath mylisp))             ; Set the path/file of the lisp routine name
(load mypatlsp)                                    ; Load the lisp routine
(c:DBT)                                          ; Run the lisp routine
(princ "\n   Read Title Block Data and set ...."); Note status
(setq mylisp "UpdateTitleblockV1-9.lsp")         ; Set the lisp routine name
(setq mypatlsp (strcat mypath mylisp))             ; Set the path/file of the lisp routine name
;(load "P:\\CADWorx\\Project.Models\\Lyondell\\Piping.Iso\\UpdateTitleblockV1-9.lsp")
(load mypatlsp)                                    ; Load and autorun the lisp routine
(princ "\nAutoLISP Title Block file loaded.")      ; Note status
(command "zoom" "a")(princ)                        ;_zoom all
(princ "\n\n   ========================================\n\n")
(princ)Greg

BIGAL 发表于 2022-7-5 16:22:40

与后触摸类似,如果此(加载mypatlsp)或DBT使用OPEN,则lisp将停止。您需要一个脚本,该脚本可以跨多个dwg运行并调用lisp。解决不知道dwg名称的一个简单方法是,在使用第一阶段,使用正确的dwg名称编写脚本文件。然后简单(命令“SCRIPT”“ABCDEFG”)这将结束当前的lisp。

GregGleason 发表于 2022-7-5 16:29:14

 
这是一个已经打开的图形上的所有单个操作。
 
顺便说一句,它与扩展的历史相呼应,所以你可以看到它达到了代码,它只是不像通常那样处理代码。如果我将其放在代码的第一部分,而不是在图形上所有操作之后的后端,它确实可以工作。
 
格雷格
页: [1]
查看完整版本: 全部缩放-不起作用