Author Topic: LayoutMerge--"bad argument type: lentityp nil"  (Read 5459 times)

0 Members and 1 Guest are viewing this topic.

highflyingbird

  • Bull Frog
  • Posts: 415
  • Later equals never.
LayoutMerge--"bad argument type: lentityp nil"
« on: August 02, 2007, 04:59:19 AM »
LayoutMerge(Express tools) can't run.

It prompt "bad argument type: lentityp nil",what's the problem? Someone has the same question.

« Last Edit: August 02, 2007, 05:02:30 AM by highflybird »
I am a bilingualist,Chinese and Chinglish.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #1 on: August 02, 2007, 05:11:08 AM »
How about loading the LSP into the VLIDE, set for 'break on error', load it into ACAD and see where the error is when it breaks .. ?

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

highflyingbird

  • Bull Frog
  • Posts: 415
  • Later equals never.
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #2 on: August 02, 2007, 06:18:13 AM »
-->layoutmerge.lsp--> tblname.lsp
  ......
  (repeat (length lst)
    (setq na (acet-dict-ename tblname (nth n lst))
            e1 (entget na)
    );setq
  ......

I caught the error: "na" is nil,so "(entget na)" can't run.
But I can't find the function "acet-dict-ename" ,how can I find that lisp file?
 
« Last Edit: August 02, 2007, 06:20:12 AM by highflybird »
I am a bilingualist,Chinese and Chinglish.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #3 on: August 02, 2007, 05:26:58 PM »
Mine looks like this ...
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun acet-groups-to-xdata ( prefix / lst na e1 lst2 a na2 e2 xd j b name n )
 
 (setq lst (acet-dict-name-list "acad_group"))
 (setq n 0)
 (repeat (length lst)
 (setq    a (nth n lst)
         na (acet-dict-ename "acad_group" a)
         e1 (entget na)
          a (acet-str-replace "*" "" a)
          name (strcat prefix a)
          b (list .........

... which version are you using ?

The acet-dict-ename is compiled in one of the fas files in AC2008
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

highflyingbird

  • Bull Frog
  • Posts: 415
  • Later equals never.
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #4 on: August 02, 2007, 09:27:12 PM »
It's R2006.The acet-dict-ename is compiled ?
Thanks Kerry Brown.
I am a bilingualist,Chinese and Chinglish.

hmspe

  • Bull Frog
  • Posts: 362
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #5 on: August 03, 2007, 12:39:28 AM »
My guess is that the function is:

(defun acet-dict-ename (dictname dictentry / entry ename)
  (setq ename NIL)
  (if (setq entry (dictsearch (namedobjdict) dictname))
    (if   (setq entry (cdr (assoc -1 entry)))
      (if (setq entry (dictsearch entry dictentry))
   (setq ename (cdr (assoc -1 entry)))
      )
    )
  )
  ename
)

Martin
"Science is the belief in the ignorance of experts." - Richard Feynman

LUCAS

  • Newt
  • Posts: 32
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #6 on: August 03, 2007, 01:18:20 AM »
(defun ACET-DICT-FILTER-MATCH (TBLNAME FLT / N LST NA E1 LST2)
  (ACET-AUTOLOAD
    '("acetflt.lsp" "(bns_filter_match tblname flt)")
  )
  (setq LST (ACET-DICT-NAME-LIST TBLNAME))
  (setq N 0)
  (setq   AAAA (vla-get-layouts
          (vla-get-activedocument (vlax-get-acad-object))
        )
  )
  (repeat (length LST)
    (setq NA            ;(acet-dict-ename tblname (nth n lst))
        (vlax-vla-object->ename (vla-item AAAA (nth N LST)));LUCAS
     E1 (entget NA)
    )               ;setq
    (if   (BNS_FILTER_MATCH E1 FLT)
      (setq E1    (cons (cons 2 (nth N LST)) E1)
       LST2 (append LST2 (list E1))
      )               ;setq
    )               ;if
    (setq N (+ N 1))         ;setq
  )               ;repeat
  LST2
)               ;defun acet-dict-filter-match

highflyingbird

  • Bull Frog
  • Posts: 415
  • Later equals never.
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #7 on: August 03, 2007, 03:21:23 AM »
It's OK!

Thanks hmspe and Lucas!

Is it a bug for the tblname.lsp?

« Last Edit: August 03, 2007, 03:27:08 AM by highflybird »
I am a bilingualist,Chinese and Chinglish.

LUCAS

  • Newt
  • Posts: 32
Re: LayoutMerge--"bad argument type: lentityp nil"
« Reply #8 on: August 06, 2007, 04:39:30 AM »
(setq ENTRY (dictsearch (namedobjdict) "ACAD_LAYOUT"))
(setq ENTRY (cdr (assoc -1 ENTRY)))
;;(dictsearch ENTRY "MODEL");;THAT OK!
(dictsearch ENTRY "配置2");;DICTSEARCH(NOT SUPPORT CHINESE)