乐筑天下

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

[编程交流] 绘图反应堆的修改

[复制链接]

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 07:10:24 | 显示全部楼层 |阅读模式
大家好,
我有AlanJ Thompson的Lisp程序,其中包括LeeMac的plot反应堆,它的功能非常出色。
 
  1. ;Based on PageSetups from Alan J. Thompson
  2. (defun c:A3 ()
  3. (command "_.-layer" "_LW" "0.13" "CCC_LAYOUT_Dimensions" "")
  4. (PlotReactorOFF)
  5. (if (findfile "T:/Drawing Tools/Templates/CCC2009.dwt")
  6.    (progn
  7.      (command "_.psetupin" (findfile "T:/Drawing Tools/Templates/CCC2009.dwt") "A3")
  8.      (while (wcmatch (getvar "cmdnames") "*PSETUPIN*")
  9.        (command "_yes")
  10.      ) ;_ while
  11.      T
  12.    ) ;_ progn
  13. ) ;_ if
  14. (command "-plot" "n" "" "A3" "" "n" "y" "n")
  15. (command "_-purge" "a" "*" "N")
  16. (setq CCC_Sheet "A3")
  17. (command "updatefield" "all" "")
  18. (command "regenall")
  19. (command "_zoom" "e")
  20. (initdia)
  21. (command "._plot")
  22. (PlotReactorON)
  23. ;(princ)
  24. )
  25. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  26. (defun PlotReactorON nil
  27. (vl-load-com)
  28. ;; © Lee Mac 2010
  29. (  (lambda ( data foo / react )
  30.       (if (setq react
  31.             (vl-some
  32.               (function
  33.                 (lambda ( reactor )
  34.                   (if (eq data (vlr-data reactor)) reactor)
  35.                 )
  36.               )
  37.               (cdar
  38.                 (vlr-reactors :vlr-command-reactor)
  39.               )
  40.             )
  41.           )
  42.         (if (not (vlr-added-p react))
  43.           (vlr-add react)
  44.         )
  45.         (setq react
  46.           (vlr-command-reactor data
  47.             (list
  48.               (cons :vlr-commandwillstart foo)
  49.             )
  50.           )
  51.         )
  52.       )
  53.       (if (vlr-added-p react)
  54.         (princ "\n** Reactor Activated **")
  55.         (princ "\n** Reactor Failed to Activate **")
  56.       )
  57.       react
  58.     )
  59.    "Plot-Reactor"
  60.    'Plot-Callback
  61. )
  62. (princ)
  63. )
  64. (defun PlotReactorOFF nil
  65. (vl-load-com)
  66. ;; © Lee Mac 2010
  67. (  (lambda ( data foo / react )
  68.       (if (setq react
  69.             (vl-some
  70.               (function
  71.                 (lambda ( reactor )
  72.                   (if (eq data (vlr-data reactor)) reactor)
  73.                 )
  74.               )
  75.               (cdar
  76.                 (vlr-reactors :vlr-command-reactor)
  77.               )
  78.             )
  79.           )
  80.         (if (vlr-added-p react)
  81.           (vlr-remove react)
  82.         )
  83.       )
  84.       (if (or (not react) (not (vlr-added-p react)))
  85.         (princ "\n** Reactor Deactivated **")
  86.         (princ "\n** Reactor Failed to Deactivate **")
  87.       )
  88.       react
  89.     )
  90.    "Plot-Reactor"
  91.    'Plot-Callback
  92. )
  93. (princ)
  94. )
  95. (defun Plot-Callback ( reactor arguments )
  96. (vl-load-com)
  97. (if (eq (strcase (car arguments)) "PLOT")
  98.    (LM:Popup "Warning" 64 "Gotcha!!!   Please use the NNRDO Plot tools when plotting standard layouts!!")
  99. )
  100. (princ)
  101. )
  102. (defun LM:Popup ( title flags msg / WSHShell result )
  103. ;; © Lee Mac 2010
  104. (setq WSHShell (vlax-create-object "WScript.Shell"))
  105. (setq result   (vlax-invoke WSHShell 'Popup msg 0 title flags))
  106. (vlax-release-object WSHShell)
  107. result
  108. )

 
 
但是,我想修改它以执行以下操作。我在我们的标准模板中选中了“使用图纸空间单位进行缩放”框,这是我需要的服务图纸。然而,这使得衬砌图纸在打印时看起来是错误的,因为道路衬砌的破折号显得太短。
 
我希望能够测试块“CCC\u Drawing\u Types”中的属性TAGD2是否设置为LS,然后检查是否选中“使用图纸空间单位进行缩放”。如果是这样,调用一个对话框,告诉用户取消选中它,然后启动LT对话框,当用户单击“确定”以继续打印窗口时。
 
我知道听起来我的想法已经整理好了,但我不知道从哪里开始。我找到了李的一个Lisp程序的Lisp程序的地方,从一个方块中提取了一个阁楼,但我不知道如何合并它。
 
  1. (defun c:sk (/ dxf ent)
  2. (defun dxf (code ent) (cdr (assoc code (entget ent))))
  3. (if (and (setq ent (car (entsel "\nSelect an Attributed Block: ")))
  4.           (eq "INSERT" (dxf 0 ent))
  5.           (= 1 (dxf 66 ent)))
  6.    (while (not (eq "SEQEND" (dxf 0 (setq ent (entnext ent)))))
  7.      (princ (strcat "\n\nAtt_Tag:" (dxf 2 ent) "\nAtt_Value: " (dxf 1 ent)))))
  8. (princ))

 
如果能在这方面得到任何帮助,我将不胜感激。
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 10:23 , Processed in 0.516086 second(s), 65 queries .

© 2020-2025 乐筑天下

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