For some reason, this routine won't run, it calls it and stops; The following shows it in my acad.lsp, my menu.mns, the routine itself (of which I did not write), and what happens at the command line:
the acad.lsp:
(autoload "C:/Program Files/AutoCAD 2002/Support/cenlin.lsp" ' ("ce") )
the menu.mns:
[Center Line]^C^C_ce
The routine:
(DEFUN ERR_CENL_SRT (msg)
(setq *error* olderr)
(if (not stlerr)
(princ)
)
(if osn(setvar "osmode" osn))
(if cmd(setvar "cmdecho" cmd))
(if blp(setvar "blipmode" blp))
(if clr(setvar "cecolor" clr))
(if lay(setvar "clayer" lay))
(if ltyp(setvar "celtype" ltyp))
(if ltypsc(setvar "celtscale" ltypsc))
(if sph1(command "._erase" sph1 ""))
(princ)
)
(DEFUN SETTILE1_CENL_SRT ()
(if (= "1" (get_tile "stylea"))
(setq stylea2 1)
(setq stylea2 6)
)
(if (= "1" (get_tile "styleb"))
(setq styleb2 1)
(setq styleb2 6)
)
(if (= "1" (get_tile "proponce"))
(progn
(setq proponce2 1)
(set_tile "proptxtce" "Use cline properties")
)
(setq proponce2 6)
)
(if (= "1" (get_tile "propoffce"))
(progn
(setq propoffce2 1)
(set_tile "proptxtce" "Use cad properties")
)
(setq propoffce2 6)
)
)
(DEFUN SETTILE2_CENL_SRT ()
(if (= "1" (get_tile "stylea"))
(progn
(mode_tile "splscale" 1)
(mode_tile "sndlscale" 1)
)
)
(if (= "1" (get_tile "styleb"))
(progn
(mode_tile "splscale" 0)
(mode_tile "sndlscale" 0)
)
)
)
(DEFUN SETTILE3_CENL_SRT ()
(if (= "1" (get_tile "defstylea"))
(setq defstylea2 1)
(setq defstylea2 6)
)
(if (= "1" (get_tile "defstyleb"))
(setq defstyleb2 1)
(setq defstyleb2 6)
)
(if (= "1" (get_tile "defproponce"))
(setq defproponce2 1)
(setq defproponce2 6)
)
(if (= "1" (get_tile "defpropoffce"))
(setq defpropoffce2 1)
(setq defpropoffce2 6)
)
(if (= "1" (get_tile "defreactcenl"))
(setq defreactcenl2 1)
(setq defreactcenl2 6)
)
(if (= "1" (get_tile "defcenterot"))
(setq defcenterot2 1)
(setq defcenterot2 6)
)
(if (= "1" (get_tile "defcenterlay"))
(setq defcenterlay2 1)
(setq defcenterlay2 6)
)
(if (= "1" (get_tile "defcengroup"))
(setq defcengroup2 1)
(setq defcengroup2 6)
)
)
(DEFUN SETTILE4_CENL_SRT ()
(if (= "1" (get_tile "proponce"))
(progn
(set_tile "centerlaylt"(nth(atoi layercenl3)listcenlay))
(set_tile "centerlinelt"(nth(atoi ltypecenl3)listcenltype))
(set_tile "centerlineltsc" scalcenl3)
(mode_tile "centerprop" 0)
)
)
(if (= "1" (get_tile "propoffce"))
(progn
(mode_tile "centerprop" 1)
(set_tile "centerlaylt" lay)
(set_tile "centerlinelt" ltyp)
(set_tile "centerlineltsc" (rtos ltypsc 2 2))
)
)
)
(DEFUN SETTILE5_CENL_SRT ()
(if (= "1" (get_tile "reactcenl"))
(setq reactcenl2 1)
(setq reactcenl2 6)
)
(if (= "1" (get_tile "centerot"))
(setq centerot2 1)
(setq centerot2 6)
)
(if (= "1" (get_tile "centerlay"))
(setq centerlay2 1)
(setq centerlay2 6)
)
(if (= "1" (get_tile "cengroup"))
(setq cengroup2 1)
(setq cengroup2 6)
)
)
(DEFUN ROMO_CENL_SRT ( );;/ rd2 rt1)
(setvar "osmode" 0)
(setvar "cecolor" "7")
(setq spd(* aradius 0.125))
(if (wcmatch (getvar "acadver") "14*,15*")
(arxload "geom3d" [onfailure])
)
(if (wcmatch (getvar "acadver") "13*")
(progn
(if (/= geom3d2 1) (xload "geom3d"))
(setq geom3d2 1)
)
)
(command "_.sphere" pnt1 spd)
(setvar "cecolor" clr)
(setq sph1 (entlast))
(setvar "osmode" osn)
(setq pnt2 (getvar "lastpoint"))
(while
(or (initget 129 "Base Copy Move mIrror Rotate Scale")
(/= "" (setq rm1 (getkword "\nBase/Copy/Move/mIrror/Rotate/Scale: "))))
(cond
((= rm1 "Move")
(prompt "\nSecond point of displacement or enter distance:")
(command "._move" sscenline "" pnt1 pause)
(setq pnt1 (getvar "lastpoint"))
(setvar "osmode" 0)
(command "._move" sph1 "" pnt2 pnt1)
(setvar "osmode" osn)
(setq pnt2 pnt1)
)
((= rm1 "Base")
(while(= (setq pnt1(getpoint "\nPick Base Point:"))nil)(alert "\nPlease pick a point. "))
(command "._erase" sph1 "")
(setvar "cecolor" "7")
(command "._sphere" pnt1 spd)
(setvar "cecolor" clr)
(setq sph1 (entlast))
(setq pnt2 pnt1)
)
((= rm1 "Scale")
(prompt "\nSecond point or Scale factor:")
(command "._scale" sscenline "" pnt1 pause)
(setq pnt1 (getvar "lastpoint"))
)
((= rm1 "mIrror")
(while
(= (setq pnt1m (getpoint "\nPick 1st. point of mirror line: ")) nil)
(alert "\nPlease pick a point. ")
)
(while
(= (setq pnt2m (getpoint pnt1m "\nPick 2nd. point: ")) nil)
(alert "\nPlease pick a point. ")
)
(command "._mirror" sscenline "" pnt1m pnt2m "n")
)
((= rm1 "Rotate")
(initget "Define 22.5 30 45 90 180 ")
(setq rd1 (getkword "\nRotation degrees: Define/22.5/30/45/<90>/180: "))
(if(or (= rd1 "") (null rd1))
(setq rd1 "90")
)
(setq rd2 (atof rd1))
(if (= rd1 "Define")
(setq rd2 (getreal "\nRotation Angle: "))
)
(while
(or
(initget 129 "X Y Z")
(/= ""
(setq rt1 (getkword "\nRotate center line: X/Y/Z: "))
)
)
(rotate3d sscenline rt1 pnt1 rd2)
)
)
((= rm1 "Copy")
(prompt "\nSecond point of displacement or enter distance:")
(setq a (entlast))
(command "._copy" sscenline "" pnt1 pause)
(setq pnt1 (getvar "lastpoint"))
(setvar "osmode" 0)
(command "._move" sph1 "" pnt2 pnt1)
(setvar "osmode" osn)
(setq pnt2 pnt1)
(setq sscenline (ssadd))
(while(setq b(entnext a))
(ssadd b sscenline)
(setq a b)
)
)
)
)
(command "._erase" sph1 "")
(setq olderr *error*
*error* err_cenl_srt)
)
(DEFUN TLISTCENL1_CENL_SRT( )
(setq tlistcenl1 (list
"1/8 of radius"
"1/4 of radius"
"3/8 of radius"
"1/2 of radius"
"5/8 of radius"
"3/4 of radius"
"7/8 of radius"
"1 of radius"
"1.1/8 of radius"
"1.1/4 of radius"
"1.3/8 of radius"
"1.1/2 of radius"
"1.5/8 of radius"
"1.3/4 of radius"
"1.7/8 of radius"
"2 of radius"
))
(start_list "fstlscale")
(mapcar 'add_list tlistcenl1)
(end_list)
(if(or(= fstlscale3 nil)(> (atoi fstlscale3) 15))
(progn
(set_tile "fstlscale" rdstlscale)
(setq fstlscale3 rdstlscale)
)
(set_tile "fstlscale" fstlscale3)
)
)
(DEFUN TLISTCENL2_CENL_SRT( )
(setq tlistcenl2 (list
"1/8 of radius"
"1/4 of radius"
"3/8 of radius"
"1/2 of radius"
"5/8 of radius"
"3/4 of radius"
"7/8 of radius"
"1 of radius"
"1.1/8 of radius"
"1.1/4 of radius"
"1.3/8 of radius"
"1.1/2 of radius"
"1.5/8 of radius"
"1.3/4 of radius"
"1.7/8 of radius"
"2 of radius"
))
(start_list "sndlscale")
(mapcar 'add_list tlistcenl2)
(end_list)
(if(or(= sndlscale3 nil)(> (atoi sndlscale3) 15))
(progn
(set_tile "sndlscale" rdsndlscale)
(setq sndlscale3 rdsndlscale)
)
(set_tile "sndlscale" sndlscale3)
)
)
(DEFUN TLISTCENL3_CENL_SRT( )
(setq tlistcenl3 (list
"1/8 of radius"
"1/4 of radius"
"3/8 of radius"
"1/2 of radius"
"5/8 of radius"
"3/4 of radius"
"7/8 of radius"
"1 of radius"
"1.1/8 of radius"
"1.1/4 of radius"
"1.3/8 of radius"
"1.1/2 of radius"
"1.5/8 of radius"
"1.3/4 of radius"
"1.7/8 of radius"
"2 of radius"
))
(start_list "splscale")
(mapcar 'add_list tlistcenl3)
(end_list)
(if(or(= splscale3 nil)(> (atoi splscale3) 15))
(progn
(set_tile "splscale" rdsplscale)
(setq splscale3 rdsplscale)
)
(set_tile "splscale" splscale3)
)
)
(DEFUN TLISTREP1_CENL_SRT( )
(setq tlistrep1 (list "1""2""3""4""5""6""7""8""9""10""100"
))
(start_list "repeatcenl")
(mapcar 'add_list tlistrep1)
(end_list)
(if (or(= repeatcenl3 nil)(> (atoi repeatcenl3) 10))
(progn
(set_tile "repeatcenl" rdrepeatcenl)
(setq repeatcenl3 rdrepeatcenl)
)
(set_tile "repeatcenl" repeatcenl3)
)
)
(DEFUN CENTER_CENL_SRT ()
(setq olderr *error*
*error* err_cenl_srt)
(graphscr)
(setq osn(getvar "osmode"))
(setq cmd(getvar "cmdecho"))
(setq blp(getvar "blipmode"))
(setq lay(getvar "clayer"))
(setq clr(getvar "cecolor"))
(setq ltyp(getvar "celtype"))
(setq ltypsc(getvar "celtscale"))
(setvar "cmdecho" 0)
(setvar "blipmode" 0)
(if (< (setq undovar (getvar "undoctl")) 5);;sets undo to auto
(cond
((= undovar 0)(command "._undo" "_a"))
((< undovar 4)(command "._undo" "_c" "_a"))
)
)
(prop_read_cenl_srt)
(if (= (tblobjname "ltype" "HIDDEN") nil)(command "._linetype" "s" "HIDDEN" ""))
(if (= (tblobjname "ltype" "CENTER") nil)(command "._linetype" "s" "CENTER" ""))
(command "._linetype" "s" ltyp "")
(if (= (tblobjname "layer" rdcenllay) nil)
(progn
(if (wcmatch (getvar "acadver") "14*,15*")
(if (= (getvar "tilemode") 0)
(progn
(command "._vplayer" "newfrz" rdcenllay "")
(command "._vplayer" "thaw" rdcenllay "" "")
)
(command "._-layer" "_new" rdcenllay "")
)
)
(if(wcmatch (getvar "acadver") "13*")
(if (= (getvar "tilemode") 0)
(progn
(command "._vplayer" "newfrz" rdcenllay "")
(command "._vplayer" "thaw" rdcenllay "" "")
)
(command "._layer" "_new" rdcenllay "")
)
)
)
)
(setq dcl_id (load_dialog "cenlin.dcl"))
(if (not(new_dialog "cenlin" dcl_id))(exit))
(tlistcenl1_cenl_srt)
(tlistcenl2_cenl_srt)
(tlistcenl3_cenl_srt)
(tlistrep1_cenl_srt)
(centerimage3_cenl_srt)
(setq lt_type rdcenlltype)
(layvis_cenl_srt) ;;creates existing layer list
(layvisvar_cenl_srt);;checks for layer problems
(ltvis_cenl_srt) ;;creates existing linetype list
(ltvisvar_cenl_srt);;checks for linetype problems
(if(and(= stylea2 nil)(= styleb2 nil))
(progn
(if(= rdstylea "1")
(progn
(set_tile "stylea" "1")
(setq stylea2 1)
)
)
(if(= rdstyleb "1")
(progn
(set_tile "styleb" "1")
(setq styleb2 1)
)
)
)
)
(if (= stylea2 1)
(progn
(set_tile "stylea" "1")
(mode_tile "splscale" 1)
(mode_tile "sndlscale" 1)
)
)
(if (= styleb2 1)
(progn
(set_tile "styleb" "1")
(mode_tile "splscale" 0)
(mode_tile "sndlscale" 0)
)
)
(if(and(= proponce2 nil)(= propoffce2 nil))
(progn
(if(= rdproponce "1")
(progn
(set_tile "proponce" "1")
(setq proponce2 1)
)
)
(if(= rdpropoffce "1")
(progn
(set_tile "propoffce" "1")
(setq propoffce2 1)
)
)
)
)
(if (= proponce2 1)
(progn
(set_tile "proponce" "1")
(set_tile "proptxtce" "Use cline properties")
(mode_tile "centerprop" 0)
)
)
(if (= propoffce2 1)
(progn
(set_tile "propoffce" "1")
(set_tile "proptxtce" "Use cad properties")
(mode_tile "centerprop" 1)
)
)
(centimage1_cenl_srt)
(if(= centerot2 nil)(setq centerot2(atoi rdcenterot)))
(if(= reactcenl2 nil)(setq reactcenl2(atoi rdreactcenl)))
(if(= centerlay2 nil)(setq centerlay2(atoi rdcenterlay)))
(if(= cengroup2 nil)(setq cengroup2(atoi rdcengroup)))
(if(= scalcenl3 nil)(setq scalcenl3 rdcenltysc))
(if(=(distof scalcenl3) nil)(setq scalcenl3 rdcenltysc))
(if(= colorledcenl1 nil)
(progn
(setq colorledcenl1 rdcolorledcenl1)
(if(or(= colorledcenl1 "BYLAYER")(= colorledcenl1 "BYBLOCK"))
(progn
(if(= colorledcenl1 "BYLAYER")(setq colorledcenl1 256))
(if(= colorledcenl1 "BYBLOCK")(setq colorledcenl1 0))
)
(setq colorledcenl1 (atoi colorledcenl1))
)
)
)
(if(= proponce2 1)
(progn
(set_tile "centerlaylt"(nth(atoi layercenl3)listcenlay))
(set_tile "centerlinelt"(nth(atoi ltypecenl3)listcenltype))
(set_tile "centerlineltsc" scalcenl3)
)
)
(if(= propoffce2 1)
(progn
(set_tile "centerlaylt" lay)
(set_tile "centerlinelt" ltyp)
(set_tile "centerlineltsc" (rtos ltypsc 2 2))
)
)
(settile7_cenl_srt)
(setq can1cenl1(get_tile "stylea"))
(setq can1cenl2(get_tile "styleb"))
(setq can1cenl3 fstlscale3)
(setq can1cenl4 splscale3)
(setq can1cenl5 sndlscale3)
(setq can1cenl6(get_tile "proponce"))
(setq can1cenl7(get_tile "propoffce"))
(setq can1cenl8 repeatcenl3)
(action_tile "stylea" "(setq stylea2 1)(settile1_cenl_srt)(settile2_cenl_srt) (centimage1_cenl_srt)")
(action_tile "styleb" "(setq styleb2 1)(settile1_cenl_srt)(settile2_cenl_srt) (centimage1_cenl_srt)")
(action_tile "propoffce" "(setq propoffce2 1)(settile1_cenl_srt)(settile4_cenl_srt)(settile7_cenl_srt)")
(action_tile "proponce" "(setq proponce2 1)(settile1_cenl_srt)(settile4_cenl_srt)(settile7_cenl_srt)")
(action_tile "fstlscale" "(setq fstlscale3 $value)")
(action_tile "splscale" "(setq splscale3 $value)")
(action_tile "sndlscale" "(setq sndlscale3 $value)")
(action_tile "repeatcenl" "(setq repeatcenl3 $value)")
(action_tile "centerdefault" "(setprop_cenl_srt)")
(action_tile "misc-cl" "(misccline_cenl_srt)")
(action_tile "infocenter" "(infocen_cenl_srt)")
(action_tile "centerprop" "(properties_cenl_srt)")
(action_tile "accept" " ")
(action_tile "cancel" "(cancel1cenl_cenl_srt)(settile1_cenl_srt)")
(action_tile "help" "(cenlhelp_cenl_srt)")
(if(=(start_dialog)1)(clinerun_cenl_srt))
(unload_dialog dcl_id)
)
(DEFUN CANCEL1CENL_CENL_SRT ( )
(set_tile "stylea" can1cenl1)
(set_tile "styleb" can1cenl2)
(setq fstlscale3 can1cenl3)
(setq splscale3 can1cenl4)
(setq sndlscale3 can1cenl5)
(set_tile "proponce" can1cenl6)
(set_tile "propoffce" can1cenl7)
(setq repeatcenl3 can1cenl8)
)
(DEFUN CENLHELP_CENL_SRT ( )
(help "cenlin.hlp")
)
(DEFUN INFOCEN_CENL_SRT ( )
(if (not (new_dialog "infocenter" dcl_id))(exit))
(centerimage2_cenl_srt)
(start_dialog)
)
(DEFUN MISCCLINE_CENL_SRT ( )
(if (not (new_dialog "misccline" dcl_id))(exit))
(if (= centerot2 1)
(set_tile "centerot" "1")
(setq centerot2 6)
)
(if (= reactcenl2 1)
(set_tile "reactcenl" "1")
(setq reactcenl2 6)
)
(if (= centerlay2 1)
(set_tile "centerlay" "1")
(setq centerlay2 6)
)
(if (= cengroup2 1)
(set_tile "cengroup" "1")
(setq cengroup2 6)
)
(if(= scalcenl3 nil)(setq scalcenl3 rdcenltysc))
(if(=(distof scalcenl3) nil)(setq scalcenl3 rdcenltysc))
(setq can6cenl1(get_tile "centerot"))
(setq can6cenl2(get_tile "centerlay"))
(setq can6cenl3(get_tile "cengroup"))
(setq can6cenl4(get_tile "reactcenl"))
(action_tile "reactcenl" "(setq reactcenl2 1)(settile5_cenl_srt)")
(action_tile "centerot" "(setq centerot2 1)(settile5_cenl_srt)")
(action_tile "centerlay" "(setq centerlay2 1)(settile5_cenl_srt)")
(action_tile "cengroup" "(setq cengroup2 1)(settile5_cenl_srt)")
(action_tile "accept" " ")
(action_tile "cancel" "(cancel6cenl_cenl_srt)(settile5_cenl_srt)")
(start_dialog)
)
(DEFUN CANCEL6CENL_CENL_SRT ( )
(set_tile "centerot" can6cenl1)
(set_tile "centerlay" can6cenl2)
(set_tile "cengroup" can6cenl3)
(set_tile "reactcenl" can6cenl4)
)
(DEFUN CENTIMAGE1_CENL_SRT( )
(if(= stylea2 1)(setq cenlpicture1 "cenlin(cenl1)"))
(if(= styleb2 1)(setq cenlpicture1 "cenlin(cenl2)"))
(start_image "imagecenl1")
(fill_image 0 0 (dimx_tile "imagecenl1")(dimy_tile "imagecenl1") 0)
(slide_image 0 0 (dimx_tile "imagecenl1")(dimy_tile "imagecenl1")cenlpicture1)
(end_image)
)
(DEFUN CENTERIMAGE2_CENL_SRT( )
(setq cenlpicture2 "cenlin(cenlogo)")
(start_image "cenllogo")
(fill_image 0 0 (dimx_tile "cenllogo")(dimy_tile "cenllogo") 0)
(slide_image 0 0 (dimx_tile "cenllogo")(dimy_tile "cenllogo")cenlpicture2)
(end_image)
)
(DEFUN CENTERIMAGE3_CENL_SRT( )
(setq cenlpicture3 "cenlin(cenl3)")
(start_image "imagetayd")
(fill_image 0 0 (dimx_tile "imagetayd")(dimy_tile "imagetayd") 0)
(slide_image 0 0 (dimx_tile "imagetayd")(dimy_tile "imagetayd")cenlpicture3)
(end_image)
)
(DEFUN PROP_READ_CENL_SRT ( )
(setq centerprop (open (findfile "cenlin.txt")"r"))
(setq rdcolorledcenl1(read-line centerprop));;sets default centerline color
(setq rdcenllay(read-line centerprop));;sets default centerline layer
(setq rdcenlltype(read-line centerprop));;sets default centerline linetype
(setq rdcenltysc (read-line centerprop));;sets default centerline linetypescale
(setq rdcenterot (read-line centerprop)) ;; sets default rotate toggle
(setq rdcenterlay (read-line centerprop)) ;; sets default layer toggle
(setq rdcengroup (read-line centerprop));; sets default group toggle
(setq rdreactcenl (read-line centerprop));; sets default react toggle
(setq rdstylea (read-line centerprop));; sets default react toggle
(setq rdstyleb (read-line centerprop));; sets default react toggle
(setq rdstlscale (read-line centerprop));; sets 1st line length
(setq rdsplscale (read-line centerprop));; sets space
(setq rdsndlscale (read-line centerprop));; sets 2nd line length
(setq rdproponce (read-line centerprop));; sets default prop on
(setq rdpropoffce (read-line centerprop));; sets default prop off
(setq rdrepeatcenl (read-line centerprop));; sets default repeat number
(setq retdf (close centerprop))
)
(DEFUN PROPERTIES_WRT_CENL_SRT ( );;all from set default properties dialog box
(setq centerpropw (open (findfile "cenlin.txt") "w"))
(write-line spcolorcenl3 centerpropw) ;; sets default centerline color
(write-line (strcase splayercenl3) centerpropw) ;; sets default layer
(write-line (strcase defltypecenl3) centerpropw) ;; sets default linetype
(write-line defltypescenl3 centerpropw) ;; sets default linetype scale
(write-line (itoa defcenterot2) centerpropw) ;; sets default rotate toggle
(write-line (itoa defcenterlay2) centerpropw) ;; sets default layer toggle
(write-line (itoa defcengroup2) centerpropw) ;; sets default group toggle
(write-line (itoa defreactcenl2) centerpropw) ;; sets default react toggle
(write-line (itoa defstylea2) centerpropw) ;; sets default style a
(write-line (itoa defstyleb2) centerpropw) ;; sets default style b
(write-line defstlscale3 centerpropw) ;; sets default 1st. line
(write-line defsplscale3 centerpropw) ;; sets default space
(write-line defsndlscale3 centerpropw) ;; sets default 2nd line
(write-line (itoa defproponce2) centerpropw) ;; sets default prop on
(write-line (itoa defpropoffce2) centerpropw) ;; sets default prop off
(write-line defrepeatcenl3 centerpropw) ;; sets default repeat function
(setq retdf (close centerpropw))
)
(DEFUN CENGROUP_CEN_SRT ( )
(setq cengzz(getvar "pickstyle"))
(if(= 0 cengzz)(setvar "pickstyle" 1))
(if(= 2 cengzz)(setvar "pickstyle" 3))
(command "-group" "" "*" "" sscenline "")
)
(DEFUN LAYVIS_CENL_SRT ( );;puts together layer list for list box
(setq ltlaycenl (tblnext "layer" T) listcenlay' ())
(while ltlaycenl
(if (/= (logand 16 (cdr (assoc 70 ltlaycenl))) 16);;separates out any xref
(progn
(setq laytycenl1 (cdr (assoc 2 ltlaycenl)))
(setq listcenlay (cons laytycenl1 listcenlay))
)
)
(setq ltlaycenl (tblnext "layer"))
)
(setq listcenlay (acad_strlsort listcenlay))
(start_list "layercenl")
(mapcar 'add_list listcenlay)
(end_list)
)
(DEFUN LAYVISVAR_CENL_SRT ( );;checks layer for a number of problems
(if(= layercenl3 nil);;if layer list number is nil set # to "rdcenllay"
(progn
(setq layblst13(length listcenlay))
(setq layblst12(member rdcenllay listcenlay))
(setq layblst12 (length layblst12))
(setq layblst14 (- layblst13 layblst12))
(setq layercenl3 (itoa layblst14))
)
)
(if(= clayercenl nil)(setq clayercenl(nth(atoi layercenl3)listcenlay)));;if layer name is nil set to "0"
(if(=(member clayercenl listcenlay) nil) ;;if current layer name got deleted by a purge or undo set layer to "0"
(progn
(setq layblst13(length listcenlay))
(setq layblst12(member "0" listcenlay))
(setq layblst12 (length layblst12))
(setq layblst14 (- layblst13 layblst12))
(setq layercenl3 (itoa layblst14))
)
(progn ;;if layer got added that resets counter this will set counter to current layer
(setq layblst13(length listcenlay))
(setq layblst12(member clayercenl listcenlay))
(setq layblst12 (length layblst12))
(setq layblst14 (- layblst13 layblst12))
(setq layercenl3 (itoa layblst14))
)
)
)
(DEFUN LTVIS_CENL_SRT ( ) ;;puts together visible linetype list for list box
(setq ltvis (tblnext "ltype" T) listcenltype' ())
(while ltvis
(if (/= (logand 16 (cdr (assoc 70 ltvis))) 16);;seperates out any xref
(progn
(setq ltype1 (cdr (assoc 2 ltvis)))
(setq listcenltype (cons ltype1 listcenltype))
)
)
(setq ltvis (tblnext "ltype"))
)
(setq laybov1(list(cdr(assoc 2(tblsearch "ltype" "bylayer")))))
(setq laybov2(list(cdr(assoc 2(tblsearch "ltype" "byblock")))))
(setq listcenltype (append laybov1 listcenltype))
(setq listcenltype (append laybov2 listcenltype))
(setq listcenltype (acad_strlsort listcenltype))
(start_list "ltypecenl")
(mapcar 'add_list listcenltype)
(end_list)
)
(DEFUN LTVISVAR_CENL_SRT ( );;checks linetype for a number of problems
(if(= ltypecenl3 nil);;if ltype list number is nil set # to "lt_type"
(progn
(setq vislst13(length listcenltype))
(setq vislst12(member lt_type listcenltype))
(setq vislst12(length vislst12))
(setq vislst14(- vislst13 vislst12))
(setq ltypecenl3(itoa vislst14))
)
)
(if(= lintpcenl nil)(setq lintpcenl(nth(atoi ltypecenl3)listcenltype)));;if ltype name is nil set to ltypecenl3 list number
(if(=(member lintpcenl listcenltype) nil) ;;if current ltype name got deleted by a purge or undo set linetype to "continuous"
(progn
(setq vislst13(length listcenltype))
(setq lt_typetestv(cdr(assoc 2(tblsearch "ltype" "continuous"))))
(setq vislst12(member lt_typetestv listcenltype))
(setq vislst12 (length vislst12))
(setq vislst14 (- vislst13 vislst12))
(setq ltypecenl3 (itoa vislst14))
)
(progn ;;if ltype got added that resets counter this will set counter to current ltype
(setq vislst13(length listcenltype))
(setq vislst12(member lintpcenl listcenltype))
(setq vislst12 (length vislst12))
(setq vislst14 (- vislst13 vislst12))
(setq ltypecenl3 (itoa vislst14))
)
)
)
(DEFUN PROPERTIES_CENL_SRT ( )
(if(not(new_dialog "propercenl" dcl_id))(exit))
(settile8_cenl_srt)
(layvis_cenl_srt)
(ltvis_cenl_srt)
(set_tile "layercenl" layercenl3)
(set_tile "ltypecenl" ltypecenl3)
(set_tile "scalcenl" scalcenl3)
(setq can2cenl1 colorledcenl1)
(setq can2cenl2 layercenl3)
(setq can2cenl3 ltypecenl3)
(setq can2cenl4 scalcenl3)
(action_tile "layercenl" "(setq layercenl3 $value)(color2_cenl_srt)")
(action_tile "ltypecenl" "(setq ltypecenl3 $value)")
(action_tile "scalcenl" "(setq scalcenl3 $value)")
(action_tile "centercol" "(color1_cenl_srt)(setq colorledcenl1 (color_cenl1_srt))")
(action_tile "colorcenl" "(setq colorcenl2 1)")
(action_tile "f_colorcenl" "(color1_cenl_srt)(setq colorledcenl1 (color_cenl1_srt))")
(action_tile "centerdefault" "(setprop_cenl_srt)")
(action_tile "accept" "(test_prop1_cenl_srt)")
(action_tile "cancel" "(cancelcenl2_cenl_srt)")
(start_dialog)
(set_tile "centerlaylt"(nth(atoi layercenl3)listcenlay))
(set_tile "centerlinelt"(nth(atoi ltypecenl3)listcenltype))
(set_tile "centerlineltsc" scalcenl3)
(settile7_cenl_srt)
)
(DEFUN CANCELCENL2_CENL_SRT ( )
(setq colorledcenl1 can2cenl1)
(setq layercenl3 can2cenl2)
(setq ltypecenl3 can2cenl3)
(setq scalcenl3 can2cenl4)
)
(DEFUN TLISTCENL4_CENL_SRT( )
(setq tlistcenl4 (list
"1/8 of radius"
"1/4 of radius"
"3/8 of radius"
"1/2 of radius"
"5/8 of radius"
"3/4 of radius"
"7/8 of radius"
"1 of radius"
"1.1/8 of radius"
"1.1/4 of radius"
"1.3/8 of radius"
"1.1/2 of radius"
"1.5/8 of radius"
"1.3/4 of radius"
"1.7/8 of radius"
"2 of radius"
))
(start_list "defstlscale")
(mapcar 'add_list tlistcenl4)
(end_list)
(if(or(= defstlscale3 nil)(> (atoi defstlscale3) 15))
(progn
(set_tile "defstlscale" rdstlscale)
(setq defstlscale3 rdstlscale)
)
(set_tile "defstlscale" defstlscale3)
)
)
(DEFUN TLISTCENL5_CENL_SRT( )
(setq tlistcenl5 (list
"1/8 of radius"
"1/4 of radius"
"3/8 of radius"
"1/2 of radius"
"5/8 of radius"
"3/4 of radius"
"7/8 of radius"
"1 of radius"
"1.1/8 of radius"
"1.1/4 of radius"
"1.3/8 of radius"
"1.1/2 of radius"
"1.5/8 of radius"
"1.3/4 of radius"
"1.7/8 of radius"
"2 of radius"
))
(start_list "defsplscale")
(mapcar 'add_list tlistcenl5)
(end_list)
(if(or(= defsplscale3 nil)(> (atoi defsplscale3) 15))
(progn
(set_tile "defsplscale" rdsplscale)
(setq defsplscale3 rdsplscale)
)
(set_tile "defsplscale" defsplscale3)
)
)
(DEFUN TLISTCENL6_CENL_SRT( )
(setq tlistcenl6 (list
"1/8 of radius"
"1/4 of radius"
"3/8 of radius"
"1/2 of radius"
"5/8 of radius"
"3/4 of radius"
"7/8 of radius"
"1 of radius"
"1.1/8 of radius"
"1.1/4 of radius"
"1.3/8 of radius"
"1.1/2 of radius"
"1.5/8 of radius"
"1.3/4 of radius"
"1.7/8 of radius"
"2 of radius"
))
(start_list "defsndlscale")
(mapcar 'add_list tlistcenl6)
(end_list)
(if(or(= defsndlscale3 nil)(> (atoi defsndlscale3) 15))
(progn
(set_tile "defsndlscale" rdsndlscale)
(setq defsndlscale3 rdsndlscale)
)
(set_tile "defsndlscale" defsndlscale3)
)
)
(DEFUN TLISTREP2_CENL_SRT( )
(setq tlistrep2 (list "1""2""3""4""5""6""7""8""9""10""100"
))
(start_list "defrepeatcenl")
(mapcar 'add_list tlistrep2)
(end_list)
(if (or(= defrepeatcenl3 nil)(> (atoi defrepeatcenl3) 10))
(progn
(set_tile "defrepeatcenl" rdrepeatcenl)
(setq defrepeatcenl3 rdrepeatcenl)
)
(set_tile "defrepeatcenl" defrepeatcenl3)
)
)
(DEFUN SETPROP_CENL_SRT ( );;default properties dialog box
(if(not(new_dialog "setpropcenl" dcl_id))(exit))
(tlistcenl4_cenl_srt)
(tlistcenl5_cenl_srt)
(tlistcenl6_cenl_srt)
(tlistrep2_cenl_srt)
(if(= spcolorcenl3 nil)(setq spcolorcenl3 rdcolorledcenl1))
(if(= splayercenl3 nil)(setq splayercenl3 rdcenllay))
(if(= defltypecenl3 nil)(setq defltypecenl3 rdcenlltype))
(if(= defltypescenl3 nil)(setq defltypescenl3 rdcenltysc))
(if(= defreactcenl2 nil)(setq defreactcenl2(atoi rdreactcenl)))
(if(= defcenterot2 nil)(setq defcenterot2(atoi rdcenterot)))
(if(= defcenterlay2 nil)(setq defcenterlay2(atoi rdcenterlay)))
(if(= defcengroup2 nil)(setq defcengroup2(atoi rdcengroup)))
(if(= defstylea2 nil)(setq defstylea2(atoi rdstylea)))
(if(= defstyleb2 nil)(setq defstyleb2(atoi rdstyleb)))
(if(= defproponce2 nil)(setq defproponce2(atoi rdproponce)))
(if(= defpropoffce2 nil)(setq defpropoffce2(atoi rdpropoffce)))
(set_tile "spcolorcenl" spcolorcenl3)
(set_tile "splayercenl" splayercenl3)
(set_tile "defltypecenl" defltypecenl3)
(set_tile "defltypescenl" defltypescenl3)
(if(= defstylea2 1)(set_tile "defstylea" "1"))
(if(= defstyleb2 1)(set_tile "defstyleb" "1"))
(if(= defproponce2 1)(set_tile "defproponce" "1"))
(if(= defpropoffce2 1)(set_tile "defpropoffce" "1"))
(if(= defreactcenl2 1)
(set_tile "defreactcenl" "1")
(setq defreactcenl2 6)
)
(if(= defcenterot2 1)
(set_tile "defcenterot" "1")
(setq defcenterot2 6)
)
(if(= defcenterlay2 1)
(set_tile "defcenterlay" "1")
(setq defcenterlay2 6)
)
(if(= defcengroup2 1)
(set_tile "defcengroup" "1")
(setq defcengroup2 6)
)
(setq can3cenl1 spcolorcenl3)
(setq can3cenl2 splayercenl3)
(setq can3cenl3 defltypecenl3)
(setq can3cenl4 defltypescenl3)
(setq can3cenl5(get_tile "defcenterot"))
(setq can3cenl6(get_tile "defcenterlay"))
(setq can3cenl7(get_tile "defcengroup"))
(setq can3cenl8(get_tile "defreactcenl"))
(setq can3cenl9(get_tile "defstylea"))
(setq can3cenl10(get_tile "defstyleb"))
(setq can3cenl11 defstlscale3)
(setq can3cenl12 defsplscale3)
(setq can3cenl13 defsndlscale3)
(setq can3cenl14(get_tile "defproponce"))
(setq can3cenl15(get_tile "defpropoffce"))
(setq can3cenl16 defrepeatcenl3)
(action_tile "defstlscale" "(setq defstlscale3 $value)")
(action_tile "defsplscale" "(setq defsplscale3 $value)")
(action_tile "defsndlscale" "(setq defsndlscale3 $value)")
(action_tile "defstylea" "(setq defstylea2 1)(settile3_cenl_srt)")
(action_tile "defstyleb" "(setq defstyleb2 1)(settile3_cenl_srt)")
(action_tile "defproponce" "(setq defproponce2 1)(settile3_cenl_srt)")
(action_tile "defpropoffce" "(setq defpropoffce2 1)(settile3_cenl_srt)")
(action_tile "spcolorcenl" "(setq spcolorcenl3 $value)")
(action_tile "splayercenl" "(setq splayercenl3 $value)")
(action_tile "defltypecenl" "(setq defltypecenl3 $value)")
(action_tile "defltypescenl" "(setq defltypescenl3 $value)")
(action_tile "defreactcenl" "(setq defreactcenl2 1)(settile3_cenl_srt)")
(action_tile "defrepeatcenl" "(setq defrepeatcenl3 $value)")
(action_tile "defcenterot" "(setq defcenterot2 1)(settile3_cenl_srt)")
(action_tile "defcenterlay" "(setq defcenterlay2 1)(settile3_cenl_srt)")
(action_tile "defcengroup" "(setq defcengroup2 1)(settile3_cenl_srt)")
(action_tile "accept" "(test_prop2_cenl_srt)")
(action_tile "cancel" "(cancelcenl3_cenl_srt)(settile3_cenl_srt)
(properties_wrt_cenl_srt)")
(start_dialog)
)
(DEFUN CANCELCENL3_CENL_SRT ( )
(setq spcolorcenl3 can3cenl1)
(setq splayercenl3 can3cenl2)
(setq defltypecenl3 can3cenl3)
(setq defltypescenl3 can3cenl4)
(set_tile "defcenterot" can3cenl5)
(set_tile "defcenterlay" can3cenl6)
(set_tile "defcengroup" can3cenl7)
(set_tile "defreactcenl" can3cenl8)
(set_tile "defstylea" can3cenl9)
(set_tile "defstyleb" can3cenl10)
(setq defstlscale3 can3cenl11)
(setq defsplscale3 can3cenl12)
(setq defsndlscale3 can3cenl13)
(set_tile "defproponce" can3cenl14)
(set_tile "defpropoffce" can3cenl15)
(setq defrepeatcenl3 can3cenl16)
)
(DEFUN TEST_PROP1_CENL_SRT()
(cond
((not(< 0(distof scalcenl3)))
(set_tile "error" "Invalid shape linetype scale. Must be number > 0.")
(mode_tile "scalcenl" 2)
)
(if(= errtile "")(done_dialog 1))
)
)
(DEFUN TEST_PROP2_CENL_SRT()
(cond
((not(< 0(distof defltypescenl3)))
(set_tile "error" "Invalid linetype scale. Must be number > 0.")
(mode_tile "defltypescenl" 2)
)
((not (snvalid (get_tile "splayercenl")))
(set_tile "error" "Invalid layer name.")
(mode_tile "splayercenl" 2)
)
((not (and (< -0.009 (distof (get_tile "spcolorcenl")))(> 256.001 (distof (get_tile "spcolorcenl")))))
(set_tile "error" "Invalid center line color.")
(mode_tile "spcolorcenl" 2)
)
((if (and(/= (strcase(get_tile "defltypecenl")) "CONTINUOUS")
(/= (strcase(get_tile "defltypecenl")) "HIDDEN")
(/= (strcase(get_tile "defltypecenl")) "BYLAYER")
(/= (strcase(get_tile "defltypecenl")) "CENTER")
(/= (strcase(get_tile "defltypecenl")) "BYBLOCK"))
(progn
(set_tile "error" "Invalid linetype. Must be as listed above")
(mode_tile "defltypecenl" 2)
)
)
)
(if(= errtile "")(done_dialog 1))
)
(properties_wrt_cenl_srt)
)
(DEFUN COLOR1_CENL_SRT ( )
(setq clayercenl (nth (atoi layercenl3)listcenlay))
)
(DEFUN COLOR_CENL1_SRT ( )
(if colorledcenl1
(setq col_def colorledcenl1)
(setq col_def 1)
)
(setq lay_clr (cdr (assoc 62 (tblsearch "layer" clayercenl))))
(if (numberp (setq temp_color (acad_colordlg col_def T lay_clr)))
(progn
(setq colorledcenl1 temp_color)
(settile8_cenl_srt)
colorledcenl1
)
colorledcenl1
)
)
(DEFUN SETTILE7_CENL_SRT ( )
(if(= proponce2 1)
(progn
(cond
((= colorledcenl1 0)
(set_tile "colorcolt" "BYBLOCK")
(col_tile_cenl_srt "fill_colorcolt" 7 nil)
)
((= colorledcenl1 1)
(set_tile "colorcolt" "1 red")
(col_tile_cenl_srt "fill_colorcolt" 1 nil)
)
((= colorledcenl1 2)
(set_tile "colorcolt" "2 yellow")
(col_tile_cenl_srt "fill_colorcolt" 2 nil)
)
((= colorledcenl1 3)
(set_tile "colorcolt" "3 green")
(col_tile_cenl_srt "fill_colorcolt" 3 nil)
)
((= colorledcenl1 4)
(set_tile "colorcolt" "4 cyan")
(col_tile_cenl_srt "fill_colorcolt" 4 nil)
)
((= colorledcenl1 5)
(set_tile "colorcolt" "5 blue")
(col_tile_cenl_srt "fill_colorcolt" 5 nil)
)
((= colorledcenl1 6)
(set_tile "colorcolt" "6 magenta")
(col_tile_cenl_srt "fill_colorcolt" 6 nil)
)
((= colorledcenl1 7)
(set_tile "colorcolt" "7 white")
(col_tile_cenl_srt "fill_colorcolt" 7 nil)
)
((= colorledcenl1 256)
(set_tile "colorcolt" (bylayer_col_cenl_srt))
(col_tile_cenl_srt "fill_colorcolt" cn nil)
)
(T
(set_tile "colorcolt" (itoa colorledcenl1))
(col_tile_cenl_srt "fill_colorcolt" colorledcenl1 nil)
)
)
)
)
(if(= propoffce2 1)
(progn
(cond
((= clr "BYBLOCK")
(set_tile "colorcolt" "BYBLOCK")
(col_tile_cenl_srt "fill_colorcolt" 7 nil)
)
((= (atoi clr) 1)
(set_tile "colorcolt" "1 red")
(col_tile_cenl_srt "fill_colorcolt" 1 nil)
)
((= (atoi clr) 2)
(set_tile "colorcolt" "2 yellow")
(col_tile_cenl_srt "fill_colorcolt" 2 nil)
)
((= (atoi clr) 3)
(set_tile "colorcolt" "3 green")
(col_tile_cenl_srt "fill_colorcolt" 3 nil)
)
((= (atoi clr) 4)
(set_tile "colorcolt" "4 cyan")
(col_tile_cenl_srt "fill_colorcolt" 4 nil)
)
((= (atoi clr) 5)
(set_tile "colorcolt" "5 blue")
(col_tile_cenl_srt "fill_colorcolt" 5 nil)
)
((= (atoi clr) 6)
(set_tile "colorcolt" "6 magenta")
(col_tile_cenl_srt "fill_colorcolt" 6 nil)
)
((= (atoi clr) 7)
(set_tile "colorcolt" "7 white")
(col_tile_cenl_srt "fill_colorcolt" 7 nil)
)
((= clr "BYLAYER")
(set_tile "colorcolt" (bylayer2_col_cenl_srt))
(col_tile_cenl_srt "fill_colorcolt" cn nil)
)
(T
(set_tile "colorcolt" clr)
(col_tile_cenl_srt "fill_colorcolt" (atoi clr) nil)
)
)
)
)
)
(DEFUN SETTILE8_CENL_SRT ( )
(cond
((= colorledcenl1 0)
(set_tile "colorcenl" "BYBLOCK")
(col_tile_cenl_srt "f_colorcenl" 7 nil)
)
((= colorledcenl1 1)
(set_tile "colorcenl" "1 red")
(col_tile_cenl_srt "f_colorcenl" 1 nil)
)
((= colorledcenl1 2)
(set_tile "colorcenl" "2 yellow")
(col_tile_cenl_srt "f_colorcenl" 2 nil)
)
((= colorledcenl1 3)
(set_tile "colorcenl" "3 green")
(col_tile_cenl_srt "f_colorcenl" 3 nil)
)
((= colorledcenl1 4)
(set_tile "colorcenl" "4 cyan")
(col_tile_cenl_srt "f_colorcenl" 4 nil)
)
((= colorledcenl1 5)
(set_tile "colorcenl" "5 blue")
(col_tile_cenl_srt "f_colorcenl" 5 nil)
)
((= colorledcenl1 6)
(set_tile "colorcenl" "6 magenta")
(col_tile_cenl_srt "f_colorcenl" 6 nil)
)
((= colorledcenl1 7)
(set_tile "colorcenl" "7 white")
(col_tile_cenl_srt "f_colorcenl" 7 nil)
)
((= colorledcenl1 256)
(set_tile "colorcenl" (bylayer_col_cenl_srt))
(col_tile_cenl_srt "f_colorcenl" cn nil)
)
(T
(set_tile "colorcenl" (itoa colorledcenl1))
(col_tile_cenl_srt "f_colorcenl" colorledcenl1 nil)
)
)
)
(DEFUN COLOR2_CENL_SRT ( )
(if(= colorledcenl1 256)
(progn
(set_tile "colorcenl" (bylayer1_col_cenl_srt))
(col_tile_cenl_srt "f_colorcenl" cn nil)
)
)
)
(DEFUN BYLAYER_COL_CENL_SRT (/ layname layinfo color)
(setq layinfo (tblsearch "layer" clayercenl));;searches layer for color
(setq color (abs (cdr (assoc 62 layinfo))));;returns layer color
(setq cn color);;sets cn to layer color
(strcat "BYLAYER" "("(colorname_cenl_srt color)")");;creates line(BYLAYER white)
)
(DEFUN BYLAYER1_COL_CENL_SRT (/ layname layinfo color)
(setq testlaycenl (nth (atoi layercenl3) listcenlay))
(setq layinfo (tblsearch "layer" testlaycenl));;searches layer for color
(setq color (abs (cdr (assoc 62 layinfo))));;returns layer color
(setq cn color);;sets cn to layer color
(strcat "BYLAYER" "("(colorname_cenl_srt color)")");;creates line(BYLAYER white)
)
(DEFUN BYLAYER2_COL_CENL_SRT (/ layname layinfo color)
(setq layinfo (tblsearch "layer" lay));;searches layer for color
(setq color (abs (cdr (assoc 62 layinfo))));;returns layer color
(setq cn color);;sets cn to layer color
(strcat "BYLAYER" "("(colorname_cenl_srt color)")");;creates line(BYLAYER white)
)
(DEFUN COLORNAME_CENL_SRT (colnum)
(setq cn (abs colnum))
(cond ((= cn 1) "red")
((= cn 2) "yellow")
((= cn 3) "green")
((= cn 4) "cyan")
((= cn 5) "blue")
((= cn 6) "magenta")
((= cn 7) "white")
(T (itoa cn))
)
)
(DEFUN COL_TILE_CENL_SRT (tile color patlist / x y)
(setq x (dimx_tile tile))
(setq y (dimy_tile tile))
(start_image tile)
(fill_image 0 0 x y color)
(if (= color 7)
(progn
(if patlist (drawpattern x (/ y 2) patlist 0))
(tile_rect_cenl_srt 0 0 x y 0)
)
(progn
(if patlist (drawpattern x (/ y 2) patlist 7))
(tile_rect_cenl_srt 0 0 x y 7)
)
)
(end_image)
)
(DEFUN TILE_RECT_CENL_SRT (x1 y1 x2 y2 color)
(setq x2 (- x2 1))
(setq y2 (- y2 1))
(vector_image x1 y1 x2 y1 color)
(vector_image x2 y1 x2 y2 color)
(vector_image x2 y2 x1 y2 color)
(vector_image x1 y2 x1 y1 color)
)
(DEFUN CLINERUN_CENL_SRT ( )
(command "._undo" "_begin")
(setq repcenter(nth(atoi repeatcenl3)tlistrep1))
(repeat(atoi repcenter)
(while
(or(= (setq aaenam (entsel "\nPick on object to place center line: ")) nil)
(and(/=(setq atype (cdr (assoc 0 (entget (car aaenam))))) "CIRCLE")
(/=(setq atype (cdr (assoc 0 (entget (car aaenam))))) "ARC")
(/=(setq atype (cdr (assoc 0 (entget (car aaenam))))) "ELLIPSE")
)
)
(alert "A circle, arc or ellipse must be picked. \nTry again: Esc key to exit.")
)
(setq atest(entget (car aaenam)))
(setvar "osmode" 0)
(if(= proponce2 1)(setvar "cecolor" (itoa colorledcenl1)))
(if(= propoffce2 1)(setvar "cecolor" clr))
(setq pnt1(cdr(assoc 10 atest)))
(setq bbenam(car aaenam))
(setq pnt1(trans pnt1 bbenam 1))
(setq aradius(cdr (assoc 40 atest)))
(setq clnlayer(cdr (assoc 8 atest)))
(if(= atype "ELLIPSE")
(progn
(setq elpradius(cdr(assoc 11 atest)))
(setq elpradius1(car elpradius))
(setq elpradius2(cadr elpradius))
(setq elpradius3(caddr elpradius))
(if(/= 0.0 elpradius1)(setq aradius elpradius1))
(if(/= 0.0 elpradius2)(setq aradius elpradius2))
(if(/= 0.0 elpradius3)(setq aradius elpradius3))
)
)
(setq clayercenl(nth(atoi layercenl3)listcenlay));;sets layer name picked from dialog box
(if(= centerlay2 1)
(setvar "clayer" clnlayer)
(progn
(if(= proponce2 1)(setvar "clayer" clayercenl))
(if(= propoffnce2 1)(setvar "clayer" lay))
)
)
(setq lintpcenl (nth(atoi ltypecenl3)listcenltype));;sets ltype name picked
(if(= proponce2 1)(setvar "celtype" lintpcenl))
(if(= propoffce2 1)(setvar "celtype" ltyp))
(if(= proponce2 1)(setvar "celtscale" (distof scalcenl3)))
(if(= propoffce2 1)(setvar "celtscale" ltypsc))
(if(= fstlscale3 "0")(setq scline1 (* aradius 0.125)));;sets first line length
(if(= fstlscale3 "1")(setq scline1 (* aradius 0.25)))
(if(= fstlscale3 "2")(setq scline1 (* aradius 0.375)))
(if(= fstlscale3 "3")(setq scline1 (* aradius 0.5)))
(if(= fstlscale3 "4")(setq scline1 (* aradius 0.625)))
(if(= fstlscale3 "5")(setq scline1 (* aradius 0.75)))
(if(= fstlscale3 "6")(setq scline1 (* aradius 0.875)))
(if(= fstlscale3 "7")(setq scline1 (* aradius 1.0)))
(if(= fstlscale3 "8")(setq scline1 (* aradius 1.125)))
(if(= fstlscale3 "9")(setq scline1 (* aradius 1.25)))
(if(= fstlscale3 "10")(setq scline1 (* aradius 1.375)))
(if(= fstlscale3 "11")(setq scline1 (* aradius 1.5)))
(if(= fstlscale3 "12")(setq scline1 (* aradius 1.625)))
(if(= fstlscale3 "13")(setq scline1 (* aradius 1.75)))
(if(= fstlscale3 "14")(setq scline1 (* aradius 1.875)))
(if(= fstlscale3 "15")(setq scline1 (* aradius 2.0)))
(if(= splscale3 "0")(setq scline2 (* aradius 0.125)));;sets space between lines
(if(= splscale3 "1")(setq scline2 (* aradius 0.25)))
(if(= splscale3 "2")(setq scline2 (* aradius 0.375)))
(if(= splscale3 "3")(setq scline2 (* aradius 0.5)))
(if(= splscale3 "4")(setq scline2 (* aradius 0.625)))
(if(= splscale3 "5")(setq scline2 (* aradius 0.75)))
(if(= splscale3 "6")(setq scline2 (* aradius 0.875)))
(if(= splscale3 "7")(setq scline2 (* aradius 1.0)))
(if(= splscale3 "8")(setq scline2 (* aradius 1.125)))
(if(= splscale3 "9")(setq scline2 (* aradius 1.25)))
(if(= splscale3 "10")(setq scline2 (* aradius 1.375)))
(if(= splscale3 "11")(setq scline2 (* aradius 1.5)))
(if(= splscale3 "12")(setq scline2 (* aradius 1.625)))
(if(= splscale3 "13")(setq scline2 (* aradius 1.75)))
(if(= splscale3 "14")(setq scline2 (* aradius 1.875)))
(if(= splscale3 "15")(setq scline2 (* aradius 2.0)))
(if(= sndlscale3 "0")(setq scline3 (* aradius 0.125)));;sets 2nd line length
(if(= sndlscale3 "1")(setq scline3 (* aradius 0.25)))
(if(= sndlscale3 "2")(setq scline3 (* aradius 0.375)))
(if(= sndlscale3 "3")(setq scline3 (* aradius 0.5)))
(if(= sndlscale3 "4")(setq scline3 (* aradius 0.625)))
(if(= sndlscale3 "5")(setq scline3 (* aradius 0.75)))
(if(= sndlscale3 "6")(setq scline3 (* aradius 0.875)))
(if(= sndlscale3 "7")(setq scline3 (* aradius 1.0)))
(if(= sndlscale3 "8")(setq scline3 (* aradius 1.125)))
(if(= sndlscale3 "9")(setq scline3 (* aradius 1.25)))
(if(= sndlscale3 "10")(setq scline3 (* aradius 1.375)))
(if(= sndlscale3 "11")(setq scline3 (* aradius 1.5)))
(if(= sndlscale3 "12")(setq scline3 (* aradius 1.625)))
(if(= sndlscale3 "13")(setq scline3 (* aradius 1.75)))
(if(= sndlscale3 "14")(setq scline3 (* aradius 1.875)))
(if(= sndlscale3 "15")(setq scline3 (* aradius 2.0)))
(setq pnt2(list(+(car pnt1)scline1)(cadr pnt1)(caddr pnt1)))
(setq pnt3(list(+(car pnt2)scline2)(cadr pnt2)(caddr pnt2)))
(setq pnt4(list(+(car pnt3)scline3)(cadr pnt3)(caddr pnt3)))
(setq a (entlast))
(command "line" pnt1 pnt2 "")
(setq ss1(entlast))
(if(= styleb2 1)
(progn
(command "line" pnt3 pnt4 "")
(setq ss2(entlast))
)
)
(setq ssarray (ssadd))
(ssadd ss1 ssarray)
(if(= styleb2 1)(ssadd ss2 ssarray))
(command "array" ssarray "" "p" pnt1 "4" "" "y")
(setq sscenline (ssadd))
(while(setq b(entnext a))
(ssadd b sscenline)
(setq a b)
)
(if(= cengroup2 1)(cengroup_cen_srt))
(if(= centerot2 1)(romo_cenl_srt))
);;closes repeat
(setvar "osmode" osn)
(setvar "cecolor" clr)
(setvar "clayer" lay)
(setvar "celtype" ltyp)
(setvar "celtscale" ltypsc)
(command "undo" "end")
(setvar "cmdecho" cmd)
(princ)
(if(= reactcenl2 1)(center_cenl_srt))
)
(DEFUN C:CE ( )
(center_cenl_srt)
)
(princ "\nType to run center line program")
AND finally, what happens at the command line after choosing it from the menu
Type to run center line program
Command:
Command: ce
Command:
Not sure why this is happening. Can anyone please help? Seems like it has worked in the past. I do have other things running and loaded but wouldn't think they would interfere. All my other routines are running just fin. Thanks for the help.