乐筑天下

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

[编程交流] Initializing...; error: AutoCA

[复制链接]

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 09:29:45 | 显示全部楼层 |阅读模式
I am getting this on the following code and I can't se why.  Can anyone help?
 
  1. ;//////////////////////////////////////////////////////////////////////////;; Start-Up Function;(defun C:Walls_Fences () (Walls_Fences_MF) (princ));;//////////////////////////////////////////////////////////////////////////;; Main Function;(defun Walls_Fences_MF (/ SIZE$ SIZE SUCE  SUOM  SUSM SUAB SUAD MIDPT PLEN PT01  PT02 a b COLR) (setq SUCE (getvar "cmdecho")) (setq SUOM (getvar "orthomode")) (setq SUSM (getvar "osmode")) (setq SUAB (getvar "angbase")) (setq SUAD (getvar "angdir")) (setq SUCL (getvar "clayer")) (setq SUCR (getvar "cecolor")) (setq temperr *error*) (setq *error* ETRAP_Walls_Fences) (setq S1_list  '("Existing Blockwork Wall" "Existing Concrete Post and Mesh Fence"    "Existing Concrete Post and Rail Fence" "Existing Pallisade Fence"    "Existing Reinforced Concrete Wall"  "Existing Sod and Stone Ditch"    "Existing Stone Faced Blockwork Wall"  "Existing Stone Faced Reinforced Concrete Wall"     "Existing Stone Wall" "Existing Timber Post and Rail Fence"      "Existing Timber Post and Wire Fence" "-----------------------------------"    "Proposed Blockwork Wall" "Proposed Concrete Post and Mesh Fence"    "Proposed Concrete Post and Rail Fence" "Proposed Pallisade Fence"    "Proposed Reinforced Concrete Wall"  "Proposed Sod and Stone Ditch"    "Proposed Stone Faced Blockwork Wall"  "Proposed Stone Faced Reinforced Concrete Wall"     "Proposed Stone Wall" "Proposed Timber Post and Rail Fence"      "Proposed Timber Post and Wire Fence"    ) ) (setq dcl_id (load_dialog "Walls_Fences.dcl")) (if   (not     (new_dialog "Walls_Fences" dcl_id)   )   (progn     (ALERT "Can not find your dcl file")     (exit)   ) ) (start_list "S1") (mapcar 'add_list S1_list) (end_list) (if SIZE:DEF   (set_tile "S1" (itoa SIZE:DEF)) ) (action_tile "cancel"  "(done_dialog)(setq userclick nil)" ) (action_tile "accept"   (strcat    "(progn     (setq S:IZE (atoi (get_tile "S1")) SIZE:DEF S:IZE)"    "(done_dialog)(setq userclick T))"   ) ) (start_dialog) (unload_dialog dcl_id) (if userclick   (VARIABLE_Walls_Fences) ) (princ));;//////////////////////////////////////////////////////////////////////////;; Variable Function;(defun VARIABLE_Walls_Fences () (progn    (setq SIZE$ (fix S:IZE))   (setq SIZE$ (nth S:IZE S1_list))   (cond     ((= SIZE$ "Existing Blockwork Wall")(setq SIZE$ "EXISTING_Blockwork_Wall")(setq LTYP "01")(setq COLR "31,127,0"))     ((= SIZE$ "Existing Concrete Post and Mesh Fence")(setq SIZE$ "EXISTING_Concrete_Post_and_Mesh_Fence")(setq LTYP "01")(setq COLR "46,255,255"))     ((= SIZE$ "Existing Concrete Post and Rail Fence")(setq SIZE$ "EXISTING_Concrete_Post_and_Rail_Fence")(setq LTYP "01")(setq COLR "0,127,255"))     ((= SIZE$ "Existing Pallisade Fence")(setq SIZE$ "EXISTING_Pallisade_Fence")(setq LTYP "01")(setq COLR "124,165,0"))     ((= SIZE$ "Existing Reinforced Concrete Wall")(setq SIZE$ "EXISTING_Reinforced_Concrete_Wall")(setq LTYP "01")(setq COLR "255,87,255"))     ((= SIZE$ "Existing Sod and Stone Ditch")(setq SIZE$ "EXISTING_Sod_and_Stone_Ditch")(setq LTYP "01")(setq COLR "124,0,165"))     ((= SIZE$ "Existing Stone Faced Blockwork Wall")(setq SIZE$ "EXISTING_Stone_Faced_Blockwork_Wall")(setq LTYP "01")(setq COLR "61,61,61"))     ((= SIZE$ "Existing Stone Faced Reinforced Concrete Wall")(setq SIZE$ "EXISTING_Stone_Faced_Reinforced_Concrete_Wall")(setq LTYP "01")(setq COLR "230,99,0"))     ((= SIZE$ "Existing Stone Wall")(setq SIZE$ "EXISTING_Stone_Wall")(setq LTYP "01")(setq COLR "3,55,99"))     ((= SIZE$ "Existing Timber Post and Rail Fence")(setq SIZE$ "EXISTING_Timber_Post_and_Rail_Fence")(setq LTYP "01")(setq COLR "97,48,0"))     ((= SIZE$ "Existing Timber Post and Wire Fence")(setq SIZE$ "EXISTING_Timber_Post_and_Wire_Fence")(setq LTYP "01")(setq COLR "127,95,0"))     ((= SIZE$ "Proposed Blockwork Wall")(setq SIZE$ "PROPOSED_Blockwork_Wall")(setq LTYP "02")(setq COLR "31,127,0"))     ((= SIZE$ "Proposed Concrete Post and Mesh Fence")(setq SIZE$ "PROPOSED_Concrete_Post_and_Mesh_Fence")(setq LTYP "02")(setq COLR "46,255,255"))     ((= SIZE$ "Proposed Concrete Post and Rail Fence")(setq SIZE$ "PROPOSED_Concrete_Post_and_Rail_Fence")(setq LTYP "02")(setq COLR "0,127,255"))     ((= SIZE$ "Proposed Pallisade Fence")(setq SIZE$ "PROPOSED_Pallisade_Fence")(setq LTYP "02")(setq COLR "124,165,0"))     ((= SIZE$ "Proposed Reinforced Concrete Wall")(setq SIZE$ "PROPOSED_Reinforced_Concrete_Wall")(setq LTYP "02")(setq COLR "255,87,255"))     ((= SIZE$ "Proposed Sod and Stone Ditch")(setq SIZE$ "PROPOSED_Sod_and_Stone_Ditch")(setq LTYP "02")(setq COLR "124,0,165"))     ((= SIZE$ "Proposed Stone Faced Blockwork Wall")(setq SIZE$ "PROPOSED_Stone_Faced_Blockwork_Wall")(setq LTYP "02")(setq COLR "61,61,61"))     ((= SIZE$ "Proposed Stone Faced Reinforced Concrete Wall")(setq SIZE$ "PROPOSED_Stone_Faced_Reinforced_Concrete_Wall")(setq LTYP "02")(setq COLR "230,99,0"))     ((= SIZE$ "Proposed Stone Wall")(setq SIZE$ "PROPOSED_Stone_Wall")(setq LTYP "02")(setq COLR "3,55,99"))     ((= SIZE$ "Proposed Timber Post and Rail Fence")(setq SIZE$ "PROPOSED_Timber_Post_and_Rail_Fence")(setq LTYP "02")(setq COLR "97,48,0"))     ((= SIZE$ "Proposed Timber Post and Wire Fence")(setq SIZE$ "PROPOSED_Timber_Post_and_Wire_Fence")(setq LTYP "02")(setq COLR "127,95,0"))   ) ) (setq SIZE SIZE$)  (OUTPUT_Walls_Fences) (princ));;//////////////////////////////////////////////////////////////////////////;; Output Function;(defun OUTPUT_Walls_Fences () (setq a (strcat "CCC_WF_"LTYP)       b (strcat "CCC_LAYOUT_"SIZE) ) (if   (not     (tblsearch "LTYPE" a)   )   (command "_.-linetype" "_l" a "CCC_Walls_Fences.lin" "") ) (command "_.-layer" "_N" b "_M" b "_L" a b "_C" "_T" COLR b "_LW" "0.6" b "" ) (command "_-color"  "bylayer") (command "._-linetype"  "s"  "bylayer" "") (setvar "angbase" 0.0000) (setvar "angdir"  0) (setvar "orthomode" 0) (setvar "osmode"    16383) (setvar "plinegen" 1)   (setvar "osmode" 0)   (command "_.pline")   (setvar "osmode" 16383)) (setq *error* temperr) (setvar "cmdecho" SUCE) (setvar "orthomode" SUOM) (setvar "osmode" SUSM) (setvar "angbase" SUAB) (setvar "angdir" SUAD) (setvar "clayer" SUCL) (setvar "cecolor" SUCR) (princ));;//////////////////////////////////////////////////////////////////////////;; Error Trap Function;(defun ETRAP_Walls_Fences (errmsg) (command nil nil nil) (if   (not     (member errmsg '("console break" "Function Cancelled"))   )   (princ (strcat "\nError:" errmsg)) ) (setvar "cmdecho" SUCE) (setvar "orthomode" SUOM) (setvar "osmode" SUSM) (setvar "angbase" SUAB) (setvar "angdir" SUAD) (princ "\nError, Restoring Variables.") (terpri) (setq *error* temperr) (princ));;//////////////////////////////////////////////////////////////////////////
 
  1. Walls_Fences : dialog {                                   //*dialog name        label = "Walls and Fences";           //*give it a label: row {                                    //*define row             : paragraph {                          //*define paragraph              : text_part {                        //*define more text                label = " ";           //*some more text              }                                    //*end text            }                                      //*end paragraph        }                                          //*end row        : row {                                    //*define row          : boxed_column {                         //*define boxex_column            label = "Choose a Type";               //*give it a label             : popup_list {                         //*define popup_list              key = "S1";                          //*give it a name              label = "Size";                      //*give it a label               edit_width=40;                        //*edit_width              alignment = right;                   //*alignment            }                                      //*end popup_list            : spacer {                             //*define spacer              height = 0;                          //*height            }                                      //*end spacer          }                                        //*end boxed_column        }                                          //*end row        : row {                                    //*define row          : column {                               //*define column            ok_cancel ;                            //*predifined OK/Cancel            : paragraph {                          //*define paragraph               : text_part {                        //*define more text                label = "CCC NNRDO     v1.0.24.07.2009";           //*some more text              }                                    //*end text            }                                      //*end paragraph          }                                        //*end column        }                                          //*end row      }                                            //*end dialog
回复

使用道具 举报

91

主题

428

帖子

326

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
474
发表于 2022-7-6 09:52:16 | 显示全部楼层
You call OUTPUT_Walls_Fences before Walls_Fences_MF, so the value of SUCE is nil.
回复

使用道具 举报

4

主题

327

帖子

324

银币

初来乍到

Rank: 1

铜币
19
发表于 2022-7-6 10:04:21 | 显示全部楼层
You have a parentheses issue where the code resets the setvars below the OUTPUT_Walls_Fences function
回复

使用道具 举报

91

主题

428

帖子

326

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
474
发表于 2022-7-6 10:07:47 | 显示全部楼层
Perhaps the paranthesis after line: (setvar "osmode" 16383) is extra, simply remove it.
回复

使用道具 举报

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 10:23:07 | 显示全部楼层
John M & Ahankhah,
It was a paranthesis issue so now my cmdecho error is gone but when the code runs the none of the layer info is carried through.  All I get is a black line on layer "0".
 
Any ideas?
回复

使用道具 举报

145

主题

590

帖子

446

银币

中流砥柱

Rank: 25

铜币
725
发表于 2022-7-6 10:29:56 | 显示全部楼层
I just moved my this part of the code:
 
  1.   (setq SUCE (getvar "cmdecho")) (setq SUOM (getvar "orthomode")) (setq SUSM (getvar "osmode")) (setq SUAB (getvar "angbase")) (setq SUAD (getvar "angdir")) (setq SUCL (getvar "clayer")) (setq SUCR (getvar "cecolor")) (setq temperr *error*)  
 
up to the first part of the code and that did the job.  Thanks for your help.  I appreciate it.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-7 03:13 , Processed in 0.616742 second(s), 64 queries .

© 2020-2025 乐筑天下

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