很好看的程序,我可以看到你在DCL上做了很多工作,有很多选择。
我希望你不介意,但我对代码本身有一些评论,从中取材,但它们只是建议。
-----------------------------------------------------------------
1.为什么函数“RMD_SUS”有这么多局部变量,而它们不用于此子系统?
(defun RMD_SUS (/ ANG# BF1# BF2# BFN$ BOFF$CL01#CL02#CMT#CNPT1# CNPT2# DCL_ID DCOL# DCOM$
DDEP1# DDEP2#DEG# DLEN#DSYS$DWID1# DWID2# EANG$ EDIR$ELISTENAMEERAD$ EXDR#
FSCL#FSTY$ FSU$ INDEXITHK#ITYP$LATYP$ LCLR# LNAM$LOOP$LTYP$LWGT# MPNT
MPNT1# MPNT2#MPNT3#MPNT4# MPNT5# MPNT6# PFN$ PT01# PT02#PT03#PT04#PT05# PT06#
PT07#PT08# PT09# PT10#PT11#PT12#PT13#PT14# PT15#PT16#PT17#PT18# RAD#
SAM$ SIDE-a# SIDE-c# SUS TANG$TOA# TOFF$TSIZ# TSU$ TWF# TXPT#TXTA#)
-----------------------------------------------------------------
我注意到你在代码中使用了很多全局变量。只是一个建议,为了避免使用大量全局变量,只需制作一个全局列表,其中包含所有要存储的值。
如果你决定走这条路,为了给你举个例子,我在我的Point Manager程序中使用了这个方法:
http://www.cadtutor.net/forum/showpost.php?p=289563&postcount=1
-----------------------------------------------------------------
3.我倾向于避免使用(退出)功能,我意识到这只是我有点完美主义,但你可以通过在对话框加载代码中使用COND语句来避免使用这样的功能,例如:
(cond ((<= (setq DCL_ID (load_dialog "RMD.dcl")) 0)
(princ "\nDialog File not Found"))
((not (new_dialog "MAIN" DCL_ID))
(princ "\nDialog Definition not Found"))
(t
.. Now the program can start...
哪个更改导致了此错误?你用了什么代码? 看起来很热闹。我有一船单独的。我需要将HVAC的lsp添加到一个程序中(在适当的时候)
看起来很棒!我一上班就去试一试。
谢谢 李,
当你看不出我在跟你开玩笑时,你真的需要把那些数学书放下一段时间。
代码很好。我把你的一些建议付诸实践,没关系。我会及时处理剩下的事情。
谢谢 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:
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.
;/////////////////////////////////////////////////////////////////////////////////////////;; 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 ;Layer Name Layer Color Linetype Lineweight ((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 2901) (cons 370LWGT#)))) (princ));;/////////////////////////////////////////////////////////////////////////////////////////;; F23 - Font Style Function.;(defun RMD_FS () (setq FSTY$ "Arch" ;Font Style Name TWF# 1.0 ;Text Width Factor TOA# 0.0 ;Text Oblique Angle PFN$"arch.shx" ;Font Name ~ (Note: You can have .shx or .ttf type fonts) 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))) ;9" Height ((= FSCL# 1)(setq TSIZ# (setvar "textsize" 4.5))) ;4-1/2" Height ((= FSCL# 2)(setq TSIZ# (setvar "textsize" 3))) ;3" Height ((= FSCL# 3)(setq TSIZ# (setvar "textsize" 2.25)))) ;2-1/4" Height (princ));;/////////////////////////////////////////////////////////////////////////////////////////
Which change caused this error? And what code did you use? 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 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
页:
1
[2]