Author Topic: 'start_list' not working...Please help!  (Read 11160 times)

0 Members and 1 Guest are viewing this topic.

whdjr

  • Guest
'start_list' not working...Please help!
« on: November 08, 2005, 11:47:17 AM »
Why would start_list stop working in Acad2006 when it has a loaded dcl file and a valid list?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: 'start_list' not working...Please help!
« Reply #1 on: November 08, 2005, 11:49:36 AM »
dunno, did it work in A2k5 or previous?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

whdjr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #2 on: November 08, 2005, 12:08:19 PM »
Yes and it worked in 2006 just a couple of hours ago.  I have restarted Acad a dozen times and it still hasn't reset itself.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: 'start_list' not working...Please help!
« Reply #3 on: November 08, 2005, 12:13:17 PM »
<dumb question but first one that comes to mind> Was the tile renamed?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Bob Wahr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #4 on: November 08, 2005, 12:20:26 PM »
I've had cases where restarting acad doesn't help that restarting the cpu does.

whdjr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #5 on: November 08, 2005, 01:32:16 PM »
I tried a warm boot and a cold boot and it didn't fix the problem.  On top of that I tested some of my other lisp code with dcl files and they didn't work either.  Something is terrible screwy here. :x

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: 'start_list' not working...Please help!
« Reply #6 on: November 08, 2005, 01:36:36 PM »
Is it possible you've inadvertently re-defined a lisp function like start_list, end_list etc?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #7 on: November 08, 2005, 01:41:34 PM »
I guess anythings possible.

What should I do - make sure any of my code doesn't load automatically then try to step it off in the VLIDE?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: 'start_list' not working...Please help!
« Reply #8 on: November 08, 2005, 01:43:35 PM »
I'd start by carefully examining the lisp program files that I edited on or about the time everything went south, particularly those that are loaded automagically on startup.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: 'start_list' not working...Please help!
« Reply #9 on: November 08, 2005, 02:08:56 PM »
I suggest you check the path to the DCL files as well
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

whdjr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #10 on: November 08, 2005, 02:34:27 PM »
I can't find anything that I've changed.  It just doesn't make since.  It shows that the dcl file is loaded.  It shows that the list info is available.  It just won't start the list. :evil:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: 'start_list' not working...Please help!
« Reply #11 on: November 08, 2005, 02:57:47 PM »
Time to start posting code me thinks.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #12 on: November 08, 2005, 03:19:50 PM »
Alright here goes:

It is unfinished but should run.  I tried to compile all the utility functions and variables into this code from my toolbox so holler if you are missing something.

Lisp code:
Code: [Select]
(defun c:att (/    attlist strlist      *acad*
      *adoc*    *layouts* *layout_list*
      *sort*    *get_atts* *dialog*
     )
;;;
  (setq *acad* (vlax-get-acad-object))
  (setq *adoc* (vla-get-activedocument *acad*))
  (setq *layouts* (vla-get-layouts *adoc*))
  (defun *layout_list* (/ lst)
    (vlax-map-collection
      *layouts*
      '(lambda (x) (setq lst (cons x lst)))
    )
    (cdr
      (*sort* lst 'vla-get-taborder)
    )
  )
;;;
  (defun *sort* (lst func)
    (vl-sort lst
     '(lambda (e1 e2)
(< ((eval func) e1) ((eval func) e2))
      )
    )
  )
;;;
  (defun *get_atts* (obj)
    (vlax-safearray->list
      (vlax-variant-value
(vla-getattributes
  (if (eq (type obj) 'ENAME)
    (vlax-ename->vla-object obj)
    obj
  )
)
      )
    )
  )
;;;
  (defun *dialog* (lst / id eb1 selection)
 ;
    (defun on_list_pick ()
      (if (= (get_tile "atts") "")
(mode_tile "select" 1)
(mode_tile "select" 0)
      )
    )
 ;
    (and (setq id (load_dcl "att.DCL"))
(start_list "atts")
(mapcar 'add_list lst)
(not (end_list))
(action_tile "cancel" "(done_dialog 0)")
(action_tile
   "update"
   (strcat
     "(setq selection (get_tile \"atts\"))"
     "(setq eb1 (atoi (get_tile \"eb1\")))(done_dialog 1)"
   )
)
(action_tile
   "apply"
   "(done_dialog 2)"
)
(action_tile "atts" "(on_list_pick)")
(not (mode_tile "update" 1))
(not (mode_tile "apply" 1))
(start_dialog)
(not (unload_dialog id))
    )
    (if selection
      selection
      (*error* "No selection made  ")
    )
  )
;;;
;;;
;;;
  (defun load_dcl (name / dcl dcl_id)
    (while
      (if (minusp (setq dcl_id (load_dialog name)))
(setq dcl (getfiled "Select correct DCL file location: "
    dcl
    "dcl"
    (+ 8 128)
  )
)
(not (new_dialog "attribute_edit" dcl_id))
      )
    )
    dcl_id
  )
;;;
  (defun *error* (msg)
    (princ "\nError: ")
    (princ msg)
    (princ)
    (gc)
    (princ)
  )
;;;
;;;
;;;
  (setq attlist (mapcar
  '(lambda (x)
     (vlax-for obj (vla-get-block x)
       (if (and (eq (vla-get-objectname obj)
    "AcDbBlockReference"
)
(eq (vla-get-name obj) "R-TB30X42")
   )
(car
   (vl-remove
     nil
     (mapcar '(lambda (y)
(if (eq (vla-get-tagstring y) "XXX")
  (list x y)
)
      )
     (*get_atts* obj)
     )
   )
)
       )
     )
   )
  (*layout_list*)
)
strlist (mapcar '(lambda (z)
   (strcat (vla-get-name (car z))
   "\t"
   (vla-get-textstring (cadr z))
   )
)
attlist
)
  )
  (*dialog* strlist)
  (princ)
)

Dcl file:

Code: [Select]
attribute_edit : dialog {
  label = "Attribute Edit";
  : list_box {
      key = "atts";
      tabs = "30";
      height = 12;
      multiple_select = true;
      }
      :boxed_column {
         label = "\"Number Of\"  to match Index of Drawings";
         :edit_box {
          key = "eb1";
          label = " Enter starting sheet number:";
          edit_limit = 4;
          width = 30;
          action = "";
          }           
      }
  :row {
    : button {
      label = "&Update";
      key = "update";
      width = 10;
      }
    : button {
      label = "&Apply";
      key = "apply";
      width = 10;
      }
    : button {
      label = "&Cancel";
      is_cancel = true;
      key = "cancel";
      width = 10;
      }
   }
   :spacer_1 {
   }
   :text_part {
         label = "Copyright 2005 Will DeLoach";
      }
}

and a test dwg:


When run you should get a dialog box with the tab name and 'XXX' on the same line in the dialog box.

Thanks for all your help,

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: 'start_list' not working...Please help!
« Reply #13 on: November 08, 2005, 03:49:08 PM »
I can't download from here and don't have time to dive real deep, but can you add this line:

(mapcar 'prin1 strlist)

right before --

(*dialog* strlist)

and then tell us what it displays when you run the proggy?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

whdjr

  • Guest
Re: 'start_list' not working...Please help!
« Reply #14 on: November 08, 2005, 04:00:24 PM »
This is what it returns:
Code: [Select]
"A7.01\tXXX""A7.02\tXXX""A7.03\tXXX""A7.04\tXXX"which is exactly what it is supposed to return.

"
A7.01  -  tabname
\t       -  this is just for tab spacing in the dcl file
XXX    -  this is the shhet number(the whole purpose of this tool is to set that programmaticly)
"