乐筑天下

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

[综合讨论] GETPAT。lsp需要dwgprefix han

[复制链接]

37

主题

264

帖子

236

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
185
发表于 2022-7-6 23:19:42 | 显示全部楼层 |阅读模式
在荷兰,一些聪明的人可以想出一个主意,用定制的填充图案来标准化国家标准。我从未理解过这一点,因为它只会导致。。嗯。。,大量定制(非标准)。pat文件正在使用中。。想想看吧GETPAT。lsp是获取这些缺失信息的好工具。pat文件(发送者10次中有9次忘记)。然而,如果它能够编写。pat文件位于当前目录中。我想找一个能说会道的人,他可以用一种体面的方式解决这个问题。很适合为自己分析lisp
 
希望可以将此url链接到Autodesk论坛。那是谷歌发给我的。。
 
 
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-change-the-pat-save-location-in-getpat-lsp/m-p/7456378#M360240
回复

使用道具 举报

37

主题

264

帖子

236

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
185
发表于 2022-7-6 23:38:51 | 显示全部楼层
 
 
解决了!
回复

使用道具 举报

17

主题

1274

帖子

25

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
260
发表于 2022-7-6 23:42:11 | 显示全部楼层
我对我的进行了修改,将图案定义保存到网络上的自定义文件夹中,该文件夹已添加到支持路径中,以便在任何图形中使用hatch命令都可以轻松访问它们。
我还对其进行了修改,以处理预先选择的图案填充,以便将其添加到图案填充右键单击菜单中。
 
lisp代码最好的地方在于,它可以轻松定制以满足我们的需求。我使用的代码中不到三分之一是由我创建的。虽然我修改了下载的大部分代码,但我保留了作者的标题和链接,以感谢他们所做的工作。
我还推荐T恤方形图案RRL。lsp,但GETPAT。lsp是他们最好的。
回复

使用道具 举报

37

主题

264

帖子

236

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
185
发表于 2022-7-6 23:53:41 | 显示全部楼层
好主意。不适用于缺少像样映射的Revit DWG。问题是,FP_对于每个出口都可能不同。另一个问题是“保存到支持路径?”两者兼而有之。
回复

使用道具 举报

17

主题

1274

帖子

25

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
260
发表于 2022-7-7 00:06:37 | 显示全部楼层
 
不熟悉Revit。对于AutoCAD,只要它位于支持文件搜索路径中,它就可以用于Hatch命令。如果您也希望在当前目录中添加vl文件副本,则可以轻松地添加该副本。
回复

使用道具 举报

17

主题

1274

帖子

25

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
260
发表于 2022-7-7 00:12:56 | 显示全部楼层
 
修改版本,将其保存在与“GETPAT.lsp”和当前绘图文件夹相同的位置。
lsp必须位于“支持文件搜索路径”和“受信任文件夹”中,它才能找到文件并具有运行该文件的权限。
  1. ;|
  2. http://www.turvill.com/t2/free_stuff/getpat.lsp
  3. GETPAT.LSP (c) 2001 Tee Square Graphics
  4.    Version 1.01b - 1/22/2002
  5. This routine may be used to extract hatch pattern data
  6. from existing drawings when the .pat file containing
  7. the original information is not available.
  8. After loading the file in the usual manner, type the
  9. command GETPAT at the AutoCAD Command: prompt, select
  10. any (non-SOLID) hatch object, and the pattern information
  11. will be written to a .pat file having the same name as
  12. the pattern (e.g., pattern information for the hatch
  13. pattern WOODS will be written to WOODS.PAT.
  14. Ver. 1.01b includes two small fixex to eliminate "Bad
  15. Argument" LISP errors when run with certain installations
  16. of AutoCAD 2000+.
  17. Modified to use a prselected hatch and place in both the current
  18. location of "GETPAT.lsp" and the current drawing folder by Tom Beauford.
  19. Add command with macro: ^P(or C:GETPAT (load "GETPAT.lsp"));GETPAT
  20. to CUI => Shortcut Menus => Hatch Object Menu
  21. |;
  22. (defun C:GETPAT (/ cmde hat elst rotn hnam temp xofs yofs what
  23.                   temp outf CustPath DwgPath flin angl tmp1 tmp2 xvec yvec)
  24. (setq cmde (getvar "cmdecho"))
  25. (setvar "cmdecho" 0)
  26. (setq elst (entget(ssname(ssget "+.:E:S" '((0 . "hatch")))0)) path elst)
  27. (if (= (cdr (assoc 0 elst)) "HATCH")
  28.    (progn
  29.      (setq rotn (* 180 (/ (cdr (assoc 52 elst)) pi))
  30.            hnam (cdr (assoc 2 elst))
  31.            hscl (cdr (assoc 41 elst))
  32.      )
  33. ;; The following nine lines may optionally be omitted.
  34. ;; Their purpose is to create a temporary "clone" of the
  35. ;; selected hatch with a 0 deg. rotation angle, in case
  36. ;; the hatch object specified a rotation angle. If these
  37. ;; lines are omitted, the current rotation of the selected
  38. ;; hatch will become the "0" deg. rotation for the extracted
  39. ;; pattern definition.
  40.      (if (not (zerop rotn))
  41.        (progn
  42.          (setq temp elst)
  43.          (entmake temp)
  44.          (command "_.rotate" (entlast) "" (cdr (assoc 10 temp))(- rotn))
  45.          (setq elst (entget (entlast)))
  46.          (entdel (entlast))
  47.        )
  48.      )
  49. ;; End of optional code.
  50.      (setq xofs (cdr (assoc 43 elst))
  51.            yofs (cdr (assoc 44 elst))
  52.            elst (member (assoc 53 elst) elst)
  53.      )
  54.      (setq outf (vl-string-subst (strcat hnam ".pat") "getpat.lsp" (findfile "getpat.lsp"))
  55.            CustPath outf
  56.            DwgPath (strcat (getvar "dwgprefix") hnam ".pat")
  57.      )
  58.      (if (findfile outf)
  59.        (progn
  60.          (initget "Overwrite Append")
  61.          (setq what (getkword (strcat "\n" outf " already exists; [Overwrite/Append]? ")))
  62.        )
  63.      )
  64.      (setq outf (open outf (if (= what "Append") "a" "w"))
  65.            flin (strcat "*" hnam)
  66.      )
  67.      (foreach x elst
  68.        (cond
  69.          ((= (car x) 53)
  70.            (write-line flin outf)
  71.            (setq angl (cdr x)
  72.                  flin (trim (angtos angl 0 7))
  73.            )
  74.          )
  75.          ((= (car x) 43)
  76.            (setq flin (strcat flin ", " (trim (rtos (/ (- (cdr x) xofs) hscl) 2 7))))
  77.          )
  78.          ((= (car x) 44)
  79.            (setq flin (strcat flin "," (trim (rtos (/ (- (cdr x) yofs) hscl) 2 7))))
  80.          )
  81.          ((= (car x) 45)
  82.            (setq tmp1 (cdr x))
  83.          )
  84.          ((= (car x) 46)
  85.            (setq tmp2 (cdr x)
  86.                  xvec (/ (+ (* tmp1 (cos angl))(* tmp2 (sin angl))) hscl)
  87.                  yvec (/ (- (* tmp2 (cos angl))(* tmp1 (sin angl))) hscl)
  88.                  flin (strcat flin ", " (trim (rtos xvec 2 7)) "," (trim (rtos yvec 2 7)))
  89.            )
  90.          )
  91.          ((= (car x) 49)
  92.            (setq flin (strcat flin ", " (trim (rtos (/ (cdr x) hscl) 2 7))))
  93.          )
  94.          ((= (car x) 98)
  95.            (write-line flin outf)
  96.          )
  97.          (T nil)
  98.        )
  99.      )
  100.      (write-line "" outf)
  101.      (close outf)
  102.      (alert (strcat "Pattern definition written to " CustPath))
  103.    )
  104.    (alert "Selected object not a HATCH.")
  105. )
  106. (setvar "cmdecho" cmde)
  107. (vl-file-copy CustPath DwgPath)
  108. (princ)
  109. )
  110. (defun trim (x / n)
  111. (setq n (strlen x))
  112. (while (and (/= x "0")(= (substr x n 1) "0"))
  113.    (setq n (1- n)
  114.          x (substr x 1 n)
  115.    )
  116. )
  117. (if (= (substr x n 1) ".")
  118.    (setq x (substr x 1 (1- n)))
  119. )
  120. x
  121. )
  122. (princ)
回复

使用道具 举报

37

主题

264

帖子

236

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
185
发表于 2022-7-7 00:20:44 | 显示全部楼层
干得好,汤姆!!
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 06:02 , Processed in 0.425015 second(s), 66 queries .

© 2020-2025 乐筑天下

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