绘图反应堆的修改
大家好,我有AlanJ Thompson的Lisp程序,其中包括LeeMac的plot反应堆,它的功能非常出色。
;Based on PageSetups from Alan J. Thompson
(defun c:A3 ()
(command "_.-layer" "_LW" "0.13" "CCC_LAYOUT_Dimensions" "")
(PlotReactorOFF)
(if (findfile "T:/Drawing Tools/Templates/CCC2009.dwt")
(progn
(command "_.psetupin" (findfile "T:/Drawing Tools/Templates/CCC2009.dwt") "A3")
(while (wcmatch (getvar "cmdnames") "*PSETUPIN*")
(command "_yes")
) ;_ while
T
) ;_ progn
) ;_ if
(command "-plot" "n" "" "A3" "" "n" "y" "n")
(command "_-purge" "a" "*" "N")
(setq CCC_Sheet "A3")
(command "updatefield" "all" "")
(command "regenall")
(command "_zoom" "e")
(initdia)
(command "._plot")
(PlotReactorON)
;(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun PlotReactorON nil
(vl-load-com)
;; © Lee Mac 2010
((lambda ( data foo / react )
(if (setq react
(vl-some
(function
(lambda ( reactor )
(if (eq data (vlr-data reactor)) reactor)
)
)
(cdar
(vlr-reactors :vlr-command-reactor)
)
)
)
(if (not (vlr-added-p react))
(vlr-add react)
)
(setq react
(vlr-command-reactor data
(list
(cons :vlr-commandwillstart foo)
)
)
)
)
(if (vlr-added-p react)
(princ "\n** Reactor Activated **")
(princ "\n** Reactor Failed to Activate **")
)
react
)
"Plot-Reactor"
'Plot-Callback
)
(princ)
)
(defun PlotReactorOFF nil
(vl-load-com)
;; © Lee Mac 2010
((lambda ( data foo / react )
(if (setq react
(vl-some
(function
(lambda ( reactor )
(if (eq data (vlr-data reactor)) reactor)
)
)
(cdar
(vlr-reactors :vlr-command-reactor)
)
)
)
(if (vlr-added-p react)
(vlr-remove react)
)
)
(if (or (not react) (not (vlr-added-p react)))
(princ "\n** Reactor Deactivated **")
(princ "\n** Reactor Failed to Deactivate **")
)
react
)
"Plot-Reactor"
'Plot-Callback
)
(princ)
)
(defun Plot-Callback ( reactor arguments )
(vl-load-com)
(if (eq (strcase (car arguments)) "PLOT")
(LM:Popup "Warning" 64 "Gotcha!!! Please use the NNRDO Plot tools when plotting standard layouts!!")
)
(princ)
)
(defun LM:Popup ( title flags msg / WSHShell result )
;; © Lee Mac 2010
(setq WSHShell (vlax-create-object "WScript.Shell"))
(setq result (vlax-invoke WSHShell 'Popup msg 0 title flags))
(vlax-release-object WSHShell)
result
)
但是,我想修改它以执行以下操作。我在我们的标准模板中选中了“使用图纸空间单位进行缩放”框,这是我需要的服务图纸。然而,这使得衬砌图纸在打印时看起来是错误的,因为道路衬砌的破折号显得太短。
我希望能够测试块“CCC\u Drawing\u Types”中的属性TAGD2是否设置为LS,然后检查是否选中“使用图纸空间单位进行缩放”。如果是这样,调用一个对话框,告诉用户取消选中它,然后启动LT对话框,当用户单击“确定”以继续打印窗口时。
我知道听起来我的想法已经整理好了,但我不知道从哪里开始。我找到了李的一个Lisp程序的Lisp程序的地方,从一个方块中提取了一个阁楼,但我不知道如何合并它。
(defun c:sk (/ dxf ent)
(defun dxf (code ent) (cdr (assoc code (entget ent))))
(if (and (setq ent (car (entsel "\nSelect an Attributed Block: ")))
(eq "INSERT" (dxf 0 ent))
(= 1 (dxf 66 ent)))
(while (not (eq "SEQEND" (dxf 0 (setq ent (entnext ent)))))
(princ (strcat "\n\nAtt_Tag:" (dxf 2 ent) "\nAtt_Value: " (dxf 1 ent)))))
(princ))
如果能在这方面得到任何帮助,我将不胜感激。
页:
[1]