wengsg 发表于 2005-1-6 13:32:00

[求助]请大哥帮忙修改!

以下是建层程序,这是一个示例,麻烦帮忙修改.谢谢!


(defun c:jc ()<BR>       (initget "F S T")<BR>       (setq<BR>                       bb (getstring<BR>       "\n地质平面图(F),地质剖面图(T),地形地质图(S),&lt;F&gt;: "<BR>                                               )


                       (if<BR>                                       ((= bb "")<BR>        (setq bb "F")<BR>                                       )<BR>                                               (cond<BR>       ((= bb "F") (f_l))<BR>       ((= bb "T") (t_l))<BR>       ((= bb "S") (s_l))<BR>       (setq<BR>               bb<BR>               (strcase bb)<BR>               (defun<BR>                                       f_l<BR>                                                               ()<BR>                               (setvar "plinegen" 1)<BR>                               (command "layer"               "m"       "坐标线"       "c"                                       "6"<BR>                                               ""                                                       "l"       "ACAD_ISO02W100"                       ""<BR>                                               "lw"                                       "0.00"       ""                       ""<BR>                                       )<BR>                               (command "layer" "m" "文字" "c" "3" "" "")<BR>                               (command "layer" "m" "填充" "c" "2" "" "")<BR>                               (command "layer" "m" "视口" "c" "7" "" "p" "n" "" "")<BR>                               (command "layer" "m" "底图" "c" "7" "" "p" "n" "" "")<BR>                               (command "style" "ST" "宋体" 2.5 1.0 0 "N" "N")<BR>                               (command "-style" "HT" "黑体" 10.0 1.0 0 "N" "N")<BR>                               (command "draworder"<BR>                                               (SSGET "X" '((0 . "hatch")))<BR>                                               ""<BR>                                               "b"<BR>                               )<BR>                               ;;(8 . "填充")把填充这个图层排在最后<BR>                               (command "ortho" "on")<BR>                               ;;打开正交<BR>                               (command "limits")<BR>                               ;;(command "pline" "" "w" "0.8" "0.8" "" "" "")<BR>                               (prompt<BR>                                               "\n地质 Copyright(c) 2005 By WWL. All Right Reserved! \n请用JC命令!"<BR>                               )<BR>                               (princ)<BR>               )<BR>       )



       (defun<BR>               t_l<BR>               ()<BR>               (setvar "plinegen" 1)<BR>               (command "layer"               "m"                                               "坐标线"       "c"                       "6"<BR>                               ""                                       "l"                                               "ACAD_ISO02W100"                       ""<BR>                               "lw"                                       "0.00"                       ""       ""<BR>                       )<BR>               (command "layer" "m" "文字" "c" "3" "" "")<BR>               (command "layer" "m" "填充" "c" "2" "" "")<BR>               (command "layer" "m" "视口" "c" "7" "" "p" "n" "" "")<BR>               (command "layer" "m" "底图" "c" "7" "" "p" "n" "" "")<BR>               (command "style" "ST" "宋体" 2.5 1.0 0 "N" "N")<BR>               (command "-style" "HT" "黑体" 10.0 1.0 0 "N" "N")<BR>               (command "draworder"<BR>                               (SSGET "X" '((0 . "hatch")))<BR>                               ""<BR>                               "b"<BR>               )<BR>               (command "ortho" "on")<BR>               (command "limits")<BR>               (prompt<BR>                               "\n地质 Copyright(c) 2005 By WWL. All Right Reserved! \n请用JC命令!"<BR>               )<BR>               (princ)<BR>       )<BR>                                               )<BR>                       )


                               (defun<BR>                                                       s_l<BR>                       ()<BR>                                               (setvar "plinegen" 1)<BR>                                               ;;(setvar "OSMODE" 36)<BR>                                               (command        "layer"               "m"                               "坐标线"       "c"        "6"<BR>                ""               "l"                               "ACAD_ISO02W100"        ""<BR>                "lw"               "0.00"                       ""                                               ""<BR>                                                       )<BR>                                               (command "layer" "m" "文字" "c" "3" "" "")<BR>                                               (command "layer" "m" "填充" "c" "2" "" "")<BR>                                               (command "layer" "m" "视口" "c" "7" "" "p" "n" "" "")<BR>                                               (command "layer" "m" "底图" "c" "7" "" "p" "n" "" "")<BR>                                               (command "style" "ST" "宋体" 2.5 1.0 0 "N" "N")<BR>                                               (command "-style" "HT" "黑体" 10.0 1.0 0 "N" "N")


                                               (command        "draworder"<BR>                (SSGET "X" '((0 . "hatch")))<BR>                ""<BR>                "b"<BR>                                               )<BR>                                               (command "ortho" "on")


                                               (command "limits")<BR>                                               (prompt<BR>       "\n地质 Copyright(c) 2005 By WWL. All Right Reserved! \n请用JC命令!"<BR>                                               )<BR>                                               (princ)<BR>                               )<BR>       )<BR>)

CADghost 发表于 2005-1-6 15:34:00

我用的2005,看看你的子程序还是有点问题


(defun c:jc ()<BR>       (initget "F S T")<BR>       (setq        bb (getstring<BR>                                       "\n&micro;&Oslash;&Ouml;&Ecirc;&AElig;&frac12;&Atilde;&aelig;&Iacute;&frac14;(F),&micro;&Oslash;&Ouml;&Ecirc;&AElig;&Ecirc;&Atilde;&aelig;&Iacute;&frac14;(T),&micro;&Oslash;&ETH;&Icirc;&micro;&Oslash;&Ouml;&Ecirc;&Iacute;&frac14;(S),&lt;F&gt;: "<BR>                       )<BR>       )<BR>       (if (= bb "")<BR>                       (Setq BB "F")<BR>       )<BR>       (cond<BR>                       ((= bb "F") (f_l))<BR>                       ((= bb "T") (t_l))<BR>                       ((= bb "S") (s_l))<BR>       )<BR>)<BR>(defun f_l ()<BR>       (setvar "plinegen" 1)<BR>       (command "layer"               "m"                                               "×&oslash;±ê&Iuml;&szlig;"       "c"                       "6"                                       ""<BR>                       "l"                                       "ACAD_ISO02W100"       ""                       "lw"                                       "0.00"<BR>                       ""                                       ""<BR>               )<BR>       (command "layer" "m" "&Icirc;&Auml;×&Ouml;" "c" "3" "" "")<BR>       (command "layer" "m" "&Igrave;&icirc;&sup3;&auml;" "c" "2" "" "")<BR>       (command "layer" "m" "&Ecirc;&Oacute;&iquest;&Uacute;" "c" "7" "" "p" "n" "" "")<BR>       (command "layer" "m" "&micro;×&Iacute;&frac14;" "c" "7" "" "p" "n" "" "")<BR>       (command "style" "ST" "&Euml;&Icirc;&Igrave;&aring;" 2.5 1.0 0 "N" "N")<BR>       (command "-style" "HT" "&ordm;&Uacute;&Igrave;&aring;" 10.0 1.0 0 "N" "N")<BR>       (command "draworder"<BR>                       (SSGET "X" '((0 . "hatch")))<BR>                       ""<BR>                       "b"<BR>       )<BR>       ;;(8 . "&Igrave;&icirc;&sup3;&auml;")°&Ntilde;&Igrave;&icirc;&sup3;&auml;&Otilde;&acirc;&cedil;&ouml;&Iacute;&frac14;&sup2;&atilde;&Aring;&Aring;&Ocirc;&Uacute;×&icirc;&ordm;ó<BR>       (command "ortho" "on")<BR>       ;;&acute;ò&iquest;&ordf;&Otilde;&yacute;&frac12;&raquo;<BR>       (command "limits")<BR>       ;;(command "pline" "" "w" "0.8" "0.8" "" "" "")<BR>       (prompt<BR>                       "\n&micro;&Oslash;&Ouml;&Ecirc; Copyright(c) 2005 By WWL. All Right Reserved! \n&Ccedil;&euml;&Oacute;&Atilde;JC&Atilde;ü&Aacute;&icirc;&pound;&iexcl;"<BR>       )<BR>       (princ)<BR>)


<BR>(defun<BR>               t_l<BR>                                       ()<BR>       (setvar "plinegen" 1)<BR>       (command "layer"               "m"                                               "×&oslash;±ê&Iuml;&szlig;"       "c"                       "6"                                       ""<BR>                       "l"                                       "ACAD_ISO02W100"       ""                       "lw"                                       "0.00"<BR>                       ""                                       ""<BR>               )<BR>       (command "layer" "m" "&Icirc;&Auml;×&Ouml;" "c" "3" "" "")<BR>       (command "layer" "m" "&Igrave;&icirc;&sup3;&auml;" "c" "2" "" "")<BR>       (command "layer" "m" "&Ecirc;&Oacute;&iquest;&Uacute;" "c" "7" "" "p" "n" "" "")<BR>       (command "layer" "m" "&micro;×&Iacute;&frac14;" "c" "7" "" "p" "n" "" "")<BR>       (command "style" "ST" "&Euml;&Icirc;&Igrave;&aring;" 2.5 1.0 0 "N" "N")<BR>       (command "-style" "HT" "&ordm;&Uacute;&Igrave;&aring;" 10.0 1.0 0 "N" "N")<BR>       (command "draworder"<BR>                       (SSGET "X" '((0 . "hatch")))<BR>                       ""<BR>                       "b"<BR>       )<BR>       (command "ortho" "on")<BR>       (command "limits")<BR>       (prompt<BR>                       "\n&micro;&Oslash;&Ouml;&Ecirc; Copyright(c) 2005 By WWL. All Right Reserved! \n&Ccedil;&euml;&Oacute;&Atilde;JC&Atilde;ü&Aacute;&icirc;&pound;&iexcl;"<BR>       )<BR>       (princ)<BR>)


<BR>(defun<BR>               s_l<BR>                                       ()<BR>       (setvar "plinegen" 1)<BR>       ;;(setvar "OSMODE" 36)<BR>       (command "layer"               "m"                                               "×&oslash;±ê&Iuml;&szlig;"       "c"                       "6"                                       ""<BR>                       "l"                                       "ACAD_ISO02W100"       ""                       "lw"                                       "0.00"<BR>                       ""                                       ""<BR>               )<BR>       (command "layer" "m" "&Icirc;&Auml;×&Ouml;" "c" "3" "" "")<BR>       (command "layer" "m" "&Igrave;&icirc;&sup3;&auml;" "c" "2" "" "")<BR>       (command "layer" "m" "&Ecirc;&Oacute;&iquest;&Uacute;" "c" "7" "" "p" "n" "" "")<BR>       (command "layer" "m" "&micro;×&Iacute;&frac14;" "c" "7" "" "p" "n" "" "")<BR>       (command "style" "ST" "&Euml;&Icirc;&Igrave;&aring;" 2.5 1.0 0 "N" "N")<BR>       (command "-style" "HT" "&ordm;&Uacute;&Igrave;&aring;" 10.0 1.0 0 "N" "N")


       (command "draworder"<BR>                       (SSGET "X" '((0 . "hatch")))<BR>                       ""<BR>                       "b"<BR>       )<BR>       (command "ortho" "on")


       (command "limits")<BR>       (prompt<BR>                       "\n&micro;&Oslash;&Ouml;&Ecirc; Copyright(c) 2005 By WWL. All Right Reserved! \n&Ccedil;&euml;&Oacute;&Atilde;JC&Atilde;ü&Aacute;&icirc;&pound;&iexcl;"<BR>       )<BR>       (princ)<BR>)<BR>

wengsg 发表于 2005-1-6 15:47:00

哪里有问题?请指教.


我也是使用2005的呀.

CADghost 发表于 2005-1-6 17:50:00

看看你的括号是否匹配,后面的子函数都包含在主程序里了

wengsg 发表于 2005-1-6 21:28:00

括号没问题呀!


还请高手来帮我解决吧?

龙龙仔 发表于 2005-1-7 08:04:00

括号没问题呀!--&gt;问题特多


(SSGET "X" '((0 . "hatch"))) ;= nil 会出错<BR>

wengsg 发表于 2005-1-7 17:46:00

龙龙仔发表于2005-1-7 8:04:00static/image/common/back.gif括号没问题呀!--&gt;问题特多



(SSGET \"X\" '((0 . \"hatch\"))) ;= nil 会出错


<BR>可以把上面的去掉,但程序还是不行.


有请"<A name=4221><FONT color=#990000><B>meflying</B></FONT></A>"帮我修改,可以吗?
页: [1]
查看完整版本: [求助]请大哥帮忙修改!