Ошибка no function definition nil


@nechtan3 wrote:

Hello.

I worked with .lsp below about 4 years and now it’s not working. I didn’t change the file, that error just happened. What should I do to make it work with AutoCAD 2020?


There doesnt seem to be any obvious reason for the posted code to not work in 2020. 

Is there any lisp program that works on 2020? Are there any other programs loaded at startup? 

Did the error appeared after you run the program?

Judging by the error message, the program is trying to evaluate a variable with an undefined function

((if nil
  	princ po) "nSay Hello to little friend")

Since po is not a defined function, that same error message will appear

To make it easy for everybody, debug the lisp code by using VLIDE

Command: VLIDE

Open the lisp file.

On the menu, go to Debug and choose Break on Error.

load the lisp via Ctrl+Alt+E <— very important

Go back to Autocad drawing session and run your code. if theres an error, vlide will be activated.

To see where the error on the code, go to Debug / Last Break source, the line with error will be highlghted.

Otherwise just post a sample drawing where the code does not work.

The program is to insert a block everything works fine but after running

in the command prompt it gives » ; error: no function definition: nil «

(DTR) is a function which stores the information in the list format which is provided by the user interface DCL

(defun c:getDialogInput (/ input aone )
   (setq input (DTR))
(setq aone (getpoint "nSelect pickint to insert sheet: "))
(cond				
    ((equal input  '("frptitle" "LIGHT")) progn(
						 (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP"   aone "" ""   0 )
				 )
     					)	
    ((equal input '("fabtitle" "LIGHT"))progn(
					       (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB"   aone "" ""  0 )
														))
    ((equal input '("quotitle" "LIGHT"))progn(
					      (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" ""  0)
					       							))
    	         ( T (princ "Nothing")  )    
 )
 )


Edited February 23, 2015 by SLW210


Добро пожаловать!

Войдите или зарегистрируйтесь сейчас!

Войти

Страница 1 из 2


  1. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    Почему может исчезать подпись точки при ее вращении. Исчезает только в процессе вращения, как только перестаешь вращать подпись снова появляется. C3D20011.

    #1


  2. АлексЮстасу

    Форумчанин

    Регистрация:
    28 май 2012
    Сообщения:
    1.803
    Симпатии:
    655
    Адрес:

    Маськва

    А что такое «подпись точки»?

    #2


  3. sergtor

    Форумчанин

    Регистрация:
    23 сен 2012
    Сообщения:
    1.705
    Симпатии:
    590
    Адрес:

    Ухта

    Blaukempt, попобуйте этот лисп (поворот метки точки вдоль линейного объекта). К сожалению не помню кто автор (спасибо ему).

    Вложения:

    #3


  4. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    Я не помню как там в c3d правильно называется. Есть метка точки а есть стиль точки. Скорее всего то что я имел ввиду это метка точки, значение отметки, описание или номер ее или все вместе сразу.

    — Сообщения объединены, 9 авг 2013, Оригинальное время сообщения: 9 авг 2013

    Спасибо! Попробую завтра. Я надеюсь вы имеете ввиду точку civil’a.

    #4


  5. sergtor

    Форумчанин

    Регистрация:
    23 сен 2012
    Сообщения:
    1.705
    Симпатии:
    590
    Адрес:

    Ухта

    Да, точку Civila. При указании линии поворота выполняется поворот точки вместе с меткой.

    Это все настраивается по вкусу.

    #5


  6. АлексЮстасу

    Форумчанин

    Регистрация:
    28 май 2012
    Сообщения:
    1.803
    Симпатии:
    655
    Адрес:

    Маськва

    Эти точки, похоже, разные бывают?
    И чем вращаете?
    Лучше бы приложили файлик с парой своих точек — попробовать. Например, в моих 2008 и 2012.

    #6


  7. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    вращаю ручкой. у точки есть есть ручка за нее и вращаю.

    — Сообщения объединены, 9 авг 2013, Оригинальное время сообщения: 9 авг 2013

    Что то у меня тот лисп не работает. Пишет no function definition nil
    А в тринадцатом получилось.

    #7


  8. sergtor

    Форумчанин

    Регистрация:
    23 сен 2012
    Сообщения:
    1.705
    Симпатии:
    590
    Адрес:

    Ухта

    Blaukempt, проверил, работает. Команда запуска Align-Point-by-Way указываем угол поворота (можно полилинию) и точки, которые хотим повернуть. По поводу пробемы с запуском: может поможет Это?

    #8


  9. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    Да работает но только не в 11-той версии.
    Автору большое спасибо. Это то что нужно когда снимаешь километры и километры автодорог. Хотя, на ж.д. тоже пригодится.

    #9


  10. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    По поводу пробемы с запуском: может поможет Это?
    А это была не проблема с запуском, он запускался, просил выбрать путь, потом точки и только после этого писал no function definition nil.

    #10


  11. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    Возвращусь опять к этому лиспу. На работе на 13-й версии С3D тоже не работает, пишет: «; ошибка: no function definition: nil». Как это исправить можно?

    #11


  12. sergtor

    Форумчанин

    Регистрация:
    23 сен 2012
    Сообщения:
    1.705
    Симпатии:
    590
    Адрес:

    Ухта

    Blaukempt, в начало кода добавили строку (vl-load-com) ? При выборе пути (оси) должна быть полилиния, а точки — объекты Civila.

    #12


  13. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    sergtor, там в коде программы видно что путем(осью) может выступать объект трасса сивила. точки конечно кого. а vl-load-com, там кажется другое сообщение было у человека:
    «Загружаю лисп, пытаюсь выполнить, а AutoCAD мне в ответ:
    no function definition: VLAX-GET-ACAD-OBJECT
    И результат нулевой. Что делать»
    И еще, я не совсем представляю где у кода начало. Перед точкой с запятой и всеми тире или уже после них.
    Ура заработала! Нашел у кода начало! Объект типа трасса как я и писал работает в качестве пути для разворота! Спасибо за помощь!

    #13


  14. ILYA162

    Регистрация:
    6 ноя 2012
    Сообщения:
    15
    Симпатии:
    0

    Скажите а можно ли подвинуть несколько подписей точек одним махом? Я выделяю несколько меток — но при попытке их перемещения двигается за синий квадрат только одна..Изменения всего стиля точек не вариант тк все равно ручками расставлять много подписей приходится..

    #14


  15. prokopchuk

    Форумчанин

    Регистрация:
    1 ноя 2012
    Сообщения:
    85
    Симпатии:
    39

    Да. Выделяете необходимы точки, затем зажимаете Shift и прощелкиваете квадраты у точек (за которые вытягиваете), они выделятся красным. Далее можно отпустить Shift и потянуть за любой выделенный.

    #15


  16. Blaukempt

    Форумчанин

    Регистрация:
    24 апр 2012
    Сообщения:
    570
    Симпатии:
    49

    Где же ты раньше был?!::apstenu::

    #16


  17. ILYA162

    Регистрация:
    6 ноя 2012
    Сообщения:
    15
    Симпатии:
    0


  18. Dimch123

    Форумчанин

    Надеюсь получиться у меня это сделать с липсами неразу не работал

    #18


  19. geOnix

    Форумчанин

    Регистрация:
    15 апр 2013
    Сообщения:
    71
    Симпатии:
    1

    Доброго времени суток. Подскажите, как повернуть метки точек параллельно линейному объекту. Спасибо.

    #19


  20. FOXXX591

    Форумчанин

    Регистрация:
    19 окт 2012
    Сообщения:
    3.184
    Симпатии:
    2.506
    Адрес:

    г.Смоленск

Страница 1 из 2

Поделиться этой страницей


Добро пожаловать!

Войдите или зарегистрируйтесь сейчас!

Войти

  1. Форумчанин

    Регистрация:
    22 сен 2014
    Сообщения:
    61
    Симпатии:
    6

    здравствуйте. стоит win7 x64+автокад сивил 2016+растер дизигнер
    помогите решить проблему, запускаю програмки с форума (гео-откос и гео_апп) а они не адекватно работают.
    произошло это как всегда неожиданно примерно в такой последовательности:
    все работало -> какое-то время не пользовался -> и на тебе «как отрезало»
    в частности гео-откос выдает: no function definition: vlax-ename->vla-object
    гео_апп не реагирует на кнопки, чертит не полилинии, а отрезки, не вставляет блоки.
    пробовал (vl-load-com) в коммандной строке вводить в ответ ничего
    пробовал (vla-get-activedocument (vlax-get-acad-object)) в ответ #<VLA-OBJECT IAcadDocument 0000000023870cf8>
    пробовал полную переустановку автокада с чистокой реестра и удалением папок ключей описанную здесь
    конечно при полной переустановке операционной системы все болезни лечатся, но как то это кардинально, да и времени тучу потратить
    может кто сталкивался с подобным?

    #1

  2. Регистрация:
    24 июн 2015
    Сообщения:
    7
    Симпатии:
    2

    Здравствуйте
    Нашли ответ на вопрос? Столкнулся с такой же ситуацией

    #2

  3. Форумчанин

    Регистрация:
    28 май 2012
    Сообщения:
    1.711
    Симпатии:
    639
    Адрес:

    Маськва

    Попробуйте прямо автору написать — BearDyugin
    Или в его соответствующие Ресурсы.

    #3

  4. Форумчанин

    Регистрация:
    30 ноя 2007
    Сообщения:
    2.680
    Симпатии:
    2.397
    Адрес:

    Сибирь

    С этого он и начал. Но к сожалению я не знаю в чём может быть проблема, периодически(но очень редко) обращаются с подобной проблемой, но даже предположить не могу с чем она связана. Чтобы узнать причину, мне нужно воспроизвести эту проблему на своём ПК, но сделать этого не получится.

    #4

  5. Форумчанин

  6. Регистрация:
    24 июн 2015
    Сообщения:
    7
    Симпатии:
    2

    Сейчас попробую.Спасибо.
    Вчера половину этого перечитал, вопрос так и не решил.Два раза переставлял Cad

    — Сообщения объединены, 15 ноя 2019, Оригинальное время сообщения: 15 ноя 2019

    Подскажите не совсем понятно.В реестре нашел эти строки.Как восстанавливаются пути.Где это делается?Может поможет

    #6

  7. Форумчанин

    просто поиском найди его на диске

    #7

  8. Регистрация:
    24 июн 2015
    Сообщения:
    7
    Симпатии:
    2

    Все получилось.Ура.Но пришлось менять путь в win 64, в win 32 ничего не выходило.
    Спасибо кто помогал

    Благодарность.png

    #8

  9. Форумчанин

    видимо AutoCAD у тебя х64

    #9

  10. Регистрация:
    3 июл 2019
    Сообщения:
    1
    Симпатии:
    2

    Добрый день, у меня, после удаления Autocad 2021 и установки Civil 3D вылезла аналогичная проблема — ошибка функции VLAX-ENAME->VLA-OBJECT
    И, как следствие, я не смог произвести экспорт координат в файл.
    Собственно помогло изменение реестра как указано в ссылка

    #10


    BearDyugin и Qvinto нравится это.

Поделиться этой страницей

  1. 2014-06-16, 04:50 PM

    #1

    lisaj98052674917 is offline


    Member


    Default I’m getting this message » ; error: no function definition: nil»

    I have not don list for a while just getting back into it. so I have this lisp that makes a layer from the selected element and changes the color, and moves the selected ement to that layer, This works fine except I get this error message, «would like to know what this means» and how to fix it.
    Thanks,

    Code:

     
    (defun C:LRl (/ ent elay ldata)  ; = Move To -New Layer [and make that Layer]
      (setvar "cmdecho" 0)
      (setq
        ent   (car
         (entsel
           "nSelect object to make -New Layer for and move to it: "
         )
       )
        elay  (cdr (assoc 8 (entget ent)))
       ldata    ; Layer data without non-transferable elements
       (vl-remove-if-not
         '(lambda (x) (member (car x) '(0 100 2 70 62 6)))
         (entget (tblobjname "layer" elay))
       )    ; vl-remove-if-not & ldata
      )
      (if
        (or
          (< (strlen elay) 5) ; not a long-enough Layer name to already end in -New with anything preceding
          (/= (strcase (substr elay (- (strlen elay) 3))) "-REMV")
         ; not already on a Layer like that
        )     ; and
         (progn
           (entmake
      (subst (cons 2 (strcat elay "-REMV")"") (assoc 2 ldata) ldata)
           )    ; create Layer
           ((command "_.chprop" ent "" "_layer" (strcat elay "-REMV")) ; move object to it
      (command "._layer" "_C" "8" "*-remv*" "")
           )
         )     ; progn
      )
    ("cmdecho" 1)    ; if
    (princ)
    )

    Last edited by rkmcswain; 2014-06-18 at 02:16 PM.

    Reason: added [CODE] tags


  2. 2014-06-16, 05:11 PM

    #2

    Default Re: I’m getting this message » ; error: no function definition: nil»

    Try replacing

    Code:

     ((command "_.chprop" ent "" "_layer" (strcat elay "-REMV"))

    with

    Code:

     (setq elay (strcat elay "-REMV"))
    (command "_.chprop" ent "" "_layer" elay)

    or at least get rid of the extra open parentheses.


  3. 2014-06-16, 05:16 PM

    #3

    Default Re: I’m getting this message » ; error: no function definition: nil»

    Also should be

    Code:

     (setvar "cmdecho" 1)

    While entering a system variable at the command line to change it works it will not in lisp since «cmdecho» is not a lisp command.


  4. 2014-06-16, 06:44 PM

    #4

    lisaj98052674917 is offline


    Member


    Default Re: I’m getting this message » ; error: no function definition: nil»

    Thank you for your response, tried both suggestion and still get this error message:
    it works correctly just has this funny mesage at the end. and dont really understand why.

    PLOT

    Code:

    (defun C:LR (/ ent elay ldata)		; = Move To -New Layer [and make that Layer]
    (setvar "cmdecho" 0)  
    (setq
        ent	  (car
    	    (entsel
    	      "nSelect object to make -New Layer for and move to it: "
    	    )
    	  )
        elay  (cdr (assoc 8 (entget ent)))
        ldata				; Layer data without non-transferable elements
    	  (vl-remove-if-not
    	    '(lambda (x) (member (car x) '(0 100 2 70 62 6)))
    	    (entget (tblobjname "layer" elay))
    	  )				; vl-remove-if-not & ldata
      )
      (if
        (or
          (< (strlen elay) 5)
    			; not a long-enough Layer name to already end in -New with anything preceding
          (/= (strcase (substr elay (- (strlen elay) 3))) "-REMV")
    					; not already on a Layer like that
        )					; and
         (progn
           (entmake
    	 (subst (cons 2 (strcat elay "-REMV")) (assoc 2 ldata) ldata))	; create Layer
    ((command "_.chprop" ent "" "_layer" (strcat elay "-REMV") "" "" ""); move object to it
    (command "._layer" "_C" "8" "*-remv*" "")
    (setvar "cmdecho" 1)
           )
         )					; progn
      )					; if
    )

    Last edited by rkmcswain; 2014-06-18 at 02:17 PM.

    Reason: added [CODE] tags


  5. 2014-06-16, 07:27 PM

    #5

    Default Re: I’m getting this message » ; error: no function definition: nil»

    Try clicking the ‘Go Advanced’ button, Then pick ‘Wrap [CODE] tags around selected text’ (# symbol from menu bars) and place the lisp code inside the [CODE] tags. That makes it easier for us to test your code.

    Pasting everything that was output to the command line in response to the command may help as well.


  6. 2014-06-18, 02:24 PM

    #6

    Default Re: I’m getting this message » ; error: no function definition: nil»

    When you paste code into the edit window, please add [CODE] to the beginning and [/CODE] to the end of your code. That will cause the code to be printed in a special window/font so it’s easy to spot, copy, etc.

    Code:

    ;;; this is a sample

  7. 2014-06-20, 01:40 PM

    #7

    lisaj98052674917 is offline


    Member


    Default Re: I’m getting this message » ; error: no function definition: nil»

    Code:

    (defun C:LR (/ ent elay ldata)		; = Move To -New Layer [and make that Layer]
      (setq
        ent	  (car
    	    (entsel "nSelect object to make -New Layer for and move to it: "))
        elay  (cdr (assoc 8 (entget ent)))
        ldata ; Layer data without non-transferable elements
    	  (vl-remove-if-not
    	    '(lambda (x) (member (car x) '(0 100 2 70 62 6)))
    	    (entget (tblobjname "layer" elay))
    	  ); vl-remove-if-not & ldata
      ):
      (if
        (or
          (< (strlen elay) 5)
    	; not a long-enough Layer name to already end in -New with anything preceding
          (/= (strcase (substr elay (- (strlen elay) 3))) "-REMV"); not already on a Layer like that
        ); and
         (progn
           (entmake
    	 (subst (cons 2 (strcat elay "-REMV")) (assoc 2 ldata) ldata))	; create Layer
           (command "._layer" "_C" "8" "*-remv*" "")
           (command "_.chprop" ent	 "" "_layer" (strcat elay "-REMV") "" "" ""); move object to it
    	 
           )
        )					; progn
      )					; if
    )					; defun

  8. 2014-06-20, 01:59 PM

    #8

    Default Re: I’m getting this message » ; error: no function definition: nil»

    Try:

    Code:

    (defun C:LR (/ ent elay ldata)		; = Move To -New Layer [and make that Layer]
      (setq
        ent	  (car
    	    (entsel
    	      "nSelect object to make -New Layer for and move to it: "
    	    )
    	  )
        elay  (cdr (assoc 8 (entget ent)))
        ldata				; Layer data without non-transferable elements
    	  (vl-remove-if-not
    	    '(lambda (x) (member (car x) '(0 100 2 70 62 6)))
    	    (entget (tblobjname "layer" elay))
    	  )				; vl-remove-if-not & ldata
      )
      :
      (if
        (or
          (< (strlen elay) 5)
    					; not a long-enough Layer name to already end in -New with anything preceding
          (/= (strcase (substr elay (- (strlen elay) 3))) "-REMV")
    					; not already on a Layer like that
        )					; and
         (progn
           (entmake
    	 (subst (cons 2 (strcat elay "-REMV")) (assoc 2 ldata) ldata)
           )				; create Layer
           (command "_.chprop" ent	 "" "_layer" (strcat elay "-REMV") "" "._layer" "_C" "8" "*-remv*" ""); move object to it
         )					; progn
      )					; if
      (princ)
    )

  9. 2014-06-20, 07:59 PM

    #9

    lisaj98052674917 is offline


    Member


    Default Re: I’m getting this message » ; error: no function definition: nil»

    Is there a way to have this promt for user input for the layer it creates?


  10. 2014-06-23, 05:16 PM

    #10

    Default Re: I’m getting this message » ; error: no function definition: nil»

    Try:

    Code:

    (defun C:LR (/ str len ent elay ldata)		; = Move To -New Layer [and make that Layer]
      (setq
        str	  (getstring T "nAdd Suffix: ")
        len	  (strlen str)
        ent	  (car
    	    (entsel
    	      "nSelect object to make -New Layer for and move to it: "
    	    )
    	  )
        elay  (cdr (assoc 8 (entget ent)))
        ldata				; Layer data without non-transferable elements
    	  (vl-remove-if-not
    	    '(lambda (x) (member (car x) '(0 100 2 70 62 6)))
    	    (entget (tblobjname "layer" elay))
    	  )				; vl-remove-if-not & ldata
      )
      :
      (if
        (or
          (< (strlen elay) len)
    					; not a long-enough Layer name to already end in -New with anything preceding
          (/= (strcase (substr elay (- (strlen elay) len))) str)
    					; not already on a Layer like that
        )					; and
         (progn
           (entmake
    	 (subst (cons 2 (strcat elay str)) (assoc 2 ldata) ldata)
           )				; create Layer
           (command "_.chprop" ent	 "" "_layer" (strcat elay str) "" "._layer" "_C" "8" (strcat "*" str) ""); move object to it
         )					; progn
      )					; if
      (princ)
    )

Перейти к содержимому раздела

Форумы CADUser

Информационный портал для профессионалов в области САПР

Вы не вошли. Пожалуйста, войдите или зарегистрируйтесь.

Дерево сообщений Активные темы Темы без ответов

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

#1 21 декабря 2007г. 01:59:52

  • Salina
  • Восстановленный участник
  • На форуме с 25 июля 2007г.
  • Сообщений: 14
  • Спасибо: 0

Тема: error: no function definition

Взят с форума лисп, положен в папку support, макрос на кнопку
^C^C^P(if (not (calc_dist)) (load «calc_dist.lsp»)) (calc_dist)
Сам лисп

(defun c:mlen2 (/ adoc selset layer_list init _kpblc-string-subst item sum_len)
  (vl-load-com)
  (setq  adoc  (vla-get-activedocument (vlax-get-acad-object))
  sum_len  0.0
  ) ;_ end of setq
  (vla-startundomark adoc)
  (if
    (setq ent (entsel "nУкажите примитив, с которого брать слой <Выход> : "))
     (progn
       (setq selset (ssget (list (assoc 8 (entget (car ent))))))
       (while (and selset
       (> (sslength selset) 0)
       ) ;_ end of and
   (setq item (ssname selset 0))
   (ssdel item selset)
   (setq item    (vlax-ename->vla-object item)
         sum_len (+ sum_len
        (if (vlax-property-available-p item 'length)
          (vla-get-length item)
          (cond
            ((= (strcase (vla-get-objectname item) t) "acdbarc")
             (vla-get-arclength item)
             )
            ((= (strcase (vla-get-objectname item) t) "acbcircle")
             (* pi 2.0 (vla-get-radius item))
             )
            (t 0.0)
            ) ;_ end of cond
          ) ;_ end of if
        ) ;_ end of +
         ) ;_ end of setq
   ) ;_ end of while
       (princ (rtos sum_len 2 4))
       ) ;_ end of progn
     ) ;_ end of if
  (vla-endundomark adoc)
  (princ)
  ) ;_ end of defun

И хоть убейся-выдает ошибку error: no function definition: CALC_DIST
Не подскажете, в чем может быть проблема?

#2 Ответ от Electr 21 декабря 2007г. 05:56:43

  • Electr
  • Активный участник
  • Откуда: Киргизстан / Биш
  • На форуме с 6 августа 2007г.
  • Сообщений: 241
  • Спасибо: 2

Re: error: no function definition

Исравь в программе calc_dist на mlen2

#3 Ответ от Electr 21 декабря 2007г. 06:00:07

  • Electr
  • Активный участник
  • Откуда: Киргизстан / Биш
  • На форуме с 6 августа 2007г.
  • Сообщений: 241
  • Спасибо: 2

Re: error: no function definition

Извини не в программе а в макросе. И надо чтобы файл программы назывался mlen2.lsp
^C^C^P(if (not (mlen2)) (load «mlen2.lsp»)) (mlen2)

#4 Ответ от Salina 21 декабря 2007г. 14:16:01

  • Salina
  • Восстановленный участник
  • На форуме с 25 июля 2007г.
  • Сообщений: 14
  • Спасибо: 0

Re: error: no function definition

не получается. теперь error: no function definition: MLEN2 :(

#5 Ответ от Hrenn 21 декабря 2007г. 14:30:27

  • Hrenn
  • Восстановленный участник
  • На форуме с 28 октября 2004г.
  • Сообщений: 2,016
  • Спасибо: 0

Re: error: no function definition

Файл с программой имеет имя mlen2.lsp или какое другое?

#6 Ответ от Salina 21 декабря 2007г. 14:32:02

  • Salina
  • Восстановленный участник
  • На форуме с 25 июля 2007г.
  • Сообщений: 14
  • Спасибо: 0

Re: error: no function definition

именно mlen2.lsp

#7 Ответ от Hrenn 21 декабря 2007г. 14:37:26

  • Hrenn
  • Восстановленный участник
  • На форуме с 28 октября 2004г.
  • Сообщений: 2,016
  • Спасибо: 0

Re: error: no function definition

Попробуйте вручную загрузить лисп через команду _appload
После загрузки введите с ком. строки

Если заработает — надо править макрос

#8 Ответ от Hrenn 21 декабря 2007г. 14:48:58

  • Hrenn
  • Восстановленный участник
  • На форуме с 28 октября 2004г.
  • Сообщений: 2,016
  • Спасибо: 0

Re: error: no function definition

Ещё проверить, прописан ли путь к папке Support в настройках _options

#9 Ответ от Salina 21 декабря 2007г. 14:50:44

  • Salina
  • Восстановленный участник
  • На форуме с 25 июля 2007г.
  • Сообщений: 14
  • Спасибо: 0

Re: error: no function definition

так работает, с кнопки-никак

#10 Ответ от Salina 21 декабря 2007г. 14:51:33

  • Salina
  • Восстановленный участник
  • На форуме с 25 июля 2007г.
  • Сообщений: 14
  • Спасибо: 0

Re: error: no function definition

путь к папке прописан. второй лисп работает в той же папке без проблем.

#11 Ответ от Александр Ривилис 21 декабря 2007г. 15:00:22

  • Александр Ривилис
  • Александр Ривилис
  • Активный участник
  • Откуда: Украина / Киев
  • На форуме с 15 апреля 2005г.
  • Сообщений: 8,659
  • Спасибо: 157

Re: error: no function definition

А так:

^C^C^P(if (not c:mlen2) (load "mlen2.lsp")) mlen2

Или так:

^C^C^P(if (not c:mlen2) (load "mlen2.lsp")) (c:mlen2)

?

#12 Ответ от Salina 21 декабря 2007г. 15:16:15

  • Salina
  • Восстановленный участник
  • На форуме с 25 июля 2007г.
  • Сообщений: 14
  • Спасибо: 0

Re: error: no function definition

а так работает! Спасибо!

Сообщения 12

Тему читают: 1 гость

Страницы 1

Чтобы отправить ответ, вы должны войти или зарегистрироваться

  • Home
  • Forum
  • Discussions and Support
  • Programming
  • AutoLISP
  • «No function definition» After COMMAND Call

  1. 2015-10-01, 05:58 PM


    #1

    Question «No function definition» After COMMAND Call

    Hey All,

    Simple little problem, lisp works fine, but I get an annoying «error: no function definition: nil».

    I know this line of code returns nil, but I don’t know how to stop the error… Any ideas?

    Code:

    (command "_.shademode" "G")

    Full lisp (to toggle wireframe/shaded modes):

    Code:

    (defun c:togglevs (/ cvs)       (setq cvs
    	      (assoc 281 (entget (tblobjname "VPORT" "*ACTIVE")))
    	     )
      (setq cvs (cdr cvs))
      
      (cond
        (
         (OR
         (= cvs 0)
         (= cvs 1)
         (= cvs 2)
         )
         (
          (command "_.shademode" "G")
          (prompt "Toggling to Shaded mode")
          )
         )
        (
         (OR
         (= cvs 4)
         (= cvs 6)
         )
         (
          (command "_.shademode" "3D")
          (prompt "Toggling to Wireframe mode")
          )
         )
        )
      (princ)
      )


  2. 2015-10-01, 07:46 PM


    #2

    Default Re: «No function definition» After COMMAND Call

    I guess you have an extra parenthesis before that command call which is no needed.


  3. 2015-10-01, 07:55 PM


    #3

    Default Re: «No function definition» After COMMAND Call

    Quote Originally Posted by Tharwat
    View Post

    I guess you have an extra parenthesis before that command call which is no needed.

    That parentheses wraps the «command» and «prompt» statements together as the «then» part of the COND statement.

    Code:

    (
       (command "_.shademode" "G")
       (prompt "Toggling to Shaded mode")
    )


  4. 2015-10-01, 08:01 PM


    #4

    Default Re: «No function definition» After COMMAND Call

    Quote Originally Posted by stusic
    View Post

    That parentheses wraps the «command» and «prompt» statements together as the «then» part of the COND statement.

    Code:

    (
       (command "_.shademode" "G")
       (prompt "Toggling to Shaded mode")
    )

    That is not needed with cond function nor even the progrn function


  5. 2015-10-01, 08:34 PM


    #5

    Default Re: «No function definition» After COMMAND Call

    Quote Originally Posted by Tharwat
    View Post

    That is not needed with cond function nor even the progrn function

    How would I separate the «ifs» from the «thens»?


  6. 2015-10-01, 08:35 PM


    #6

    Default Re: «No function definition» After COMMAND Call

    Try this UNTESTED :

    Code:

    (defun c:togglevs (/ cvs)
      (if (setq csv (tblobjname "VPORT" "*ACTIVE"))
        (setq cvs (cdr (assoc 281 (entget csv))))
      )
      (cond
        ((<= 0 cvs 2)
         (command "_.shademode" "G")
         (prompt "Toggling to Shaded mode")
        )
        (
         (OR
           (= cvs 4)
           (= cvs 6)
         )
         (command "_.shademode" "3D")
         (prompt "Toggling to Wireframe mode")
        )
      )
      (princ)
    )


  7. 2015-10-01, 08:55 PM


    #7

    Default Re: «No function definition» After COMMAND Call

    Interesting.

    I tried your code: works.
    I tried my code, but removed the parentheses as you suggested: works.

    Note: I see now how the COND statement still works without the parentheses. Thanks


  8. 2015-10-01, 09:05 PM


    #8

    Default Re: «No function definition» After COMMAND Call

    Quote Originally Posted by stusic
    View Post

    Interesting.

    I tried your code: works.
    I tried my code, but removed the parentheses as you suggested: works.

    Note: I see now how the COND statement still works without the parentheses. Thanks

    Excellent. You’re welcome.


  • Home
  • Forum
  • Discussions and Support
  • Programming
  • AutoLISP
  • «No function definition» After COMMAND Call

Similar Threads

  1. Replies: 9

    Last Post: 2014-06-23, 05:16 PM

  2. Replies: 2

    Last Post: 2010-04-20, 12:09 PM

  3. Replies: 3

    Last Post: 2008-04-30, 02:20 PM

  4. Replies: 41

    Last Post: 2007-11-20, 12:32 AM

  5. Replies: 39

    Last Post: 2005-11-04, 08:22 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

  • Ошибка no free edicts
  • Ошибка no find kernelgz ошибка no split boot image
  • Ошибка no entry cfgworlds
  • Ошибка no displayport cable
  • Ошибка no connection to acestream service