Jump to content

Recommended Posts

Posted

Hello All,

 

This is an HVAC ducting program and it has a fair amount of nice features. This program is complete with built-in instructions. For information on loading, see this link:

http://www.cadtutor.net/forum/showthread.php?t=1390

 

Command Syntax is RMD

 

See images below and please give me your input good or bad.

 

For a copy of this program in a Metric Version go to this link below or see Post 52:

 

http://www.cadtutor.net/forum/showthread.php?p=302134#post302134

 

Attention!

RMD_V5 has now been Revised to RMD_V6.lsp & RMD_V6.dcl

See Attached

 

Revision List - 02/21/10

;/////////////////////////////////////////////////////////////////////////////////////////
;;;
;;; Do Not Remove This Header!
;;;
;;; Revisions
;;;
;;; No. | Description                                                        | Date
;;;=====|====================================================================|===========
;;; 1.0 | Modify variable localization                                       | 02|07|10
;;; --- | Reduce multiple font styles to one style (arch.shx)                | --------
;;; --- | Remove RMD_FSU Font Style Update Function                          | --------
;;; --- | Remove RMD_TSU Text Size Update Function                           | --------
;;; --- | Remove RMD_FIS Font Image Function                                 | --------
;;; --- | Modify RMD_CMT Component Mode Tile Function                        | --------
;;; --- | Modify RMD_IDP Instructions Dialog Page Function                   | --------
;;;=====|====================================================================|===========
;;; 2.0 | Added TRANS command function so program will work in UCS system    | 02|09|10
;;; --- | Adjust User Interface                                              | --------
;;; --- | Removed 3/8"= 1' Viewport Scale                                    | --------
;;;=====|====================================================================|===========
;;; 3.0 | Removed all entity lists from functions RMD_HDUCT thru RMD_FCON    | 02|18|10
;;; --- | Added RMD_DFL, RMD_IL and RMD_DE Functions                         | --------
;;;=====|====================================================================|===========
;;; 4.0 | Added User Defined inside elbow radius and error trapping          | 02|19|10
;;;=====|====================================================================|===========
;;; 5.0 | Added a \ to all instances of the degree character in the dcl      | 02|20|10
;;; --- | ------------------------------------------------------------------ | --------
;;;=====|====================================================================|===========
;;; 6.0 | Modified RMD_FS Function to use default font style                 | 02|21|10
;;; --- | ------------------------------------------------------------------ | --------
;/////////////////////////////////////////////////////////////////////////////////////////

If you wish to modify the text style, layer name, layer color, linetype, lineweight and text size. You may do so in this area of the code, Functions 25 and 27.

 

;/////////////////////////////////////////////////////////////////////////////////////////
;
; F25 - 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 "layer" 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))
;
;/////////////////////////////////////////////////////////////////////////////////////////
;
; F27 - 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" 2.25))))    ;2-1/4" Height
 (princ))
;
;/////////////////////////////////////////////////////////////////////////////////////////

 

 

Thanks,

The Buzzard

RMD_V6.zip

Document1.JPG

Posted

Attention All,

 

Source coding is now uploaded to the first post. This is an all entmake program. There are no command calls what so ever.

Unlike some of my past codes, I made extensive use of lists as well. Also I have done the images with Vector Image in a more effiecient way.

 

Again please review and let me know what you find.

 

Thanks,

The Buzzard

Posted

That is very generous of you Angelo (a.k.a. - The Buzzard). Thanks. Will give it a try upon my return to work on Monday.

Posted
That is very generous of you Angelo (a.k.a. - The Buzzard). Thanks. Will give it a try upon my return to work on Monday.

 

Your very welcome ReMark,

 

I sometimes write this stuff just to pass the time. I always wanted to make a code for this, But never got around to it I guess. Codes that do alot more for your lisp dollar with one command is a neat thing. I remember spending many hours behind a terminal doing all this stuff from scratch and that was a drag. This is the type of code that can get use every working day of your job if your are in that field. I have been trying to find various diciplines to make a code for, But the research can take long to get the information one would need.

 

Anyway Enjoy and let me know how it goes.

The Buzzard

Posted

Here is a typical duct created with this program.

aflac-duck.jpg

Posted
Your very welcome ReMark,

 

I sometimes write this stuff just to pass the time. I always wanted to make a code for this, But never got around to it I guess. Codes that do alot more for your lisp dollar with one command is a neat thing. I remember spending many hours behind a terminal doing all this stuff from scratch and that was a drag. This is the type of code that can get use every working day of your job if your are in that field. I have been trying to find various diciplines to make a code for, But the research can take long to get the information one would need.

 

Anyway Enjoy and let me know how it goes.

The Buzzard

 

I think the font choices are overkill, I prefer to use the drawing default font set by the firms standards. Unless there was a button added for this option?? other than that, love it. I guess we can hack it from here.

S

Posted
I think the font choices are overkill, I prefer to use the drawing default font set by the firms standards. Unless there was a button added for this option?? other than that, love it. I guess we can hack it from here.

S

 

Thanks stevefr,

 

I see your point. Its the same reason I did not put layer color buttons in since anyone can set their own company standards in the source code. I did need something though to balance the dialog all the same. I thought about using OpenDCL for this dialog, But that is such a long process and most likely would frustrate others who are not familar with OpenDCL. There is quite a bit of choice just the same and even if you do not do HVAC the methods used here can still be a learning experience for one who may want to build a code for something else.

Since I was was going to make this code to control a standard, That would seem reasonable to have only one font style.

 

Anyway I am glad you like it.

Enjoy it.

The Buzzard

Posted

Hey Buzz . Thanks . This is a nice one.

Posted
Hey Buzz . Thanks . This is a nice one.

 

So does that mean DCL is OK by you?

Just teasing Viv.

Let me know of all the quirks if you do not mind.

It only will make it better.

 

Enjoy the program.

The Buzzard

Posted

Actually it is not ok you know that from my previous thread, :wink: because it increases your input time. But I think this one is worth trying. :) This program is for use with imperial units. Many companies like mine uses metric system. Can it also have a switch for imperial / metric.(i dont know wether it is possible or not):?. Another thing is about the fonts. I would like the program to use the default fonts which i am using in the drawing.

 

Thanks & regards

Vivian

Posted

Hi Buzzard,

 

Nice looking program, I can see that you have put a lot of work into the DCL, with many options.

 

I hope you don't mind, but I have a few comments about the code itself, take what you like from them, but they are only suggestions.

 

-----------------------------------------------------------------

 

1. Why does the function 'RMD_SUS' have so many local variables when they are not used in this sub?

 

(defun RMD_SUS (/ [color=Red]ANG#   BF1#    BF2#    BFN$   BOFF$  CL01#  CL02#  CMT#  CNPT1# CNPT2# DCL_ID DCOL# DCOM$
                 DDEP1# DDEP2#  DEG#    DLEN#  DSYS$  DWID1# DWID2# EANG$ EDIR$  ELIST  ENAME  ERAD$ EXDR#
                 FSCL#  FSTY$   FSU$    INDEX  ITHK#  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#[/color])

-----------------------------------------------------------------

 

2. I notice that you use a lot of Global Variables in your code. Just a suggestion, to avoid the use of loads of globals, just make one list that is global, containing all the values you want to store.

 

To aid you with an example if you decide to go down this route, I used this method in my Point Manager program:

 

http://www.cadtutor.net/forum/showpost.php?p=289563&postcount=1

 

-----------------------------------------------------------------

 

3. I tend to avoid the use of the (exit) function, I realise this is just me being a bit of a perfectionist, but you could avoid use of such by using a COND statement in your Dialog loading code, for example:

 

 (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...

-----------------------------------------------------------------

 

4. To avoid repeatedly copying the headers for entmaking an LWPOLYLINE and such, I would recommend making a sub-function that you can feed a point list to, for example:

 

(defun mklw (l / e)
   (entmakex (append (list (cons 0   "LWPOLYLINE")
                           (cons 100 "AcDbEntity")
                           (cons 100 "AcDbPolyline")
                           (cons 90 (length l))
                           (cons 70 1))
                     (mapcar (function (lambda (a) (cons 10 a))) l))))

-----------------------------------------------------------------

 

5. Instead of tons of 'nth' statements, you could use just one 'mapcar' statement when using 'mode_tile':

 

 (mode_tile "SUPPLY"    (nth  0 CMT#))
 (mode_tile "RETURN"    (nth  1 CMT#))
 (mode_tile "DUST"      (nth  2 CMT#))
 (mode_tile "EXHAUST"   (nth  3 CMT#))
 (mode_tile "NONE"      (nth  4 CMT#))
 (mode_tile "INTERNAL"  (nth  5 CMT#))
 (mode_tile "EXTERNAL"  (nth  6 CMT#))
 (mode_tile "BOTH"      (nth  7 CMT#))
 (mode_tile "LEFT"      (nth  8 CMT#))
 (mode_tile "RIGHT"     (nth  9 CMT#))
 (mode_tile "90"        (nth 10 CMT#))
 (mode_tile "60"        (nth 11 CMT#))
 (mode_tile "45"        (nth 12 CMT#))
 (mode_tile "30"        (nth 13 CMT#))
 (mode_tile "SHORT"     (nth 14 CMT#))
 (mode_tile "LONG"      (nth 15 CMT#))
 (mode_tile "LEFT-OFF"  (nth 16 CMT#))
 (mode_tile "MIDDLE"    (nth 17 CMT#))
 (mode_tile "RIGHT-OFF" (nth 18 CMT#))
 (mode_tile "10D"       (nth 19 CMT#))
 (mode_tile "15D"       (nth 20 CMT#))
 (mode_tile "20D"       (nth 21 CMT#))
 (mode_tile "30D"       (nth 22 CMT#))
 (mode_tile "LEFTOFF"   (nth 23 CMT#))
 (mode_tile "RIGHTOFF"  (nth 24 CMT#))

(mapcar (function mode_tile) '("SUPPLY" "RETURN" "DUST"...) CMT#)

-----------------------------------------------------------------

 

 

I'm not trying to criticise your program, just trying to offer possible improvements.

 

I hope this helps, if you have any questions about what I have posted, just ask.

 

Lee

Posted
Actually it is not ok you know that from my previous thread, :wink: because it increases your input time. But I think this one is worth trying. :) This program is for use with imperial units. Many companies like mine uses metric system. Can it also have a switch for imperial / metric.(i dont know wether it is possible or not):?. Another thing is about the fonts. I would like the program to use the default fonts which i am using in the drawing.

 

Thanks & regards

Vivian

 

All that is a can do. I thought at first about making it a combo Imperial/Metric program, But I was not sure on some of the metric standards. I stuck with what I knew and if someone wanted a metric program they could change it over easy. As far as the default fonts, I could eliminate the program making these and let the user set their own font style. Making it combo Imp/Met will require additional coding.

Get back to me and I can discuss with you all the changes you require.

 

Thanks for the input.

The Buzzard

Posted
Hi Buzzard,

 

Nice looking program, I can see that you have put a lot of work into the DCL, with many options.

 

I hope you don't mind, but I have a few comments about the code itself, take what you like from them, but they are only suggestions.

 

-----------------------------------------------------------------

 

1. Why does the function 'RMD_SUS' have so many local variables when they are not used in this sub?

 

(defun RMD_SUS (/ [color=red]ANG#   BF1#    BF2#    BFN$   BOFF$  CL01#  CL02#  CMT#  CNPT1# CNPT2# DCL_ID DCOL# DCOM$[/color]
[color=red]                DDEP1# DDEP2#  DEG#    DLEN#  DSYS$  DWID1# DWID2# EANG$ EDIR$  ELIST  ENAME  ERAD$ EXDR#[/color]
[color=red]                FSCL#  FSTY$   FSU$    INDEX  ITHK#  ITYP$  LATYP$ LCLR# LNAM$  LOOP$  LTYP$  LWGT# MPNT[/color]
[color=red]                MPNT1# MPNT2#  MPNT3#  MPNT4# MPNT5# MPNT6# PFN$   PT01# PT02#  PT03#  PT04#  PT05# PT06#[/color]
[color=red]                PT07#  PT08#   PT09#   PT10#  PT11#  PT12#  PT13#  PT14# PT15#  PT16#  PT17#  PT18# RAD#[/color]
[color=red]                SAM$   SIDE-a# SIDE-c# SUS    TANG$  TOA#   TOFF$  TSIZ# TSU$   TWF#   TXPT#  TXTA#[/color])

-----------------------------------------------------------------

 

2. I notice that you use a lot of Global Variables in your code. Just a suggestion, to avoid the use of loads of globals, just make one list that is global, containing all the values you want to store.

 

To aid you with an example if you decide to go down this route, I used this method in my Point Manager program:

 

http://www.cadtutor.net/forum/showpost.php?p=289563&postcount=1

 

-----------------------------------------------------------------

 

3. I tend to avoid the use of the (exit) function, I realise this is just me being a bit of a perfectionist, but you could avoid use of such by using a COND statement in your Dialog loading code, for example:

 

 (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...

-----------------------------------------------------------------

 

4. To avoid repeatedly copying the headers for entmaking an LWPOLYLINE and such, I would recommend making a sub-function that you can feed a point list to, for example:

 

(defun mklw (l / e)
   (entmakex (append (list (cons 0   "LWPOLYLINE")
                           (cons 100 "AcDbEntity")
                           (cons 100 "AcDbPolyline")
                           (cons 90 (length l))
                           (cons 70 1))
                     (mapcar (function (lambda (a) (cons 10 a))) l))))

-----------------------------------------------------------------

 

5. Instead of tons of 'nth' statements, you could use just one 'mapcar' statement when using 'mode_tile':

 

 (mode_tile "SUPPLY"    (nth  0 CMT#))
 (mode_tile "RETURN"    (nth  1 CMT#))
 (mode_tile "DUST"      (nth  2 CMT#))
 (mode_tile "EXHAUST"   (nth  3 CMT#))
 (mode_tile "NONE"      (nth  4 CMT#))
 (mode_tile "INTERNAL"  (nth  5 CMT#))
 (mode_tile "EXTERNAL"  (nth  6 CMT#))
 (mode_tile "BOTH"      (nth  7 CMT#))
 (mode_tile "LEFT"      (nth  8 CMT#))
 (mode_tile "RIGHT"     (nth  9 CMT#))
 (mode_tile "90"        (nth 10 CMT#))
 (mode_tile "60"        (nth 11 CMT#))
 (mode_tile "45"        (nth 12 CMT#))
 (mode_tile "30"        (nth 13 CMT#))
 (mode_tile "SHORT"     (nth 14 CMT#))
 (mode_tile "LONG"      (nth 15 CMT#))
 (mode_tile "LEFT-OFF"  (nth 16 CMT#))
 (mode_tile "MIDDLE"    (nth 17 CMT#))
 (mode_tile "RIGHT-OFF" (nth 18 CMT#))
 (mode_tile "10D"       (nth 19 CMT#))
 (mode_tile "15D"       (nth 20 CMT#))
 (mode_tile "20D"       (nth 21 CMT#))
 (mode_tile "30D"       (nth 22 CMT#))
 (mode_tile "LEFTOFF"   (nth 23 CMT#))
 (mode_tile "RIGHTOFF"  (nth 24 CMT#))

(mapcar (function mode_tile) '("SUPPLY" "RETURN" "DUST"...) CMT#)

-----------------------------------------------------------------

 

 

I'm not trying to criticise your program, just trying to offer possible improvements.

 

I hope this helps, if you have any questions about what I have posted, just ask.

 

Lee

 

 

Lee,

 

As always you have the best ideas. I did take some of the past ones and put them to use. I like these as well. Please do not feel you are being too critical.

On the RMD_SUS Function, I had kept it separate from the Main Function to avoid having the program loop back into saving the variables again each time the program loops. The user settings would then be changed and I did not want this to happen. So when I delared variables local I just placed them there.

 

The other stuff you mention I shall fix accordingly.

 

Thanks for all this.

Posted
Lee,

 

As always you have the best ideas. I did take some of the past ones and put them to use. I like these as well. Please do not feel you are being too critical.

On the RMD_SUS Function, I had kept it separate from the Main Function to avoid having the program loop back into saving the variables again each time the program loops. The user settings would then be changed and I did not want this to happen. So when I delared variables local I just placed them there.

 

The other stuff you mention I shall fix accordingly.

 

Thanks for all this.

 

Not a problem, happy to offer my suggestions.

 

Regarding the localising of variables, the way I would look at it is to determine which variables are only referenced within certain functions and localise those within that function.

 

With the remaining variables that you have referenced throughout your functions, I would localise these under the main function, i.e. c:XXX (/ here)

 

But, really, whatever works for you, as long all variables (except globals) are set to nil after/before the program completes/begins.

 

Lee

Posted
Not a problem, happy to offer my suggestions.

 

Regarding the localising of variables, the way I would look at it is to determine which variables are only referenced within certain functions and localise those within that function.

 

With the remaining variables that you have referenced throughout your functions, I would localise these under the main function, i.e. c:XXX (/ here)

 

But, really, whatever works for you, as long all variables (except globals) are set to nil after/before the program completes/begins.

 

Lee

 

That's funny, Because I can remember doing it that way a couple of years ago. I am not sure why I change that.

 

In anycase I will implement your suggestions some sooner and others later when I get a full understanding of everything I need to do.

 

I glad this program has some redeemable qualities.

 

Thanks,

The Buzzard

Posted

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::lol::lol::lol:

Reg Llama of Brixton.jpg

Posted

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                                       [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))
;
;/////////////////////////////////////////////////////////////////////////////////////////

Posted
Error:bad argument type: 2D/3D point: nil

 

Which change caused this error? And what code did you use?

Posted

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

Posted
Which change caused this error? And what code did you use?

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...