home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / felixcad / fcaddata.z / FLX_AEXP.LSP < prev    next >
Lisp/Scheme  |  1997-12-03  |  39KB  |  1,092 lines

  1. ;;; flx_aexp.lsp
  2. ;;; ================================================================
  3. ;;; EXPORT ATTRIBUTES OF PARTS
  4. ;;; ================================================================
  5. ;;; Provided by FELIX Computer Aided Technologies GmbH 1995-96
  6. ;;; ================================================================
  7. ;;; Created: Apr 20, 1996 dn
  8. ;;; Changed: Oct 21, 1996 vp
  9. ;;; ================================================================
  10. ;;; This file is called by FLX_MAIN.LSP
  11. ;;; ================================================================
  12.  
  13. (defun FLX_ATTEXP ( / prt_list PARTS 
  14.                  GET_ATTNAMES ERASE_LISTEL CREATE_EXPORT_TAB SEL_FILENAME 
  15.                  ATT_INSERT ATT_DELETE PRT_INSERT PRT_DELETE 
  16.                  ATTEXP_READ_FLX ListAction DlgInit CALL_COPYCLIP UHR 
  17.                  READ_INI WRITE_INI W_TO_FILE GET_VALUES SHOW_ATTRIB
  18.                  Att_Name_Lst Att_Value_Lst Prt_Value_Lst 
  19.                  selset OUTPUT OUTPUT_OK EXPORTFILE 
  20.                  ERRORSTR SEP_FLD SEP_TXT SAVEINI
  21.                  DLG_NOT_ACTIVE tmp)
  22.  
  23.     (setq prt_list '(
  24.       "Retrieving Attribute Information..."         ; 0
  25.       "Writing Information..."                      ; 1
  26.       "Write Attribute Export File"                 ; 2
  27.       "Attribute already in list: "                 ; 3
  28.       "Searching for all parts with attributes..."  ; 4
  29.       "No parts"                                    ; 5
  30.       " part"                                       ; 6
  31.       " part(s)"                                    ; 7
  32.       " with attributes in drawing"                 ; 8
  33.       " with attributes found"                      ; 9
  34.       "File not found: "                            ;10
  35.       "Clipboard function can not be executed!"     ;11
  36.       "Alert"                                       ;12
  37.       "Cannot open file: "                          ;13
  38.       "Part Name: '"                                ;14
  39.       "X coordinate: '"                             ;15
  40.       "Y coordinate: '"                             ;16
  41.       "Z Coordinate: '"                             ;17
  42.       "Layer: '"                                    ;18
  43.       "Scale Factor X: '"                           ;19
  44.       "Scale Factor Y: '"                           ;20
  45.       "Scale Factor Z: '"                           ;21
  46.       "Rotation Angle: '"                           ;22
  47.       "Field overflow (Record "                     ;23 )
  48.       "'\t(Max.: "                                  ;24 (
  49.       " char.)"                                     ;25
  50.       "Not numeric "                                ;26
  51.       "(Record "                                    ;27
  52.       ")\tAttribute '"                              ;28
  53.       "---"                                         ;29
  54.       "<< Back"                                     ;30
  55.       "Warnings: "                                  ;31
  56.       "Display Warnings"                            ;32
  57.       "Display Export File"                         ;33
  58.       "Export file: "                               ;34
  59.       " record created"                             ;35
  60.       " records created"                            ;36
  61.       "No records created!"                         ;37
  62.       " record written"                             ;38
  63.       " records written"                            ;39
  64.       "No records written!"                         ;40
  65.       "There are warnings!"                         ;41
  66.       "Cannot open file to write: "                 ;42
  67.       "Cannot open file to read: "                  ;43
  68.       "No preferences saved!"                       ;44
  69.       "Attributes"                                  ;45
  70.   ))
  71.   (if FLX_XLANGUAGE (FLX_XLANGUAGE "_aexp" nil))
  72.   
  73.   ;;; ***********************************************************************
  74.   ;;; Input/Output related defuns follow ...
  75.   ;;; ***********************************************************************
  76.   ;;; -----------------------------------------------------------------------
  77.   ;;; READ_INI
  78.   ;;; -----------------------------------------------------------------------
  79.   (defun READ_INI (warn / HOLE_INI_PARAMETER s tmp be_anz f$)
  80.     (defun HOLE_INI_PARAMETER (ss / TO_COMMA t1 t2 t3 t4 x TYP)
  81.       (defun TO_COMMA( / FLAG ret x)
  82.         (if (= (type ss) 'STR)
  83.           (progn 
  84.             (setq FLAG nil x 1)
  85.             (while (AND (not FLAG) (<= x (strlen ss)))
  86.               (if (= (substr ss x 1) ",")(setq FLAG T))
  87.               (setq x (+ x 1))
  88.             )
  89.             (if (<= x (strlen ss))
  90.               (progn (setq ret (substr ss 1 (- x 2))) (setq ss (substr ss  x )))
  91.               (setq ret nil)
  92.             )
  93.           )
  94.         )
  95.         ret
  96.       )
  97.       (if (= (type ss) 'STR)
  98.         (progn 
  99.           ;;; (setq TYP (TO_COMMA))
  100.           (setq TYP (substr ss 1 1))           ; P, A, F, T 
  101.           (setq ss (substr ss 3 (strlen ss)))
  102.           (setq t1 (TO_COMMA))
  103.           (if (setq t2 (TO_COMMA))(if (> (strlen t2) 2) (setq t2 nil)))
  104.           (if (= t2 "C") 
  105.            (progn (setq t3 ss) (setq t4 ""))
  106.            (progn
  107.             (if (setq t3 (TO_COMMA))(if (/= (type (read t3)) 'INT) (setq t3 nil))) 
  108.             (setq t4 ss)
  109.            )
  110.           )
  111.           ;(setq t4 ss)
  112.           (cond  
  113.            ((= typ "A")
  114.             (if (/= (type (read t3)) 'INT) (setq t3 nil))    
  115.             (if (AND t1 t2 t3 t4)
  116.              (setq Att_Value_Lst (append Att_Value_Lst (list (list t1 t2 t3 t4))))
  117.             )
  118.            )
  119.            ((= typ "P")
  120.             (if (/= (type (read t3)) 'INT) (setq t3 nil))
  121.             (if (AND t1 t2 t3 t4)
  122.              (setq Prt_Value_Lst (append Prt_Value_Lst (list (list t1 t2 t3 t4))))
  123.             )
  124.            )
  125.            ((= typ "F")
  126.             (if (AND (= (type t4) 'STR)(= (strlen t4) 1))(setq SEP_FLD t4))
  127.            )
  128.            ((= typ "T")
  129.             (if (AND (= (type t4) 'STR)(= (strlen t4) 1))(setq SEP_TXT t4))
  130.            )
  131.            ((= typ "X")
  132.             (if (= (type t4) 'STR) (setq EXPORTFILE t4))
  133.            )
  134.          )
  135.        )
  136.      )
  137.    ) ; defun
  138.    (if (setq f$
  139.          (open (strcat (cdr (assoc "FCADCFG" (getenv))) "\\attexp.ini") "r")
  140.        )
  141.      (progn
  142.        (while (setq s (read-line f$)) (HOLE_INI_PARAMETER s) )
  143.        (close f$)
  144.      )
  145.      (if warn
  146.        (ALERT
  147.          (strcat 
  148.            (nth 43 prt_list) ;;;@Cannot open file to read: 
  149.            (cdr (assoc "FCADCFG" (getenv))) "\\attexp.ini"
  150.          )
  151.          (nth 2 prt_list) ;;;@Write Attribute Export File
  152.          "EXCLAMATION"
  153.        )
  154.      )
  155.    )
  156.   )
  157.   ;;; ------------------------------------------------------------------------
  158.   ;;; WRITE_INI
  159.   ;;; ------------------------------------------------------------------------
  160.   (defun WRITE_INI (how / el f$)
  161.    (if (setq f$ 
  162.           (open (strcat (cdr(assoc "FCADCFG" (getenv))) "\\attexp.ini") "w")
  163.        )
  164.      (progn
  165.       (if (= how 1)
  166.        (progn
  167.         (if Prt_Value_Lst
  168.          (foreach el Prt_Value_Lst
  169.           (write-line 
  170.             (if (= (cadr el) "C")
  171.               (strcat "P=" (car el) "," (cadr el) "," (caddr el) )
  172.               (strcat "P=" (car el) "," (cadr el) "," (caddr el) "," (last el))
  173.             )
  174.             f$
  175.           )
  176.          )
  177.         )
  178.         (if Att_Value_Lst
  179.          (foreach el Att_Value_Lst
  180.           (write-line 
  181.             (if (= (cadr el) "C")
  182.               (strcat "A=" (car el) "," (cadr el) "," (caddr el) ) 
  183.               (strcat "A=" (car el) "," (cadr el) "," (caddr el) "," (last el)) 
  184.             )
  185.             f$
  186.           )
  187.          )
  188.         )
  189.         (if (= (type SEP_FLD) 'STR) (write-line (strcat "F=" SEP_FLD) f$))
  190.         (if (= (type SEP_TXT) 'STR) (write-line (strcat "T=" SEP_TXT) f$))
  191.         (if (= (type EXPORTFILE) 'STR) (write-line (strcat "X=" EXPORTFILE) f$))
  192.        ) 
  193.       )
  194.       (close f$) 
  195.      )
  196.      (ALERT
  197.        (strcat 
  198.           (nth 42 prt_list) ;;;@Cannot open file to write: 
  199.           (cdr (assoc "FCADCFG" (getenv))) "\\attexp.ini"
  200.        )
  201.        (nth 2 prt_list) ;;;@Write Attribute Export File
  202.        "EXCLAMATION"
  203.      )
  204.    )       
  205.   )
  206.   ;;; -----------------------------------------------------------------------
  207.   ;;; W_TO_FILE
  208.   ;;; -----------------------------------------------------------------------
  209.   (defun W_TO_FILE ( / DlgWarning f$ el anz tmp)
  210.     (defun DlgWarning ( / n)
  211.       (if FLX$WIN95 (foreach n 
  212.         '("IDOK" "display" "Static1")
  213.          (Dlg_TileSetFont n 2)
  214.       ))
  215.       (Dlg_TileAction "IDOK"    "(setq anz nil)(Dlg_DialogDone)")
  216.       (Dlg_TileAction "display" "(setq anz     T)(Dlg_DialogDone)")
  217.     )
  218.     (if OUTPUT 
  219.       (progn
  220.         (if (setq f$ (open EXPORTFILE "w"))
  221.           (progn
  222.             (foreach el OUTPUT (write-line el f$))
  223.             (close f$) 
  224.             (princ (strcat 
  225.               (itoa (setq tmp (length OUTPUT)))
  226.               (if (= tmp 1) (nth 38 prt_list) (nth 39 prt_list)) ;;;@ records written
  227.             ))
  228.           )
  229.           ;;; else
  230.           (ALERT
  231.             (strcat
  232.               (nth 42 prt_list) ;;;@Cannot open file to write: 
  233.               "\n" EXPORTFILE
  234.             )
  235.             (nth 2 prt_list)    ;;;@Write Attribut Export File
  236.             "EXCLAMATION"
  237.           )
  238.         )
  239.         (if ERRORSTR (progn
  240.           (if (FLX_DLGDSP "flx_axp" "warning" "(princ)" "(DlgWarning)") (princ)(exit))
  241.           (if anz (SHOW_ATTRIB T))
  242.         ))
  243.       )
  244.       ;;; else
  245.       (princ (nth 40 prt_list)) ;;;@No records written!
  246.     )
  247.   )
  248.   ;;; -----------------------------------------------------------------------
  249.   ;;; CREATE_EXPORT_TAB
  250.   ;;; -----------------------------------------------------------------------
  251.   (defun CREATE_EXPORT_TAB( / n x tmp1 tmp2 ret )
  252.     (if UHR (UHR 1))
  253.     (Dlg_TileSet "message1" (nth 1 prt_list)) ;;;@Writing Information...
  254.     (foreach n OUTPUT
  255.       (setq x 1 tmp2 "")
  256.       (while (<= x (strlen n))
  257.         (if (/= (setq tmp1 (substr n x 1)) "\t")
  258.           (setq tmp2 (strcat tmp2 tmp1))
  259.         )
  260.         (setq x (1+ x))
  261.       )
  262.       (setq ret (append ret (list tmp2)))
  263.     )
  264.     (if UHR (UHR 0))
  265.     (setq OUTPUT ret)
  266.   )
  267.   ;;; -----------------------------------------------------------------------
  268.   ;;; GET_VALUES 
  269.   ;;; -----------------------------------------------------------------------
  270.   (defun GET_VALUES ( / GET_PARTPROP GET_PARTATTR
  271.                         tmp TZT x ATVAL l Prt_Prop SAV_TZF)
  272.   
  273.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  274.     (defun GET_PARTPROP (el / tmp el_type el_num el_dec err ret 
  275.                               len_check luprec auprec sep)
  276.       (setq
  277.          tmp     (strcase (car el))
  278.          el_type (nth 1 el)
  279.          el_num  (nth 2 el)
  280.          el_dec  (nth 3 el)
  281.          ret ""
  282.          err ""
  283.       )
  284.       (if (= el_type "N")
  285.         (setq len_check (+ (atoi el_num) 1 (atoi el_dec))
  286.               luprec (atoi el_dec)
  287.               auprec (atoi el_dec)
  288.         )
  289.         (setq len_check (atoi el_num)
  290.               luprec 0
  291.               auprec 0
  292.         )
  293.       )
  294.       (cond
  295.        ((= tmp "NAME")
  296.         (setq err (nth 14 prt_list)) ;;;@Part Name: '
  297.         (setq ret (strcat ret (cdr (assoc 2 Prt_Prop))))
  298.        )
  299.        ((= tmp "LAYER")
  300.         (setq err (nth 18 prt_list)) ;;;@Layer: '
  301.         (setq ret (strcat ret (cdr (assoc 8 Prt_Prop))))
  302.        )
  303.        ((= tmp "X")
  304.         (setq err (nth 15 prt_list)) ;;;@X coordinate: '
  305.         (setq ret (strcat ret (rtos (car (cdr (assoc 10 Prt_Prop))) 2 luprec)))
  306.        )
  307.        ((= tmp "Y")
  308.         (setq err (nth 16 prt_list)) ;;;@Y coordinate: '
  309.         (setq ret (strcat ret (rtos (cadr (cdr (assoc 10 Prt_Prop))) 2 luprec)))
  310.        )   
  311.        ((= tmp "Z")
  312.         (setq err (nth 17 prt_list)) ;;;@Z coordinate: '
  313.         (setq ret (strcat ret (rtos (caddr (cdr (assoc 10 Prt_Prop))) 2 luprec)))
  314.        )
  315.        ((= tmp "XS")
  316.         (setq err (nth 19 prt_list)) ;;;@Scale Factor X: '
  317.         (setq ret (strcat ret (rtos (cdr (assoc 41 Prt_Prop)) 2 luprec)))
  318.        )
  319.        ((= tmp "YS")
  320.         (setq err (nth 20 prt_list)) ;;;@Scale Factor Y: '
  321.         (setq ret (strcat ret (rtos (cdr (assoc 42 Prt_Prop)) 2 luprec)))
  322.        )
  323.        ((= tmp "ZS")
  324.         (setq err (nth 21 prt_list)) ;;;@Scale Factor Z: '
  325.         (setq ret (strcat ret (rtos (cdr (assoc 43 Prt_Prop)) 2 luprec)))
  326.        )
  327.        ((= tmp "ORIENT")
  328.         (setq err (nth 22 prt_list)) ;;;@Rotation Angle: '
  329.         (setq ret (strcat ret (angtos (cdr (assoc 50 Prt_Prop)) 0 auprec)))
  330.        )
  331.       )
  332.       ;;; Check length of fields:
  333.       (if (> (strlen ret) len_check) (progn  
  334.         (setq ERRORSTR (append ERRORSTR (list (strcat 
  335.           (nth 23 prt_list)  ;;;@Field overflow (Record 
  336.           (itoa (1+ x)) ")\t"
  337.           err
  338.           ret
  339.           (nth 24 prt_list)  ;;;@'\t(Max.: 
  340.           (itoa len_check)
  341.           (nth 25 prt_list)  ;;;@ char.)
  342.         ))))
  343.         (setq RET (substr ret 1 len_check))
  344.       ))
  345.       (setq sep (if (= el_type "C") SEP_TXT ""))
  346.       (setq RET (strcat sep RET sep SEP_FLD))
  347.       RET     
  348.     )
  349.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  350.     ;;; GET_PARTATTR: Get filtered attribute list to be displayed
  351.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  352.     (defun GET_PARTATTR (e / GET_ATTRIB att el tmp1 tmp2 tmp3 ret z)
  353.       (defun GET_ATTRIB (en / en ret tmp)
  354.         (setq ret '())
  355.         (while (and (setq en (entnext en))(= (cdr (assoc 0 (entget en))) "ATTRIB"))
  356.           (setq ret (append ret (list (entget en))))
  357.         )       
  358.         (setq ret ret)
  359.       )
  360.       (if (setq att (GET_ATTRIB e)) ;;; local function defined above
  361.        (progn
  362.         (setq z 1)
  363.         ;;; Check if attribute is contained in ATT_VALUE_LIST ...
  364.         (foreach el att 
  365.           (if (setq tmp3 
  366.              (assoc (strcase (setq tmp1 (cdr (assoc 2 el)))) Att_Value_Lst)
  367.           )
  368.           ;;; IF Yes -> register name and value
  369.           (progn
  370.             (setq tmp2 (cdr (assoc 1 el)))
  371.             (if (= (cadr tmp3) "N")
  372.               (progn 
  373.                 (if (setq tmp2 (atof tmp2))
  374.                   (setq tmp2 (rtos tmp2 2 (atoi (last tmp3))))
  375.                   (progn 
  376.                     (setq tmp2 "0.00")
  377.                     (setq ERRORSTR (append ERRORSTR (list (strcat 
  378.                        (nth 26 prt_list)  ;;;@Not numeric 
  379.                        (nth 27 prt_list)  ;;;@(Record ;)
  380.                        (itoa (1+ x))
  381.                        (nth 28 prt_list)  ;;;@")\tAttribute '"
  382.                        (strcase tmp1) 
  383.                        "' = '" tmp2 "'!"
  384.                     ))))
  385.                   )
  386.                 )
  387.               )
  388.             )
  389.             (if (> (strlen tmp2) (atoi (caddr tmp3)))
  390.               (progn  
  391.                 (setq ERRORSTR (append ERRORSTR (list (strcat
  392.                   (nth 23 prt_list)  ;;;@Field Overflow (Record ;)
  393.                   (itoa (+ x 1))
  394.                   (nth 28 prt_list)  ;;;@)\tAttribute '
  395.                   (strcase tmp1) "' = '" tmp2
  396.                   (nth 24 prt_list)  ;;;@'\t(Max.: ;)
  397.                   (caddr tmp3)
  398.                   (nth 25 prt_list)  ;;;@ char.)
  399.                 ))))
  400.                 (setq tmp2 (substr tmp2 1 (atoi (caddr tmp3))))
  401.              )
  402.            )
  403.            (setq ret (append ret (list (list (strcase tmp1) tmp2))))
  404.           )
  405.         )
  406.         (setq z (+ z 1))
  407.        )
  408.       )
  409.      )
  410.      (setq ret ret)
  411.     )
  412.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  413.     (setq ERRORSTR nil)
  414.     (setq OUTPUT   nil)
  415.     (setq SAV_TZF SEP_FLD)
  416.     (if (= $key "display")(setq SEP_FLD (strcat SEP_FLD "\t")))
  417.     (if (not DLG_NOT_ACTIVE) (progn
  418.       (setq EXPORTFILE (Dlg_TileGet "editsaveas"))
  419.             (setq SAVEINI         (Dlg_TileGet "saveini"))
  420.             (Dlg_TileSet "message1" (nth 0 prt_list)) ;@Retrieving Attribute Information...
  421.         ))
  422.         (if UHR (UHR 1))
  423.         (setq x 0)
  424.         (while (AND selset Att_Value_Lst (< x (sslength selset)))
  425.             (setq Prt_Prop (entget (ssname selset x)))
  426.             ;;;
  427.             (setq OUTPUT_X "")
  428.             (if Prt_Value_Lst 
  429.                 (foreach el Prt_Value_Lst (setq OUTPUT_X (strcat OUTPUT_X (GET_PARTPROP el))))
  430.             )
  431.             ;;;
  432.             (setq atval (GET_PARTATTR (ssname selset x)))
  433.             (if atval (progn
  434.                 (foreach el Att_Value_Lst
  435.                     (setq wert (if (setq tmp (assoc (car el) atval))(cadr tmp) ""))
  436.                     (setq TZT (if (= (cadr el) "C") SEP_TXT ""))
  437.                     (setq OUTPUT_X (strcat OUTPUT_X TZT wert TZT))
  438.                     (if (/= (last Att_Value_Lst) el) (setq OUTPUT_X (strcat OUTPUT_X SEP_FLD)))
  439.                 )
  440.                 (setq OUTPUT (append OUTPUT (list OUTPUT_X)))
  441.             ))
  442.             (setq x (1+ x))
  443.         ) ; while
  444.         (if UHR (UHR 0))
  445.         (if (not DLG_NOT_ACTIVE) (Dlg_TileSet "message1" "")) ;;;### no of parts
  446.         (setq SEP_FLD SAV_TZF)
  447.     )
  448.     ;;; -----------------------------------------------------------------------
  449.     ;;; SHOW_ATTRIB: Dialog to display list of attributes to export
  450.     ;;; -----------------------------------------------------------------------
  451. (defun SHOW_ATTRIB (from / CLIPBOARD SHOW_INFO MAKE_LABELSTR MAKE_TABLIST
  452.                                                      DlgInit_4
  453.                                                      mode tmp label)
  454.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  455.     (defun CLIPBOARD ( / REQUEST howmany copylst lines el)
  456.         (defun REQUEST ( / DlgInit_5)
  457.             (defun DlgInit_5( / n)
  458.                 (if FLX$WIN95 (foreach n 
  459.                     '("IDCANCEL" "selection" "selectall" "Static1")
  460.            (Dlg_TileSetFont n 2)
  461.         ))
  462.         (Dlg_TileAction "IDCANCEL"  "(setq howmany 0)(Dlg_DialogDone)")
  463.         (Dlg_TileAction "selection" "(setq howmany 1)(Dlg_DialogDone)")
  464.         (Dlg_TileAction "selectall" "(setq howmany 2)(Dlg_DialogDone)")
  465.       )
  466.       (if (FLX_DLGDSP "flx_axp" "request" "(princ)" "(DlgInit_5)")(princ)(exit))
  467.     )
  468.     (setq howmany 2)   ;;; 2=All 1=Selection 0=Nothing
  469.     (setq copylst '())
  470.         (setq lines (Dlg_TileGet "info"))
  471.         (setq lines (read (strcat "(" lines ")" )))
  472.         (if lines (REQUEST))
  473.         (cond 
  474.          ((= howmany 1)
  475.             (foreach el lines (setq copylst (append copylst (list (nth el OUTPUT)))))
  476.          )
  477.          ((= howmany 2)
  478.             (setq copylst OUTPUT)
  479.          )
  480.         )
  481.         (if copylst (if (not COPYCLIP)(princ)(COPYCLIP copylst)))
  482.     )
  483.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  484.     (defun SHOW_INFO()
  485.         (cond
  486.             ((= mode 1)        ;;; Display Warnings
  487.              (Dlg_TileSet "show" (nth 30 prt_list)) ;;;@<< Back
  488.              (Dlg_TileSet "error" "")
  489.              (Dlg_TileSet "disp"    "")
  490.              (ListAction    "label" (list (nth 31 prt_list))) ;;;@Warnings: 
  491.              (ListAction    "info"    ERRORSTR)
  492.              (setq mode 0)
  493.             )
  494.             (T                        ;;; Display Parts Information
  495.              (Dlg_TileSet "show"    (nth 32 prt_list)) ;;;@Display Warnings
  496.              (ListAction    "label" label)
  497.              (ListAction    "info"    OUTPUT)
  498.              (setq mode 1)
  499.             )
  500.         )
  501.     )
  502.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  503.     (defun MAKE_LABELSTR( / ret el)
  504.         (setq ret "")
  505.         (if Prt_Value_Lst 
  506.             (foreach el Prt_Value_Lst (setq ret (strcat ret (strcase (car el)) "\t")))
  507.         )
  508.         (if Att_Value_Lst 
  509.             (foreach el Att_Value_Lst (setq ret (strcat ret (car el) "\t")))
  510.         )
  511.         (if (= ret "") nil (list ret))
  512.     )
  513.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  514.     (defun MAKE_TABLIST( / ret el n1)
  515.         (setq ret "" n1 0)
  516.         (if Prt_Value_Lst 
  517.             (foreach el Prt_Value_Lst 
  518.                 (setq n1    (+ n1 (atoi (caddr el))))
  519.                 (setq ret (strcat ret (itoa n1) " "))
  520.             )
  521.         )
  522.         (if Att_Value_Lst 
  523.             (foreach el Att_Value_Lst 
  524.                 (setq n1    (+ n1 (atoi (caddr el))))
  525.                 (setq ret (strcat ret (itoa n1) " "))
  526.             )
  527.         )
  528.         (if (= ret "") nil ret)
  529.     )
  530.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  531.     (defun DlgInit_4 ( / n)
  532.         (if FLX$WIN95 (foreach n 
  533.                 '("IDOK" "show" "clip" "info" "error" "disp" "label")
  534.          (Dlg_TileSetFont n 2)
  535.     ))
  536.     (Dlg_TileAction "IDOK" "(Dlg_DialogDone)")
  537.     (Dlg_TileAction "show" "(SHOW_INFO)")
  538.     (Dlg_TileAction "clip" "(CLIPBOARD)")
  539.     (if from
  540.      (progn
  541.        (ListAction  "info" ERRORSTR)
  542.        (setq mode 0)
  543.        (Dlg_TileSet "error" "")
  544.        (Dlg_TileSet "show"  (nth 33 prt_list)) ;;;@Display Export File
  545.        (Dlg_TileSet "disp"  "")
  546.        (ListAction  "label" (list (nth 31 prt_list))) ;;;@Warnings: 
  547.        ;;;@Display Export File
  548.        (setq label (list (strcat (nth 34 prt_list) "'" EXPORTFILE "'"))) 
  549.      )
  550.      (progn
  551.        (if OUTPUT
  552.          (progn 
  553.            (if (setq tmp (MAKE_TABLIST))
  554.              (progn
  555.                (Dlg_ListSetTabStops "info"  tmp)
  556.                (Dlg_ListSetTabStops "label" tmp)
  557.              )
  558.            )
  559.            (if (setq label (MAKE_LABELSTR))
  560.              (ListAction "label" label)
  561.              (ListAction "label" (setq label (list (nth 45 prt_list))))  ;;;@Attributes
  562.            )
  563.            (ListAction "info" OUTPUT)
  564.            (setq tmp (length OUTPUT))
  565.            (setq tmp (strcat
  566.              (symbtos tmp)
  567.              (if (= tmp 1)
  568.                  (nth 35 prt_list) ;;;@ record created
  569.                  (nth 36 prt_list) ;;;@ records created
  570.              )
  571.            ))
  572.          )
  573.          (progn
  574.            (setq tmp (nth 37 prt_list)) ;;;@No records created!
  575.            (Dlg_TileMode "clip" 1)
  576.          )
  577.        )
  578.        (Dlg_TileSet "disp" tmp)
  579.        (if ERRORSTR
  580.          (progn
  581.            (setq mode 1)
  582.            (Dlg_TileSet "error" (nth 41 prt_list)) ;;;@There are warnings!
  583.          )
  584.          (progn 
  585.            (setq mode 0)
  586.            (Dlg_TileSet  "error" "") ;;;No warnings
  587.            (Dlg_TileMode "show" 1)
  588.          )
  589.        )
  590.     )
  591.    )
  592.   )
  593.   ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  594.   ;;; SUB-DIALOG Display...
  595.  
  596.   (if (FLX_DLGDSP "flx_axp" "display" "(princ)" "(DlgInit_4)") (princ)(exit))
  597.  
  598.   (setq OUTPUT_OK T)  ;;; ###(setq  OUTPUT nil)
  599. )
  600.  
  601.   ;;; ****************************************************************************
  602.  
  603.   ;;; -----------------------------------------------------------------------
  604.   ;;; ATTEXP_READ_FLX 
  605.   ;;; -----------------------------------------------------------------------
  606.   (defun ATTEXP_READ_FLX ( / x)
  607.     (setq Att_Name_Lst nil)
  608.     (if UHR (UHR 1))
  609.     (setq selset (ssget "X" '((-4 . "<AND")(0 . "INSERT")(66 . 1)(-4 . "AND>"))))
  610.         (if selset (progn
  611.             (setq x 0)
  612.             (while (< x (sslength selset))
  613.                 (GET_ATTNAMES (ssname selset x))
  614.                 (setq x (1+ x))
  615.             )
  616.         ))
  617.         (NO_OF_PARTS selset)
  618.         (if UHR (UHR 0))
  619.     )
  620.     ;;; ------------------------------------------------------------------------
  621.     ;;; ERASE_LISTEL, ATT_DELETE, PRT_DELETE
  622.     ;;; ------------------------------------------------------------------------
  623.     (defun ERASE_LISTEL (lst x / lst x tmp1 tmp2 ret)
  624.         (if (setq tmp2 (cdr (member (nth x lst) (reverse lst))))
  625.             (setq ret (append ret (reverse tmp2)))
  626.         )
  627.         (if (setq tmp1 (cdr (member (nth x lst) lst)))
  628.             (setq ret (append ret tmp1))
  629.         )
  630.         ret
  631.     )
  632.     ;;; ------------------------------------------------------------------------
  633.     (defun ATT_DELETE( / del el )
  634.         (while (/= (setq del (Dlg_TileGet "attributes")) "")
  635.             (setq del (read (strcat "(" del ")")))
  636.             (if del (Dlg_ListStart "attributes" 11 (car del)) ) ;;; 11=delete
  637.             (setq Att_Value_Lst (ERASE_LISTEL Att_Value_Lst (car del)))
  638.             (setq OUTPUT_OK nil)
  639.         )
  640.     ) ;;; creates new list Att_Value_Lst 
  641.     ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  642.     (defun PRT_DELETE( / del el )
  643.         (while (/= (setq del (Dlg_TileGet "partinfo")) "")
  644.                 (setq del (read (strcat "(" del ")")))
  645.                 (if del (Dlg_ListStart "partinfo" 11 (car del))) 
  646.                 (setq Prt_Value_Lst (ERASE_LISTEL Prt_Value_Lst (car del)))
  647.                 (setq OUTPUT_OK nil)
  648.         )
  649.     ) ;;; creates new list Prt_Value_Lst 
  650.     ;;; ------------------------------------------------------------------------
  651.     ;;; ATT_INSERT 
  652.     ;;; ------------------------------------------------------------------------
  653.     (defun ATT_INSERT ( / TOGGLE_ALL_ATT GET_TILES DlgInit_2
  654.                                                 ret el)
  655.  
  656.         ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  657.         (defun TOGGLE_ALL_ATT ( / x s)
  658.             (if (= $value "1")
  659.                 (progn
  660.                     (setq x 0 s "")
  661.                     (while (<= x (length Att_Name_Lst))
  662.                         (setq s (strcat s (itoa x) " "))
  663.                         (setq x (1+ x))
  664.                     )
  665.                     (Dlg_TileSet "attributes" s)
  666.                 )
  667.                 ;;; else:
  668.                 (ListAction "attributes" Att_Name_Lst) 
  669.             )
  670.         )
  671.         ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  672.         (defun GET_TILES ( / a tmp f d el typ)
  673.             (if (and (setq tmp (Dlg_TileGet "attributes" ))
  674.                              (/= tmp    "")
  675.                     )
  676.                 (progn
  677.                     (setq tmp (read (strcat "(" tmp ")" )))
  678.                     (foreach el tmp (setq a (append a (list (nth el Att_Name_Lst)))))
  679.                     (if (= (setq f (Dlg_TileGet "flength"     )) "")(setq f "0"))
  680.                     (if (= (setq d (Dlg_TileGet "decplaces")) "")(setq d "0"))
  681.                     (setq typ (if (= (Dlg_TileGet "notnum") "1") "C" "N"))
  682.                     (if (= typ "C") (setq d ""))
  683.                     ;;; a        = Attribute names 
  684.                     ;;; typ = Numerical / Not numerical
  685.                     ;;; f        = Field width 
  686.                     ;;; d        = Decimal places
  687.                     (setq ret (list a typ f d)) 
  688.                 )
  689.                 (setq ret nil)
  690.             )
  691.         )
  692.         ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  693.         (defun DlgInit_2()
  694.             (if FLX$WIN95 (foreach n 
  695.                 '("IDCANCEL" "IDOK" "IDHELP"
  696.           "attributes" "allparts" "notnum" "numerical"
  697.           "allparts" "dec" "flength" "decplaces" "Static1" "Static3"
  698.          )
  699.          (Dlg_TileSetFont n 2)
  700.       ))
  701.       (if Att_Name_Lst 
  702.         (ListAction "attributes" Att_Name_Lst)  ;;;### besser FillList
  703.       )
  704.       (Dlg_TileSet  "notnum"    "1")
  705.       (Dlg_TileSet  "flength"   "16")
  706.       (Dlg_TileSet  "decplaces" "0")
  707.       (Dlg_TileMode "dec"       1)
  708.       (Dlg_TileMode "decplaces" 1)
  709.       ;;; Actions: - - - - - - - - - - - - - - - - - - - - - - - - - - -
  710.       (Dlg_TileAction "IDCANCEL" "(setq ret nil)        (Dlg_DialogDone)")
  711.       (Dlg_TileAction "IDOK"     "(setq ret (GET_TILES))(Dlg_DialogDone)")
  712.       (Dlg_TileAction "allparts" "(TOGGLE_ALL_ATT)")
  713.       (Dlg_TileAction "notnum" 
  714.       "(if (= $value \"1\")(progn (Dlg_TileSet \"decplaces\" \"0\")(Dlg_TileMode 
  715. \"dec\" 1)(Dlg_TileMode \"decplaces\" 1)))"
  716.       )
  717.       (Dlg_TileAction "numerical"
  718.       "(if (= $value \"1\")(progn (Dlg_TileSet \"decplaces\" \"2\")(Dlg_TileMode 
  719. \"dec\" 0)(Dlg_TileMode \"decplaces\" 0)))"
  720.       )
  721.     )
  722.     ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  723.     ;;; Display the sub-dialog:
  724.  
  725.     (if (FLX_DLGDSP "flx_axp" "ins_att" "(princ)" "(DlgInit_2)")(princ)(exit))
  726.     
  727.     ;;; If attributes have been selected the list ret is structured as follows:
  728.     ;;; (("ATTNAME1" "ATTNAME2" ...) NUM|CHAR FIELDWIDTH DEC_PLACES)
  729.     ;;; If ret list: update list "attributes" in the main dialog:
  730.     
  731.     (if ret
  732.       (progn
  733.         (Dlg_ListStart "attributes" 2)
  734.         (foreach el (car ret) 
  735.           (if (assoc el Att_Value_Lst)
  736.            (ALERT
  737.              (strcat (nth 3 prt_list) "\n" el) ;;;@Attribute already in list: 
  738.              (nth 12 prt_list) ;;;@Alert
  739.              "EXCLAMATION"
  740.            )
  741.            (progn
  742.              (Dlg_ListAdd (strcat 
  743.               (symbtos el)  "\t" 
  744.               (cadr    ret) "\t"
  745.               (caddr   ret) "\t"
  746.               (last    ret)
  747.              ))
  748.              (setq Att_Value_Lst (append Att_Value_Lst (list 
  749.                (list el (cadr ret) (caddr ret) (last ret)))))
  750.            )
  751.          )
  752.        )
  753.        (Dlg_ListEnd)
  754.        (setq OUTPUT_OK nil)
  755.      )
  756.     )
  757.   )
  758.   ;;; ------------------------------------------------------------------------
  759.   ;;; PRT_INSERT - Add Part Properties to Export List
  760.   ;;; ------------------------------------------------------------------------
  761.   (defun PRT_INSERT( / GET_TILES DlgInit_3 
  762.                        ret el sav_tzt sav_tzf sav_bl)
  763.     ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  764.     (defun GET_TILES( / KEY_LIST_CHAR KEY_LIST_NUM f d b el)
  765.       ;;; b   = key 
  766.       ;;; typ = numeric/alpha
  767.       ;;; f   = Field width 
  768.       ;;; d   = Decimal places
  769.       (setq SEP_FLD (Dlg_TileGet "delim_fld"))
  770.       (setq SEP_TXT (Dlg_TileGet "delim_txt"))
  771.       (setq Prt_Value_Lst nil)
  772.       (setq KEY_LIST_CHAR (list "name" "layer" ))
  773.       (setq KEY_LIST_NUM  (list "x" "y" "z" "orient" "xs" "ys" "zs"))
  774.       (foreach el KEY_LIST_CHAR
  775.         (if (= (Dlg_TileGet el) "1")(progn 
  776.             (if (= (setq f (Dlg_TileGet (strcat "field" el))) "") (setq f "0"))
  777.             (setq Prt_Value_Lst (append Prt_Value_Lst (list (list el "C" f ""))) )
  778.         ))
  779.       ) 
  780.       (foreach el KEY_LIST_NUM
  781.         (if (= (Dlg_TileGet el) "1")(progn 
  782.           (if (= (setq f (DLG_TileGet (strcat "field" el))) "")
  783.             (setq f "0")
  784.           )
  785.           (if (= (setq d (DLG_TileGet (strcat "dec"  el))) "")
  786.             (setq d "0")
  787.           )
  788.           (setq Prt_Value_Lst (append Prt_Value_Lst (list (list el "N" f d))))
  789.         ))
  790.       )
  791.     )
  792.     ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  793.     (defun DlgInit_3( / luprec)
  794.       (if FLX$WIN95 (foreach n 
  795.           '("IDCANCEL" "IDOK" "IDHELP"
  796.                         "name" "layer"
  797.                         "fieldname" "fieldlayer"
  798.                         "x"             "y"            "z"             "xs"             "ys"             "zs"             "orient"     
  799.                         "fieldx" "fieldy" "fieldz" "fieldxs" "fieldys" "fieldzs" "fieldorient"    
  800.                         "decx"     "decy"        "decz"     "decxs"     "decys"     "deczs"     "decorient"    
  801.                         ;;; "delim_fld" "delim_txt"
  802.                         "GroupBox1" "GroupBox2"
  803.                         "Static1" "Static2" "Static3" "Static8" "Static9"
  804.                      )
  805.                      (Dlg_TileSetFont n 2)
  806.              ))
  807.              (setq luprec (itoa (getvar "LUPREC")))
  808.              (Dlg_TileSet "delim_fld" SEP_FLD)
  809.              (Dlg_TileSet "delim_txt" SEP_TXT)
  810.              (Dlg_TileSet "fieldname"        "12")
  811.              (Dlg_TileSet "fieldlayer"    "12")
  812.              (Dlg_TileSet "fieldx"    "8")
  813.              (Dlg_TileSet "fieldy"    "8")
  814.              (Dlg_TileSet "fieldz"    "8")
  815.              (Dlg_TileSet "decx"        luprec)
  816.              (Dlg_TileSet "decy"        luprec)
  817.              (Dlg_TileSet "decz"        luprec)
  818.              (Dlg_TileSet "fieldorient" "4")
  819.              (Dlg_TileSet "decorient"     (itoa (getvar "AUPREC")))
  820.              (Dlg_TileSet "fieldxs" "4")
  821.              (Dlg_TileSet "fieldys" "4")
  822.              (Dlg_TileSet "fieldzs" "4")
  823.              (Dlg_TileSet "decxs"        luprec)
  824.              (Dlg_TileSet "decys"        luprec)
  825.              (Dlg_TileSet "deczs"        luprec)
  826.              (if Prt_Value_Lst
  827.                  (foreach el Prt_Value_Lst 
  828.                      (Dlg_TileSet (car el) "1")
  829.                      (Dlg_TileSet (strcat "field" (car el)) (nth 2 el))
  830.                      (Dlg_TileSet (strcat "dec"        (car el)) (nth 3 el))
  831.                  )
  832.              )
  833.              (Dlg_TileAction "IDOK"            "(GET_TILES)(Dlg_DialogDone)")
  834.              (Dlg_TileAction "IDCANCEL" "(Dlg_DialogDone)")
  835.         )
  836.         ;;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  837.         
  838.         (setq sav_tzt SEP_TXT sav_tzf SEP_FLD sav_bl Prt_Value_Lst)
  839.  
  840.         (if (FLX_DLGDSP "flx_axp" "selpartprop" "(princ)" "(DlgInit_3)")(princ)(exit))
  841.  
  842.         ;; Create list 'be_anz' to display part properties
  843.         (if Prt_Value_Lst (progn
  844.                 (setq be_anz nil)
  845.                 (foreach el Prt_Value_Lst 
  846.                     (setq be_anz (append be_anz (list (strcat 
  847.                         (strcase (car el))
  848.                         "\t" (nth 1 el)
  849.                         "\t" (nth 2 el)
  850.                         "\t" (nth 3 el)
  851.                     ))))
  852.                 )
  853.                 (ListAction "partinfo" be_anz)
  854.         ))
  855.         (Dlg_TileSet "delim_fld" SEP_FLD)
  856.         (Dlg_TileSet "delim_txt" SEP_TXT)
  857.         (if (or (/= sav_tzt SEP_TXT)
  858.                         (/= sav_tzf SEP_FLD)
  859.                         (/= sav_bl    Prt_Value_Lst)
  860.                 )
  861.                  (setq OUTPUT_OK nil)
  862.         )
  863.     )
  864.     ;;; -----------------------------------------------------------------------
  865.     ;;; SEL_FILENAME
  866.     ;;; -----------------------------------------------------------------------
  867.     (defun SEL_FILENAME ( / fn)
  868.          (foreach key
  869.             '("IDCANCEL" "IDOK" "IDHELP" "attributes" "partinfo"
  870.          ;;; "delim_fld" "delim_txt"
  871.          "ins" "del" "ins_pp" "del_pp" "display" "message1" "allparts"
  872.          "saveini" "editsaveas" "saveas" 
  873.          "Static4" "Static6" "Static7" "Static8" "Static9" "Static10"
  874.        )
  875.        (Dlg_TileMode key 1)
  876.      )
  877.      (if (setq fn (GETFILED
  878.            (nth 2 prt_list)  ;;;@Write Attribut Export File
  879.            (Dlg_TileGet "editsaveas")
  880.            "txt"
  881.            1
  882.          ))
  883.           (Dlg_TileSet "editsaveas" fn)
  884.      )
  885.      (foreach key
  886.       '("IDCANCEL" "IDOK" "IDHELP" "attributes" "partinfo"
  887.                  ;;; "delim_fld" "delim_txt"
  888.                  "ins" "del" "ins_pp" "del_pp" "display" "message1" "allparts"
  889.                  "saveini" "editsaveas" "saveas" 
  890.                  "Static4" "Static6" "Static7" "Static8" "Static9" "Static10"
  891.              )
  892.              (Dlg_TileMode key 0)
  893.          )
  894.     )
  895.     ;;; ------------------------------------------------------------------------
  896.     ;;; INIPAR_LIST
  897.     ;;; ------------------------------------------------------------------------
  898.     (defun INIPAR_LIST ()
  899.         (if (and Att_Value_Lst (not DLG_NOT_ACTIVE))
  900.             (progn
  901.                 (Dlg_ListStart "attributes" 2)
  902.                 (foreach el Att_Value_Lst
  903.                     (Dlg_ListAdd (strcat
  904.                         (car el) 
  905.                         "\t" (cadr    el)
  906.                         "\t" (caddr el)
  907.                         "\t" (last    el)
  908.                     ))
  909.                 )
  910.                 (Dlg_ListEnd)
  911.             )
  912.         )
  913.         ;; Liste 'be_anz' zusammenstellen fⁿr Anzeige der part properties.
  914.         (if (AND Prt_Value_Lst (not DLG_NOT_ACTIVE))
  915.             (progn
  916.                 (setq be_anz nil)
  917.                 (foreach el Prt_Value_Lst 
  918.                     (setq be_anz (append be_anz (list (strcat 
  919.                      (strcase(car el)) "\t" (nth 1 el) "\t" (nth 2 el) "\t" (nth 3 el)
  920.                     ))))
  921.                  )
  922.                  (ListAction "partinfo" be_anz)
  923.             )
  924.         )
  925.     )
  926.     ;;; ------------------------------------------------------------------------
  927.     ;;; Initialization of MAIN Dialog
  928.     ;;; ------------------------------------------------------------------------
  929.     (defun DlgInit ( / n)
  930.          (if FLX$WIN95 (foreach n 
  931.              '("IDCANCEL" "IDOK" "IDHELP" "attributes" "partinfo"
  932.          ;;; "delim_fld" "delim_txt"
  933.          "ins" "del" "ins_pp" "del_pp" "display" "message1" "allparts"
  934.          "saveini" "editsaveas" "saveas" 
  935.          "Static4" "Static6" "Static7" "Static8" "Static9" "Static10"
  936.         )
  937.        (Dlg_TileSetFont n 2)
  938.      ))
  939.      (Dlg_ListSetTabstops "attributes" "8 10 12")
  940.      (Dlg_ListSetTabstops "partinfo"   "8 10 12")
  941.      (INIPAR_LIST)
  942.      (NO_OF_PARTS selset) 
  943.      (Dlg_TileSet "delim_fld" SEP_FLD)
  944.      (Dlg_TileSet "delim_txt" SEP_TXT)
  945.      (Dlg_TileSet "saveini" "1") ;;; Turn Save INI-file on (!?) 
  946.      (Dlg_TileSet "editsaveas" 
  947.        (if EXPORTFILE
  948.            EXPORTFILE
  949.            (strcat (cdr (assoc "FCADCFG" (getenv))) "\\attexp.txt")
  950.        )
  951.      )
  952.      ;;; Actions: - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  953.      (Dlg_TileAction "IDCANCEL" "(setq OUTPUT nil)(Dlg_DialogDone)")
  954.      (Dlg_TileAction "IDOK" 
  955.        "(if (and OUTPUT OUTPUT_OK) (CREATE_EXPORT_TAB)(GET_VALUES)) (Dlg_DialogDone)"
  956.      )
  957.      (Dlg_TileAction "allparts" "(ATTEXP_READ_FLX)")
  958.      (Dlg_TileAction "ins"      "(ATT_INSERT)")
  959.      (Dlg_TileAction "del"      "(ATT_DELETE)")
  960.      (Dlg_TileAction "ins_pp"   "(PRT_INSERT)")
  961.      (Dlg_TileAction "del_pp"   "(PRT_DELETE)")
  962.      (Dlg_TileAction "saveas"   "(SEL_FILENAME)")
  963.      (Dlg_TileAction "display"  "(GET_VALUES)(SHOW_ATTRIB nil)")
  964.   )
  965.   ;;; --------------------------------------------------------------------------
  966.   ;;; CALL_COPYCLIP 
  967.   ;;; --------------------------------------------------------------------------
  968.   (defun CALL_COPYCLIP ( / flx_dll prog)
  969.     (setq flx_dll "fl_stup.dll")
  970.     (if (findfile (strcat FLX$DIRECTORY flx_dll))
  971.       (if (not COPYCLIP) (xload (strcat FLX$DIRECTORY flx_dll)) )
  972.       (ALERT   ; else
  973.         (strcat 
  974.           (nth 10 prt_list) ;;;@File not found: \n
  975.           "\n" flx_dll 
  976.           "\n" (nth 11 prt_list) ;;;@Clipboard function can not be executed!
  977.         )
  978.         (nth 12 prt_list) ;;;@Alert
  979.         "EXCLAMATION"
  980.       )
  981.     )
  982.   )
  983.   ;;; --------------------------------------------------------------------------
  984.   ;;; GET_ATTNAMES 
  985.   ;;; --------------------------------------------------------------------------
  986.   (defun GET_ATTNAMES (en / tmp)
  987.     (while (and (setq en (entnext en))
  988.                 (= (cdr (assoc 0 (entget en))) "ATTRIB")
  989.            )
  990.       (setq tmp (strcase (cdr (assoc 2 (entget en)))))
  991.       (if (not (member tmp Att_Name_Lst))
  992.         (setq Att_Name_Lst (append Att_Name_Lst (list tmp)))
  993.       )
  994.     )
  995.     ;;; return
  996.   )
  997.   ;;; --------------------------------------------------------------------------
  998.   ;;; NO_OF_PARTS: Number of parts with attributes
  999.   ;;; --------------------------------------------------------------------------
  1000.   (defun NO_OF_PARTS (sset / sset parts)
  1001.     (setq parts 
  1002.       (if sset 
  1003.         (strcat (itoa (sslength sset)) (nth 7 prt_list)) ;;;@ part(s)
  1004.         (nth 5 prt_list) ;;;@No parts
  1005.       )
  1006.     )
  1007.     (Dlg_TileSet
  1008.        "message1" 
  1009.        (strcat 
  1010.           parts
  1011.           (if (= e "X")
  1012.             (nth 8 prt_list) ;;;@ with attributes in drawing
  1013.             (nth 9 prt_list) ;;;@ with attributes found
  1014.           )
  1015.        )
  1016.     )
  1017.   )
  1018.   ;;; ---------------------------------------------------------------------------
  1019.   ;;; ListAction
  1020.   ;;; ---------------------------------------------------------------------------
  1021.   (defun ListAction(box lst / box lst)
  1022.      (Dlg_ListStart box)
  1023.      (mapcar 'Dlg_ListAdd lst)
  1024.          (Dlg_ListEnd)
  1025.     )
  1026.     ;;; ---------------------------------------------------------------------------
  1027.     ;;; MAIN
  1028.     ;;; ---------------------------------------------------------------------------
  1029.  
  1030.     ;;; Error Handler
  1031.  
  1032.     (FLX_FUNC_INIT)
  1033.  
  1034.     ;;; Init of variables and lists
  1035.  
  1036.     (setq dlg_not_active nil)
  1037.     (setq OUTPUT_OK nil)
  1038.     (setq SEP_FLD "," SEP_TXT "'")
  1039.     (setq Att_Name_Lst '())
  1040.  
  1041.   ;;; Xload Clipboard function
  1042.  
  1043.   (CALL_COPYCLIP)
  1044.  
  1045.   ;;; Read INI file
  1046.  
  1047.   (READ_INI)
  1048.   
  1049.   ;;; Object selection & previous selection set filter:
  1050.  
  1051.   (setq selset (ssget))
  1052.   (if selset
  1053.     (setq selset (ssget "_P" '((-4 . "<AND")(0 . "INSERT")(66 . 1)(-4 . "AND>"))))
  1054.     )
  1055.  
  1056.     ;;; GET_ATTNAMES creates Att_Name_Lst (parts and attributes of selection set)
  1057.  
  1058.     (if selset
  1059.         (progn
  1060.             (setq x 0)
  1061.             (while (< x (sslength selset))
  1062.                 (GET_ATTNAMES (ssname selset x))
  1063.                 (setq x (1+ x))
  1064.             )
  1065.         )
  1066.         ;;; No ELSE: The dialog allows to select all parts !
  1067.     )
  1068.  
  1069.     ;;; Display dialog box
  1070.  
  1071.     (if (FLX_DLGDSP "flx_axp" "attexport" "(princ)" "(DlgInit)")(princ)(exit))
  1072.  
  1073.     ;;; Write the export file
  1074.     
  1075.     (if OUTPUT (W_TO_FILE))
  1076.  
  1077.     ;;; Write the INI file
  1078.     
  1079.     (WRITE_INI (if (= saveini "1") 1 0))
  1080.  
  1081.     ;;; Xunload
  1082.     
  1083.     (if COPYCLIP (xunload "fl_stup.dll"))
  1084.  
  1085.     (FLX_FUNC_EXIT)
  1086.      
  1087.     (princ)
  1088. )
  1089.  
  1090. (princ)
  1091.  
  1092.