乐筑天下

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

[编程交流] HVAC管道计划

[复制链接]

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 16:30:27 | 显示全部楼层
嗨,秃鹰,
 
很好看的程序,我可以看到你在DCL上做了很多工作,有很多选择。
 
我希望你不介意,但我对代码本身有一些评论,从中取材,但它们只是建议。
 
-----------------------------------------------------------------
 
1.为什么函数“RMD_SUS”有这么多局部变量,而它们不用于此子系统?
 
  1. (defun RMD_SUS (/ [color=Red]ANG#   BF1#    BF2#    BFN$   BOFF$  CL01#  CL02#  CMT#  CNPT1# CNPT2# DCL_ID DCOL# DCOM$
  2.                  DDEP1# DDEP2#  DEG#    DLEN#  DSYS$  DWID1# DWID2# EANG$ EDIR$  ELIST  ENAME  ERAD$ EXDR#
  3.                  FSCL#  FSTY$   FSU$    INDEX  ITHK#  ITYP$  LATYP$ LCLR# LNAM$  LOOP$  LTYP$  LWGT# MPNT
  4.                  MPNT1# MPNT2#  MPNT3#  MPNT4# MPNT5# MPNT6# PFN$   PT01# PT02#  PT03#  PT04#  PT05# PT06#
  5.                  PT07#  PT08#   PT09#   PT10#  PT11#  PT12#  PT13#  PT14# PT15#  PT16#  PT17#  PT18# RAD#
  6.                  SAM$   SIDE-a# SIDE-c# SUS    TANG$  TOA#   TOFF$  TSIZ# TSU$   TWF#   TXPT#  TXTA#[/color])
-----------------------------------------------------------------
 
我注意到你在代码中使用了很多全局变量。只是一个建议,为了避免使用大量全局变量,只需制作一个全局列表,其中包含所有要存储的值。
 
如果你决定走这条路,为了给你举个例子,我在我的Point Manager程序中使用了这个方法:
 
http://www.cadtutor.net/forum/showpost.php?p=289563&postcount=1
 
-----------------------------------------------------------------
 
3.我倾向于避免使用(退出)功能,我意识到这只是我有点完美主义,但你可以通过在对话框加载代码中使用COND语句来避免使用这样的功能,例如:
 
  1. (cond (  (<= (setq DCL_ID (load_dialog "RMD.dcl")) 0)
  2.           (princ "\nDialog File not Found"))
  3.        (  (not (new_dialog "MAIN" DCL_ID))
  4.           (princ "\nDialog Definition not Found"))
  5.        (t
  6.           .. Now the program can start...
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-5 16:32:52 | 显示全部楼层
 
哪个更改导致了此错误?你用了什么代码?
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-5 16:36:59 | 显示全部楼层
看起来很热闹。我有一船单独的。我需要将HVAC的lsp添加到一个程序中(在适当的时候)
 
看起来很棒!我一上班就去试一试。
 
谢谢
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 16:38:51 | 显示全部楼层
李,
 
当你看不出我在跟你开玩笑时,你真的需要把那些数学书放下一段时间。
 
代码很好。我把你的一些建议付诸实践,没关系。我会及时处理剩下的事情。
 
谢谢
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-5 16:41:18 | 显示全部楼层
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-5 16:44:33 | 显示全部楼层
Lee,
 
While I was putting in the changes you suggested I got this strange error message.
 
Error:bad argument type: 2D/3D point: nil But heres a really great Llama!
 
Instead of an American Duct, I get an English Llama!
 
Thats Reg Llama of Brixton! I knew you were upto something!:lol::lol:
165637t8w2kkq558q20ff2.jpg
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-5 16:49:27 | 显示全部楼层
Attention All!
 
RMD is now revised to RMD_V1. See attachments on first post.
 
Also note that I remove all the multiple Font Styles and left Arch style in.
You can change this to your own default Font Style. Also if you wish to make layer and text size modifications, You may do so in this area of the code. Please also note that I will be coming out with a Metric version soon.
 
See below: Just change values where I had commented.
 
  1. ;/////////////////////////////////////////////////////////////////////////////////////////;; F22 - Make Layer Function.;(defun RMD_ML () (if (or (= ITYP$ "INTERNAL")(= ITYP$ "EXTERNAL")(= ITYP$ "BOTH"))   (or (tblsearch "ltype" "DUCT_INSL")     (entmake       (list         (cons 0   "LTYPE")         (cons 100 "AcDbSymbolTableRecord")         (cons 100 "AcDbLinetypeTableRecord")         (cons 2   "DUCT_INSL")         (cons 70   0)         (cons 3   "Duct Insulation _ _ _ _ _ _ _ ")         (cons 72   65)         (cons 73   2)         (cons 40   0.046875)         (cons 49   0.03125)         (cons 74   0)         (cons 49  -0.015625)         (cons 74   0))))) (cond                                       [color=red];Layer Name               Layer[/color] [color=red]Color     Linetype                 Lineweight[/color]   ((and (= DSYS$ "SUPPLY") (= LATYP$ "DUCT")(setq LNAM$ "M-HVAC-SUPP")(setq LCLR#   4)(setq LTYP$ "Continuous")(setq LWGT# 50)))   ((and (= DSYS$ "SUPPLY") (= LATYP$ "INSL")(setq LNAM$ "M-HVAC-INSL")(setq LCLR#   1)(setq LTYP$ "DUCT_INSL") (setq LWGT# 18)))   ((and (= DSYS$ "SUPPLY") (= LATYP$ "IDEN")(setq LNAM$ "M-HVAC-IDEN")(setq LCLR#   6)(setq LTYP$ "Continuous")(setq LWGT# 35)))   ((and (= DSYS$ "RETURN") (= LATYP$ "DUCT")(setq LNAM$ "M-HVAC-RETN")(setq LCLR#  23)(setq LTYP$ "Continuous")(setq LWGT# 50)))   ((and (= DSYS$ "RETURN") (= LATYP$ "INSL")(setq LNAM$ "M-HVAC-INSL")(setq LCLR#   1)(setq LTYP$ "DUCT_INSL") (setq LWGT# 18)))   ((and (= DSYS$ "RETURN") (= LATYP$ "IDEN")(setq LNAM$ "M-HVAC-IDEN")(setq LCLR#   6)(setq LTYP$ "Continuous")(setq LWGT# 35)))   ((and (= DSYS$ "DUST")   (= LATYP$ "DUCT")(setq LNAM$ "M-DUST-DUCT")(setq LCLR# 203)(setq LTYP$ "Continuous")(setq LWGT# 50)))   ((and (= DSYS$ "DUST")   (= LATYP$ "IDEN")(setq LNAM$ "M-DUST-IDEN")(setq LCLR#   6)(setq LTYP$ "Continuous")(setq LWGT# 35)))   ((and (= DSYS$ "EXHAUST")(= LATYP$ "DUCT")(setq LNAM$ "M-EXHS-DUCT")(setq LCLR#  83)(setq LTYP$ "Continuous")(setq LWGT# 50)))   ((and (= DSYS$ "EXHAUST")(= LATYP$ "IDEN")(setq LNAM$ "M-EXHS-IDEN")(setq LCLR#   6)(setq LTYP$ "Continuous")(setq LWGT# 35)))) (if (null (tblsearch "style" LNAM$))   (entmake     (list       (cons 0   "LAYER")       (cons 100 "AcDbSymbolTableRecord")       (cons 100 "AcDbLayerTableRecord")       (cons 2    LNAM$)       (cons 6    LTYP$)       (cons 62   LCLR#)       (cons 70   0)       (cons 290  1)       (cons 370  LWGT#)))) (princ));;/////////////////////////////////////////////////////////////////////////////////////////;; F23 - Font Style Function.;(defun RMD_FS () (setq FSTY$ "Arch"       [color=red];Font Style Name[/color]       TWF#   1.0         [color=red];Text Width Factor[/color]       TOA#   0.0         [color=red];Text Oblique Angle[/color]       PFN$  "arch.shx"   [color=red];Font Name ~ (Note: You can have .shx or .ttf type fonts)[/color]       BFN$  "")          ;Big Font (if (null (tblsearch "style" FSTY$))   (entmake     (list       (cons 0   "STYLE")       (cons 100 "AcDbSymbolTableRecord")       (cons 100 "AcDbTextStyleTableRecord")       (cons 2    FSTY$)       (cons 70   0)       (cons 40   0)       (cons 41   TWF#)       (cons 50   TOA#)       (cons 3    PFN$)       (cons 4    BFN$)))) (princ));;/////////////////////////////////////////////////////////////////////////////////////////;; F24 - Text Size Function.;(defun RMD_TS () (cond   ((= FSCL# 0)(setq TSIZ# (setvar "textsize" 9)))        [color=red];9"     Height[/color]   ((= FSCL# 1)(setq TSIZ# (setvar "textsize" 4.5)))      [color=red];4-1/2" Height[/color]   ((= FSCL# 2)(setq TSIZ# (setvar "textsize" 3)))        [color=red];3"     Height[/color]   ((= FSCL# 3)(setq TSIZ# (setvar "textsize" 2.25))))    [color=red];2-1/4" Height[/color] (princ));;/////////////////////////////////////////////////////////////////////////////////////////
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 16:52:39 | 显示全部楼层
 
Which change caused this error? And what code did you use?
回复

使用道具 举报

15

主题

209

帖子

121

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
163
发表于 2022-7-5 16:53:52 | 显示全部楼层
Looks great Buzz.  I have a boat load of separate .lsp for HVAC that I need to add into one program (In due time)
 
Looks great!  Once I get to work I'll give it a whirl.
 
Thanks
回复

使用道具 举报

32

主题

1166

帖子

1146

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
159
发表于 2022-7-5 16:57:48 | 显示全部楼层
Lee,
 
You really need to put those math books down for a while when you cannot tell I am clowning with you.
 
The code is fine. I put some of your suggestions to work and its OK. I will get to the rest of it in time.
 
Thanks
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-13 21:16 , Processed in 0.611213 second(s), 73 queries .

© 2020-2025 乐筑天下

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