Ошибка неверный тип аргумента numberp nil

I am writing a function that removes background mask from all mtext, however, I am getting a bad argument type: numberp: nil error after running the code:

(defun c:bgm ()
    (vl-load-com)
    (setq ss1 (ssget "X" '((0 . "MTEXT")(-4 . "<OR")(90 . 1)(90 . 3)(-4 . "OR>")))); selects all mtext with background mask on
    (setq sscount (sslength ss1))
    (repeat sscount
        (setq mtxtobj (entget (vlax-vla-object->ename (ssname ss1 counter))))
        (vla-put-backgroundfill mtxtobj :vlax-false)
        (entmod mtxtobj)
    )
)

Any ideas why?

asked Jun 23, 2018 at 12:13

Kevin Chiha's user avatar

There are a number of issues with your code:

  1. If the ssget expression does not obtain a selection (i.e. if there are no objects present in the drawing which fulfil the selection criteria), then ssget will return nil, and consequently the sslength function will error when supplied with a null argument.

    To avoid this, test the value returned by the ssget function using an if statement before proceeding with the remaining code:

    (if (setq ss1 (ssget "_X" '((0 . "MTEXT") (-4 . "<OR") (90 . 1) (90 . 3) (-4 . "OR>"))))
        (progn
            (setq sscount (sslength ss1))
            ...
        )
    )
    
  2. You reference the variable counter in your ssname function, which is not defined in the scope of the c:bgm function:

    (ssname ss1 counter)
    

    This should instead be sscount as defined earlier in your code.

  3. You seem to be confused between entity names and vla-objects:

    • ssname returns an entity name, however, you are passing this to the vlax-vla-object->ename function, which converts a vla-object to an entity name.

    • You are using the vla-put-backgroundfill function to change the backgroundfill property of a vla-object, however, you are passing this function the variable defined by the value returned by entget, which is a DXF data list, not a vla-object.

    • You are using entmod to modify the DXF data assigned to the variable mtxtobj — this is not required when changing ActiveX properties of a vla-object.


Taking the above into consideration, I would suggest the following solution:

(defun c:bgm ( / cnt obj sel )
    (if (setq sel (ssget "_X" '((0 . "MTEXT") (-4 . "<OR") (90 . 1) (90 . 3) (-4 . "OR>"))))
        (repeat (setq cnt (sslength sel))
            (setq cnt (1- cnt)
                  obj (vlax-ename->vla-object (ssname sel cnt))
            )
            (vla-put-backgroundfill obj :vlax-false)
        )
    )
    (princ)
)
(vl-load-com) (princ)

answered Jun 24, 2018 at 10:11

Lee Mac's user avatar

Lee MacLee Mac

15.7k6 gold badges33 silver badges80 bronze badges

1

The error is probably due to:

(ssname ss1 counter)

where counter is nil.
You should use sscount instead. You also have to decrement the sscount value to iterate through the selection set.

(defun c:bgm (/ ss1 sscount)
  (vl-load-com)
  (if (setq ss1 (ssget "X" '((0 . "MTEXT") (-4 . "<OR") (90 . 1) (90 . 3) (-4 . "OR>"))))
    (repeat (setq sscount (sslength ss1))
      (setq sscount (1- sscount)
        mtxtobj (vlax-vla-object->ename (ssname ss1 sscount))
      )
      (vla-put-backgroundfill mtxtobj :vlax-false)
    )
  )
)

answered Jun 23, 2018 at 17:41

gileCAD's user avatar

gileCADgileCAD

2,2951 gold badge10 silver badges10 bronze badges

1

From the thread «stringp nil error» at the next link:

http://discussion.autodesk.com/thread.jspa?messageID=5404144

«Re: stringp nil error
The VLIDE can really help you here.

Open your code in the editor, and load it from within the editor. Then go to
the Debug menu, and make sure the Break On Error option is selected. Now
execute your code, either from AutoCAD’s command prompt, or the Visual LISP
Console window.

When the error occurs, the VLIDE should pop up. And you can use the button
that looks like a red dot with parens around it and an arrow pointing into
it (Last break). This will highlight the statement where the error occurs.
You will find on of your variables is set to nil, instead of some value (a
string) your code expects.

While in break mode you can use Inspect to see what variables or even
statements evaluate to. To take the debugging a step further, set a break
point (F9) somewhere above the problem statement and execute the function
again. When the code reaches the break point, the VLIDE will become active
and you can step thru each statement using F8. Inspect what is happening
with your code.

That ought to help you find the source of the issue.


R. Robert Bell»

HTH,

Constantin

a écrit dans le message de news:
5407425@discussion.autodesk.com…
using visual lisp editor can i find my error that is causing this message
from autocad: bad argument type: numberp: nil?

8 минут назад, newborn сказал:

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

Однозначно, блоком. Т.к., потом этот чертеж может редактироваться. Работать с кучей отрезков, имеющих фиксированное взаимное положение, — это ад.

Бывали случаи, когда отдельные проектировщики специально разбивали блоки и полилинии перед передачей заказчику, чтобы затруднить дальнейшую работу с исходниками. Не нужно такие решения тиражировать). Кроме того, используя блоки с атрибутами, можно сразу охватить и автоматизированное заполнение штампов.

12 минут назад, newborn сказал:

предложили создать программу для его автоматической отрисовки — т.е. автоматизации работы технолога + добавить актуальность на фоне перехода из автокада в нанокад.

Фишка в том, что написание лиспа — это автоматизация, но это решение универсальное для АС и NC, поэтому к переходу отношения не имеет. 

А предлагаемая мной выше тема с СПДС как раз может покрыть именно  это требование.

Кстати, там красиво решена и задача  оформления  форматок чертежа.

добавлено через 2 минуты

3 минуты назад, lidia.antipina.ru сказал:

Прошло 20 с лишним лет, как навояла дисер на тему автоматизации ТП и станочных приспособ (думала, что тема уплывала окончательно, но надо перевернуть страницу и благополучно забыть), а воз и ныне там…

Ну, чисто с т.з. академического интереса или обучающего процесса — почему бы и нет?)))

From the thread «stringp nil error» at the next link:

http://discussion.autodesk.com/thread.jspa?messageID=5404144

«Re: stringp nil error
The VLIDE can really help you here.

Open your code in the editor, and load it from within the editor. Then go to
the Debug menu, and make sure the Break On Error option is selected. Now
execute your code, either from AutoCAD’s command prompt, or the Visual LISP
Console window.

When the error occurs, the VLIDE should pop up. And you can use the button
that looks like a red dot with parens around it and an arrow pointing into
it (Last break). This will highlight the statement where the error occurs.
You will find on of your variables is set to nil, instead of some value (a
string) your code expects.

While in break mode you can use Inspect to see what variables or even
statements evaluate to. To take the debugging a step further, set a break
point (F9) somewhere above the problem statement and execute the function
again. When the code reaches the break point, the VLIDE will become active
and you can step thru each statement using F8. Inspect what is happening
with your code.

That ought to help you find the source of the issue.


R. Robert Bell»

HTH,

Constantin

a écrit dans le message de news:
5407425@discussion.autodesk.com…
using visual lisp editor can i find my error that is causing this message
from autocad: bad argument type: numberp: nil?

I am writing a function that removes background mask from all mtext, however, I am getting a bad argument type: numberp: nil error after running the code:

(defun c:bgm ()
    (vl-load-com)
    (setq ss1 (ssget "X" '((0 . "MTEXT")(-4 . "<OR")(90 . 1)(90 . 3)(-4 . "OR>")))); selects all mtext with background mask on
    (setq sscount (sslength ss1))
    (repeat sscount
        (setq mtxtobj (entget (vlax-vla-object->ename (ssname ss1 counter))))
        (vla-put-backgroundfill mtxtobj :vlax-false)
        (entmod mtxtobj)
    )
)

Any ideas why?

asked Jun 23, 2018 at 12:13

Kevin Chiha's user avatar

There are a number of issues with your code:

  1. If the ssget expression does not obtain a selection (i.e. if there are no objects present in the drawing which fulfil the selection criteria), then ssget will return nil, and consequently the sslength function will error when supplied with a null argument.

    To avoid this, test the value returned by the ssget function using an if statement before proceeding with the remaining code:

    (if (setq ss1 (ssget "_X" '((0 . "MTEXT") (-4 . "<OR") (90 . 1) (90 . 3) (-4 . "OR>"))))
        (progn
            (setq sscount (sslength ss1))
            ...
        )
    )
    
  2. You reference the variable counter in your ssname function, which is not defined in the scope of the c:bgm function:

    (ssname ss1 counter)
    

    This should instead be sscount as defined earlier in your code.

  3. You seem to be confused between entity names and vla-objects:

    • ssname returns an entity name, however, you are passing this to the vlax-vla-object->ename function, which converts a vla-object to an entity name.

    • You are using the vla-put-backgroundfill function to change the backgroundfill property of a vla-object, however, you are passing this function the variable defined by the value returned by entget, which is a DXF data list, not a vla-object.

    • You are using entmod to modify the DXF data assigned to the variable mtxtobj — this is not required when changing ActiveX properties of a vla-object.


Taking the above into consideration, I would suggest the following solution:

(defun c:bgm ( / cnt obj sel )
    (if (setq sel (ssget "_X" '((0 . "MTEXT") (-4 . "<OR") (90 . 1) (90 . 3) (-4 . "OR>"))))
        (repeat (setq cnt (sslength sel))
            (setq cnt (1- cnt)
                  obj (vlax-ename->vla-object (ssname sel cnt))
            )
            (vla-put-backgroundfill obj :vlax-false)
        )
    )
    (princ)
)
(vl-load-com) (princ)

answered Jun 24, 2018 at 10:11

Lee Mac's user avatar

Lee MacLee Mac

15.5k6 gold badges32 silver badges80 bronze badges

1

The error is probably due to:

(ssname ss1 counter)

where counter is nil.
You should use sscount instead. You also have to decrement the sscount value to iterate through the selection set.

(defun c:bgm (/ ss1 sscount)
  (vl-load-com)
  (if (setq ss1 (ssget "X" '((0 . "MTEXT") (-4 . "<OR") (90 . 1) (90 . 3) (-4 . "OR>"))))
    (repeat (setq sscount (sslength ss1))
      (setq sscount (1- sscount)
        mtxtobj (vlax-vla-object->ename (ssname ss1 sscount))
      )
      (vla-put-backgroundfill mtxtobj :vlax-false)
    )
  )
)

answered Jun 23, 2018 at 17:41

gileCAD's user avatar

gileCADgileCAD

2,2801 gold badge10 silver badges10 bronze badges

1

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

1

08.11.2015, 21:43. Показов 10281. Ответов 21


Студворк — интернет-сервис помощи студентам

Здравствуйте! Необходимо реализовать вывод и ввод в файлы. Программа чертит заданную по условию фигуру и проверяет попадает ли точка в заштрихованную область. Пользователь может выбрать вводить ли ему точку самому (с клавиатуры), либо ввести точку из файла (где я и застряла). Точка введённая пользователем с клавиатуры должна быть записана в файл (тут тоже не лучше). В общем не получается у меня с файлами работать(

0

Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

08.11.2015, 21:43

Ответы с готовыми решениями:

Работа с файлом
Добрый вечер.
Нужна помощь с задачкой.
Переписать содержимое исходного файла в другой текстовый…

Программа в AUTOLISP
Здравствуйте,не могли бы вы мне помочь вот с таким заданием для AutoLisp

Пятнадцать трапеций,…

Программа в AutoLISP
Известна длинна окружности. Найти площадь круга, ограниченного этой окружностью.

Запуск AutoLISP
Как запустить AutoLISP в AutoCad&quot;e. Я выбираю Сервис=Приложения=… и в открывшемся окне на диске…

21

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

08.11.2015, 21:53

2

В чем проблема-то?

0

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

08.11.2015, 21:58

 [ТС]

3

Не видит файл. (чтение)

0

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

08.11.2015, 22:04

4

Цитата
Сообщение от Virviglaz
Посмотреть сообщение

Не видит файл

Так покажи, автокад курсы экстрасенсов не проходил, он работает только в каталогах, описанных в путях поддержки, либо при указании абсолютного пути

0

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

08.11.2015, 22:13

 [ТС]

5

Посмотрите для начала мой код. Вы тоже сейчас занимаетесь экстрасенсорикой. Там два варианта вывода из файла. Я бы хотела получить какою-нибудь помощь или пояснение по данному вопросу.

0

vlisp

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

08.11.2015, 23:17

6

я не вижу ничего криминального в увиденном в части чтения из файла, по идее должно работать. Ну разве что можно попробовать такой вариант, что он выдаст:

Lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(defun FileToList (strfrom / f fk aa a )
  (setq f (findfile strfrom))
  (if (null f)
    (alert "Файл не найден")
    (progn
      (setq fk (open strfrom "r")
            aa (list)
            a  (read-line fk)
      )
      (while a
        (setq aa (append aa (list a)))
        (setq a (read-line fk))
      )
      (close fk)
    )
  )
  aa
)

1

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

09.11.2015, 00:32

 [ТС]

7

ошибка: неверный тип аргумента

0

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

09.11.2015, 01:08

8

Цитата
Сообщение от Virviglaz
Посмотреть сообщение

ошибка: неверный тип аргумента

Это не вся строка, сложно было скопировать полностью? Как вызываете функцию FileToList?

0

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

09.11.2015, 01:27

 [ТС]

9

Я вызываю весь написанный мною код с самого начала. Вызов делаю через командную строку AutoCAD.
; ошибка: неверный тип аргумента: numberp: nil
и если вызвать вашу функцию отдельно таким же образом:
; ошибка: слишком мало аргументов

0

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

09.11.2015, 01:56

10

Цитата
Сообщение от Virviglaz
Посмотреть сообщение

; ошибка: неверный тип аргумента: numberp: nil

эта ошибка означает что в оператор подставляется неинициализированная переменная

Цитата
Сообщение от Virviglaz
Посмотреть сообщение

; ошибка: слишком мало аргументов

тут вообще все понятно… забыли подставить один или несколько аргументов… нужно быть внимательнее и пользоваться инструментами форматирования кода

0

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

09.11.2015, 02:14

 [ТС]

11

Цитата
Сообщение от vlisp
Посмотреть сообщение

эта ошибка означает что в оператор подставляется неинициализированная переменная

осталось только понять в каком именно месте. т.к ваша функция верна. в предыдущих вариантах чтения из файла такой ошибки не наблюдалось.

0

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

09.11.2015, 02:20

12

Если файл пустой, то функция вернет nil, иначе список строк, который все равно еще нужно преобразовывать в список чисел и уже из него брать число для подстановки… используйте средства отладки vlide для отлова ошибок

0

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

09.11.2015, 02:40

 [ТС]

13

А вот такой вопрос, пожалуй его следовало задать сразу: мне не сильно понятен сам код . Если в первом случае фигурирует полный путь к файлу и его наименование, что является для меня привычным, то здесь я ничего такого не вижу.

0

597 / 917 / 149

Регистрация: 10.08.2015

Сообщений: 4,815

09.11.2015, 08:36

14

Цитата
Сообщение от Virviglaz
Посмотреть сообщение

Если в первом случае фигурирует полный путь к файлу и его наименование, что является для меня привычным, то здесь я ничего такого не вижу.

настройка путей поддержки избавляет от необходимости использовать абсолютные пути

0

Lambdik

1048 / 942 / 107

Регистрация: 04.11.2012

Сообщений: 972

Записей в блоге: 3

09.11.2015, 23:11

15

Virviglaz Ну как, получается? Слишком много букв лишних в этой теме.

Важно понимать, что для записи в файл используется два разных механизма, не зависящих друг от друга.
Один механизм, это работа с файлом. А второй, работа с потоком данных.
Ведь можно открыть файл и тут же закрыть его, ничего с ним не делая, не так ли?

Запись в файл сделаем пошагово.

Lisp
1
2
3
4
5
;;; Для начала немного прелюдии.
;; узнать местонахождения файла открытого рисунка
(setq address (getvar "dwgprefix"))
;; создать путь к целевому файлу
(setq file-path (getfiled "Выбрать/Создать файл для записи" address "txt" 1))
Lisp
1
2
3
4
5
6
7
;;; А теперь работаем с файлом.
;; открыть файл на дозапись
(setq descriptor (open file-path "a"))
;; записать координату [используем поток данных]
(prin1 '(5.2 8.1 0.0) descriptor)
;; закрыть файл
(close descriptor)
Lisp
1
2
3
4
5
6
;; можем повторить, только теперь учтём перенос строки
(setq descriptor (open file-path "a"))
;; следующая координата
(print '(4.6 2.9 0.0) descriptor)
;; закрыли
(close descriptor)

Считывание из файла.

Lisp
1
2
3
4
5
6
7
8
;; открыть файл на чтение
(setq descriptor (open file-path "r"))
;; считать строку
(read-line descriptor)
;; считать следующую строку, если её там нет - вернёт nil
(read-line descriptor)
;; закрыть файл
(close descriptor)

Здесь полезная информация.

2

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

10.11.2015, 04:13

 [ТС]

16

Цитата
Сообщение от Lambdik
Посмотреть сообщение

Ну как, получается?

Пока нет. Большое спасибо за ссылку. Итак,из файла мы считываем строку, которая содержит координаты точки. В дальнейшем, чтобы их использовать мы должны как-то преобразовать строку в список. Из идей только эта: разбить саму строку на подстроки, которые и объединить в список. (Надо/не надо; Верно/ не верно???)
P.S. Ранее хотелось сделать так, чтобы считывалось по одной точке из файла за каждый вызов функции. Ну а то что программа вообще увидела файл будем считать успехом.

0

Lambdik

1048 / 942 / 107

Регистрация: 04.11.2012

Сообщений: 972

Записей в блоге: 3

10.11.2015, 10:34

17

Цитата
Сообщение от Virviglaz
Посмотреть сообщение

мы должны как-то преобразовать строку в список. Из идей только эта: разбить саму строку на подстроки, которые и объединить в список.

Функция read читает из строки до первого пробела.

Lisp
1
2
3
(setq coordinate "(5.2 8.1 0.0)")
;; скобки там уже есть, потому просто читаем
(read coordinate)

Функции для работы со строками.

2

Virviglaz

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

16.11.2015, 06:00

 [ТС]

18

Lambdik, вы не совсем поняли мой последний вопрос, но для начала я покажу что у меня вообще получилось

Lisp
1
2
3
4
5
6
7
8
(setq p1 (getpoint "Введите координaты любой точки через запятую:"))
    )
;;запись в файл координат, введённых пользователем с клавиатуры
 (progn
(setq FILE (open "d:\user.txt" "a"))
(prin1 p1   FILE)
(close FILE)
 )

Если с записью всё хорошо, то с выводом будет хуже:

Lisp
1
2
3
4
5
6
7
8
9
10
11
12
(setq answer (getstring "n Ввести точку вручную или из файла? <В/Ф>"));ветвление на различные способы ввода
  (if (or (= answer "Ф")(= answer "ф"))
   (progn 
(setq FILE (open "d:\points.txt"  "r"))
(setq p2 (read-line FILE))
(setq p1 (list))
 
(while (/= p2 nil)
(setq p1 (append p1 (list p2))) ;;попытка что-то сделать с полученной строкой
(setq p2 (read-line FILE))
  )
(close FILE)

Программа видит и читает файл. Загвоздка в условии. Это задача на определение вхождения точки в заштрихованную область. В моём случае областью является круг с центром в начале координат (радиус = 2). В круге есть вертикально расположенный прямоугольник (высота = 2, ширина = 1). Я писала проверку для точки введённой с клавиатуры. Выглядит она так:

Lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(setq x (car p1)) ;; разбиваем нашу точку на отдельные координаты, чтобы подставить в уравнение
  (setq y (cadr p1))
  (setq Rad 4)
  (setq r (+ (expt x 2) (expt y 2)))
    (
     if (and (<= r  Rad) (or (<= x 0) (>= x 1))) ;;уравнение окружности с центром в нач. коорд. + учёт прямоугольн.
      (progn
    (command "_.Color" "61")
    
      (SetVar "PDMODE" 34)
      (SetVar "PDSIZE" 0)
      (command "_.Point" p1 )
    
      (command "_.Text" p1  "0.1" "0" "Попал")
      )
      (progn
       (command "_.Color" "61");; всякая красота для оповещения пользователя
       (SetVar "PDMODE" 34)
       (SetVar "PDSIZE" 0)
      (command "_.Point" p1 )
       (command "_.Text" p1  "0.1" "0" "Не попал")))

Для точки введённой с клавиатуры проверка работает. Как быть с точкой которую мы считали (строку по сути дела)? Ведь для проверки необходимо как-то преобразовать строку в список. Вот на этом я и застряла. Может надо в принципе переписать как-то код?

0

Lambdik

1048 / 942 / 107

Регистрация: 04.11.2012

Сообщений: 972

Записей в блоге: 3

16.11.2015, 22:50

19

Virviglaz Очень рад что стараетесь учить, это я одобряю. Могу помочь с типами данных.
Преобразуем строку в список:

Lisp
1
2
3
4
(setq string "123.0 45.0 0.0")
(read (strcat "(" string ")"))
 
=> (123.0 45.0 0.0)

То есть если в файле записаны координаты без скобок, а просто числа. То считываем из файла, сцепляем со скобками и применяем read. Всё просто.
А на счёт попадания в область, так это уже геометрия.

Добавлено через 8 часов 36 минут
И ещё, функция command принимает аргументы как списочного, так и строкового типа. Чтобы не делать лишних преобразований.

Lisp
1
2
3
(command "_.line" "0,0,0" "5,7,0" "")
 
(command "_.line" '(0.0 0.0 0.0) '(5.0 -7.0 0.0) "")

1

Virviglaz

3 / 3 / 1

Регистрация: 21.10.2015

Сообщений: 92

18.11.2015, 00:52

 [ТС]

20

Я сдаюсь

Lisp
1
2
3
(setq FILE (open "d:\points.txt"  "r"))
(setq p2 (read-line FILE))
(setq p1(read(strcat "(" p2 ")")))

; ошибка: неверный тип аргумента: numberp: nil
и ещё много много много разных вариантов и команд.

0

am using lisp routine ARC-PARK in 2011 and getting this error. Have seen older posts with same error, but not code savvy. None specifically addressing this lisp.

any help would be greatly appreciated.

;Tip1815: ARC-PARK.LSP PARKING ON AN ARC ©2002, Ron Engberg

;; This routine allows the user to place parking stalls along an arc.

;;

;; Written by Ron Engberg 12-2000

;; Radians to degrees

(defun RTD ® (* (/ R pi) 180))

;; Degrees to Radians

(defun DTR ® (/ (* 2 pi) 360))

(defun

C:ARC-PARK (/ ENT ARC-PT1 STALL-W STALL-L ARC-SIDE ARC-DIR

STALL-COUNT ARC_LIST ARC-CPT ARC-DIAM S-ANG E-ANG

ARC-CIRC DELTA ARC-LENGTH STALL-ANGLE-IN STALL-ANGLE-OUT

ARC-BASE ARC-ROT-ANGLE

)

;; Screen echo off

(setvar «cmdecho» 0)

;; Set to World UCS

(command «ucs» «w»)

;; Parking stall information

(setq ENT (entsel «nSelect ARC: «))

(initget 1)

(setq ARC-PT1 (getpoint «nStarting End of ARC: «))

(initget 7)

(setq STALL-W (getreal «nStall Width: «))

(initget 7)

(setq STALL-L (getreal «nStall Length: «))

(setq ARC-SIDE (getstring «nInside or Outside : «))

(setq

ARC-DIR

(getstring «nClockwise or Counter Clockwise : «)

) ;_ end of setq

(initget 7)

(setq STALL-COUNT (getint «nNumber of Stalls: «))

;; Arc information

(setq ARC_LIST (entget (car ENT)))

(setq ARC-CPT (cdr (assoc 10 ARC_LIST))) ;center point

(setq ARC-DIAM (* (cdr (assoc 40 ARC_LIST)) 2)) ;arc diameter

(if (or (= ARC-SIDE «I») (= ARC-SIDE «i»))

(setq ARC-DIAM (- ARC-DIAM (* 2 STALL-L)))

) ;_ end of if

(setq

S-ANG

(cdr (assoc 50 ARC_LIST)) ;start angle

E-ANG

(cdr (assoc 51 ARC_LIST)) ;end angle

ARC-CIRC

(* pi ARC-DIAM) ;arc circumference

;arc length

) ; end arc info

;; Test for delta angle

(if (> S_ANG E_ANG)

(setq DELTA (+ (- 6.2831853 S-ANG) E-ANG))

(setq DELTA (abs (- S-ANG E-ANG)))

) ; end if

(setq ARC-LENGTH (* (cdr (assoc 40 ARC_LIST)) DELTA))

;; Angle for starter line

(setq

STALL-ANGLE-IN

(angle ARC-PT1 ARC-CPT) ;stalls inside arc

STALL-ANGLE-OUT

(angle ARC-CPT ARC-PT1) ;stalls outside arc

) ; end set group

;; Rotation info

(setq

ARC-BASE

(/ ARC-CIRC 360.0000) ;length per degree

ARC-ROT-ANGLE

(/ STALL-W ARC-BASE) ;degrees per stall

) ; end set group

;; Test for inside or outside

(if (or (= ARC-SIDE «I») (= ARC-SIDE «i»)) ;case sensitive ?

(command «line» ARC-PT1 (polar ARC-PT1 STALL-ANGLE-IN STALL-L) «»)

;if inside

(command «line» ARC-PT1 (polar ARC-PT1 STALL-ANGLE-OUT STALL-L) «»)

;else, outside

) ;end if

;; Test for clockwise or counter clockwise

(if (or (= ARC-DIR «CCW») (= ARC-DIR «ccw»)) ;case sensitive ?

(progn

(repeat STALL-COUNT

(command «array» «l» «» «P» ARC-CPT «2» ARC-ROT-ANGLE «Y»)

) ;_ end of repeat

) ; if ccw

(progn

(repeat STALL-COUNT

(command

«array»

«l»

«»

«P»

ARC-CPT

«2»

(- ARC-ROT-ANGLE (* 2 ARC-ROT-ANGLE))

«Y»

) ;_ end of command

) ;_ end of repeat

) ; else cw

) ; end if

;; Reset UCS

(command «ucs» «p»)

(princ)

;; Screen echo on

(setvar «cmdecho» 1)

) ;_ end of defun

Issue

You received an error message beginning with the words Error: ‘Bad argument type’. Here are some examples:

  • Error: ‘Bad argument type: Numberp nil’
  • Error: ‘Bad argument type: Stringp nil’
  • Error: ‘Bad argument type: VLA-object nil’
  • Error: ‘Bad argument type: lentityp nil’
  • Error: ‘Bad argument type: VLA-object-collection’
  • Sys-error: ‘Bad argument type: 2D/3D point: nil’
  • Error: ‘Bad argument type: consp nil’
  • Error: ‘Bad argument type: INT nil’

Solution

You might see any number of possible errors that begin with Bad argument type, Before getting into the specific error you saw, it’s important to go through a few simple troubleshooting steps:

• What to do first when you see a Bad Argument Type error

If you receive any error message that includes the text «bad argument type» – including all specific error messages listed on this page – go through the following three steps before getting into any of the various bad argument type error messages listed below. Any bad argument type error can potentially stem from either drawing corruption or a bug in the code, so you’ll need to either rule out or resolve these two causes first.

Step 1: Take a screenshot of the error report

Immediately after receiving the error, press the F2 key on your keyboard. Pressing F2 will open the error report in your AutoCAD Command line, and you’ll be able to see actually generated the bad argument error. It’s important that you take a screenshot of the error report in the Command line and save it to your desktop. You may need it later to figure out what caused the error, and we may ask you to send that screenshot to our tech support team to help us diagnose the issue. 

Closed the error message already? No worries – just do the same thing you did to get the error (place a plant, select a valve, etc.). The error will likely pop up again and you can press F2 and screenshot the error report.

Step 2: Rule out, or address, drawing corruption

Bad argument type errors often result from corruption in your drawing. To check for corruption, open a fresh new DWG drawing file and try the same action that generated the error. For example, if you saw the error immediately after placing a plant or setting your drawing scale, do that same thing in the blank drawing. 

***Important***: It’s crucial that you follow our specific steps to duplicate an error in a blank drawing.

  • Did you get the same bad argument type error in the blank drawing? If so, move on to Step 3.
  • Were you able to complete the same action in the blank drawing without generating the error? If so, the issue is almost certainly the result of drawing corruption. Here’s what to do:

1. Open the file where you first saw the error, and follow our steps to clean your drawing.

2. Configure our recommended settings for showing Proxy information. These settings will help you determine whether your drawing file is still corrupt.

3. Open the cleaned drawing file. If you configured the Proxy information settings correctly, you should see a Proxy Information dialog box immediately. Does this dialog box show no Proxy Objects? If so, your file is clean. Now try the same action (placing a plant, setting the scale, etc.) that generated the error.

  • No error? You’ve resolved the issue.
  • Still getting a bad argument type error? Move on to Step 3.  

Step 3: Check for a bug in the code

Once you’ve either ruled out or addressed drawing corruption, it’s time to check whether the error is the result of a bug in the code of our software.

Note that a bad argument type error will always mean that a variable in the code is not what the system is expecting. In fact, it could be the result of a simple bug – the most common of which is a typo in the code. In this case, the “object” in question may be just fine, but the variable name was mistyped in the code. (Yes, even programmers are human!) So of course the misspelled version is certainly not an object reference and is therefore nil – hence the error message.

The easiest way to check for a bug is to check our list of recent updates.

  • Don’t see a recent update that’s related to what you tried to do when you saw the error? You’ve likely ruled out a bug. It’s time to locate and address the specific bad argument type error message you’re seeing.
  • Do you see a recent update that’s related to what you tried to do when you saw the error? If so, there’s a good chance you’ve detected a bug in the code. For example, if you saw a bad argument type error when you attempted to place a Reference Note Callout, and a recent update has to do with Reference Note Callouts, there’s your bug! If you think you’ve found a bug, please let us know by sending us a technical support ticket. Make sure to include the following items in the ticket:

    • The exact text of the error message, and a screenshot of the error message (if you have it)
    • A description of the action you took that generated the error message (such as placing a plant, editing a detail, etc.)
    • A screenshot of the error report you generated by pressing the F2 key after seeing the error message. Don’t have a screenshot? Just do the same thing that caused the error. You’ll see the bad argument type error message. Press F2 now, and take a screenshot of the entire AutoCAD Command line. Include this screenshot in the technical support ticket.

Based on your ticket, we’ll take a look at the code and determine whether there is indeed a bug. If so, we’ll get right on repairing it in an update. You’ve helped us improve the software!

 Close

Specific ‘Bad Argument Type’ Errors

If you went through the «What to do first» steps above and are still seeing the error, it’s time to get into the specific Bad argument type error you’re seeing.

We’re continually logging the causes and solutions of new Bad argument type errors as we see them. Here are the specific ones we’ve seen:

• Error: ‘Bad argument type: Numberp: nil’

  • If you saw this error when trying to use our Nuke tool, your Proxy settings are configured incorrectly. Please follow our recommendations for the Proxy settings in the Options dialog box. You should then be able to Nuke properly.
  • Are you getting this message when using our Verify tool for Lighting? If so, make sure you don’t have any looped wire sections in your wire paths to fixtures.
  • Otherwise, this error will invariably be the result of drawing corruption. Follow our steps to clean your drawing.

 Close

• Error: ‘Bad argument type: Stringp nil’

You might see this error when you:

  • Tried to use our Verify Labels tool, or when working specifically with plants.
  • Had our Color Render tool turned on.
  • Attempted to open AutoCAD or F/X CAD, and it completely froze.
  • Tried to add a dripline hatch to your project.
  • Tried to place a block from our Discipline Graphics library

As you can see, this particular Bad argument error has several possible causes and, as a result, potential solutions. See our Error: ‘Bad Argument Type: Stringp Nil’ article to find your solution.

 Close

• Error: ‘Bad argument type: VLA-OBJECT nil’

A bad argument type error containing the text VLA-object nil means the software is expecting something in your drawing to be a «smart» object, but a variable in the code has caused that thing to not actually be an object. (In other words, it’s nil.) As a result, the software was not able to reference that object, which in turn prevented it from carrying out the action you were trying to complete and generated the error message.

As for the actual issue, it will depend on what you were trying to do when you received the error, as well as which object reference is now nil. Here are a few possible causes:

  • You have Local Data (MySQL), and your database connection object is nil

First, make absolute sure that you’ve followed our steps for what to do first when you see a bad argument type error – especially Step 3: Check for a bug in the code. Take note of exactly what you did (or tried to do) that resulted in the error, and check it against our recent updates, as described in those steps. 

If you can rule out a bug in the software based on those steps, your next step should be to diagnose a possible problem with your MySQL database server – but only if you’re using our software with a local (MySQL) database. Ask your IT administrator to troubleshoot your office’s MySQL database server, as described on our slow Land F/X performance troubleshooting article. Don’t know whether you’re using Local Data? Your CAD manager or IT admin can let you know.

  • You attempted to create a colorized plan using our Color Render tool 

In this case, the problematic object is a Truecolor object. If you’re getting this error every time you try to apply plant color, you can repair the error by following our steps to uninstall and reinstall AutoCAD or F/X CAD.

  • An XML file is damaged or missing

Are you getting this error right when opening CAD? Is CAD freezing up and you’re unable to use our software? If so, a file named _install_.xml, stored in your LandFX folder, is likely damaged or missing.

In this case, follow our steps to restore the install.xml file.

  • You attempted to perform one of several possible actions with a detail

Finally, you might receive this error when working with a detail. For example, you may have tried to edit, save, copy, or place a detail when you received the error.

In this case, the system is unable to read or write in that detail’s XML file. This can occur for several possible reasons:

  • You don’t have read/write permissions for the folder where that XML file lives. Have your IT administrator ensure that you have all the proper permissions to work with your office’s details. 
  • Your details are stored at a UNC path, which we don’t recommend. Ask your IT administrator to ensure that the folder containing your details is mapped to a letter drive.
  • Any number of issues with your Windows installation – another potential set of troubleshooting steps for your IT admin to complete.
  • Malware (less common). Your IT administrator should ensure that your computer and network are free of malware.

If you’ve ruled out all of the causes listed above, it’s likely that the XML file is missing from the location where the detail is stored. If so, copy the detail to your desktop and use our Save Detail tool to save it into the system.

Still getting the error? If you’ve ruled out permissions, a UNC path, your Windows installation, and malware, it’s possible that you or someone in your office has attempted to import the detail into a Land F/X project but clicked on the wrong XML file.  

Specifically, this error is the result of importing the file _index_.xml rather than the correct XML file for the detail you intended to import.

Instead, you need to import the XML file from the corresponding exported detail. Open the Detail Explorer and click Import.

You’ll then be prompted to select a detail export file.

Navigate to the location where you’ve exported the detail.

Open that folder, and select the file details.xml. Click Open.

You should now be able to work with that detail without receiving the error.

 Close

• Error: ‘Bad argument type: lentityp nil’

A bad argument type error containing the text lentityp nil can have several possible causes, including:

  • Drawing corruption (most commonly), or a bug in the software code

Make absolute certain that you’ve followed our steps for what to do first when you see a bad argument type error. Those steps include instructions on how to check for corruption in your drawing and how to check for a bug in the software.

Note that drawing corruption is the most common cause of this error. If you detect drawing corruption when completing the «what to do first» steps, follow our steps to clean your drawing and all Xrefs. We always recommend cleaning every single drawing you receive from someone else before you start working on it. Keeping your drawings clean will prevent a host of issues (including this error) and save you tons of time.

  • Locked layers in a drawing that contains callouts

If you’ve ruled out a bug and drawing corruption, the error is likely the result of locked layers that are preventing you from working with callouts in your drawing. These can include:

  • Plant labels
  • Reference Notes (RefNotes) 
  • Detail callouts
  • Valve callouts

To unlock layers in your drawing, see our lock/unlock layers documentation section. Note: We don’t recommend locking layers in your drawings – except those that contain your Xrefs.

At the very least, unlock all layers that contain callouts (or portions of callouts). You should now be able to continue working without seeing the error message.

 Close

• Error: ‘Bad argument type: VLA-object collection, VLA-object’

An error message containing the text ‘Bad argument type: vla-object collection’ is always the result of the software attempting (and failing) to determine which sheet you are working on. You might receive this error when:

  • Setting the drawing scale
  • Working with details or detail callouts
  • Doing anything that requires the software to know which sheet you are working on

Follow our steps to resolve this specific error.

 Close

• Sys-error: ‘Bad argument type: 2D/3D point: nil’

You’ll most commonly see this error when trying place or copy an object, or carry out a similar type of action, using one of our tools. You’re seeing the error because the system is unable to calculate an intersection in your drawing. Specifically, it’s trying (and failing) to calculate the distance between the cursor and the object you’re trying to place, copy, or verify. (We’ve seen it happen with placing plants or irrigation equipment such as valves, or using tools such as our Plant Mirror tool that copy objects in a drawing.)

Here’s a past example of this error message:

 [3.33] (sys-error «bad argument type: 2D/3D point: nil»)

:ERROR-BREAK.28 nil
[4.25] (ANGLE (907.216 795.06 0.0) nil)
[5.19] (C:VALVECALLOUT)

In this example, the user tried to place a valve callout but was unsuccessful because the system was unable to calculate the angle between the cursor and valve that was being called out. (Note that the issue can affect any number of items, from irrigation to plant labeling, site objects, etc.) 

This error most commonly results from:

• Corruption in your drawing

Drawing corruption is by far the most common cause of this error. Your first step should be to follow our instructions to clean the drawing and all Xrefs.

Cleaning your drawing will often take care of the error.

Still seeing the error after cleaning your drawing? Read on.

A bad argument type error containing the text 2D/3D point: nil can also result from:

• A bug in the software code

Make absolute sure you’ve followed our steps for what to do first when you see a bad argument type error – especially Step 3: Check for a bug in the code. Take note of exactly what you did (or tried to do) that resulted in the error, and check it against our recent updates, as described in those steps.

• Working in Paper Space rather than Model Space

Check whether you are working in Paper Space. If so, open the Model tab and work in Model Space. Try the same action that generated the error, but in Model Space. If you don’t see the error, you’ve resolved the issue.

You might also see this error if you’re labeling in a Paper Space viewport with the intention that the labels will be moved to Paper Space. If so, the error is occurring because of a problem with either the viewport or the User Coordinate System (UCS) you’re currently using.

Try labeling in a different Paper Space viewport. If you don’t see the error, you’ve isolated the problem to the other viewport.

• A problem with the current User Coordinate System (UCS)

The UCS you’re currently using for your drawing may have an issue that’s preventing the software from calculating angles between the cursor and objects in your plan. To check for and resolve this issue:

  • Use our Restore UCS tool to return your drawing to the World Coordinate System (WCS). Then try the action that generated the error (such as placing a valve callout).

    • Don’t see the error when attempting the same action in the WCS? If not, use our New UCS tool to set a new UCS for your drawing. Make sure you use our New UCS tool – not the AutoCAD UCS command.
    • Does the error persist in the WCS? If so, make absolute sure you’re working in Model Space and not Paper Space.

• An object with a Z elevation

You might see this error when clicking on an object that mistakenly has a Z elevation set to it. For example, you may be trying to call out a plant or a valve with a Z elevation.

Select the object you clicked.

Then open the Properties panel by typing Prop in the Command line and pressing Enter.

In the Properties panel, check the Position Z entry. If it’s anything other than 0, set it to 0. (If it’s already at 0, the object does not have a Z elevation.)

If you changed the Z elevation to 0, try the action that generated the error. Are you able to click the object without getting the error? You’ve solved the issue.

• Attempting to click objects on a locked layer

You might be trying to select an object on a locked layer. For example, you may be trying to call out a plant or valve whose layer is locked. See our section on locked and unlocked layers for instructions on how to unlock layers.

We generally don’t recommend locking layers – except those that contain your Xrefs.

• Using our Verify Labels tool when one of the blocks in your plan is empty – that is, no linework or objects inside the block

In this case, check the Command line history for the name of the object that caused the error. Check the Land F/X object data to determine which block is assigned. Then use one of the following possible solution options:

Option 1: Edit the data to use a different block that isn’t empty.

Option 2: Fix the empty block by either:

  • Using our Using our REDEFINEBLOCK tool, or
  • Editing the block manually to add linework inside it

Option 3: If using Reference Notes (RefNotes), consider whether the reason for the empty block is that you don’t actually want the block to be visible in your drawing.

If you don’t in fact want the block to be visible, change the RefNote from an Amenity RefNote to a Notation RefNote. Then use the Quick Select command to select and delete all the empty blocks and place Notation callouts instead.

 Close

• Error: ‘Bad argument type: consp nil’

This error can result from:

  • A bug in the software code

Make absolute sure you’ve followed our steps for what to do first when you see a bad argument type error – especially Step 3: Check for a bug in the code. Take note of exactly what you did (or tried to do) that resulted in the error, and check it against our recent updates, as described in those steps.

  • Attempting to select an item in your plan that is no longer in the current Land F/X project 

Once you’ve ruled out a bug, it’s time to check whether an object you’re attempting to select, such as a plant or a piece of irrigation equipment, has been removed from your project. If so, you’ll need to add that item back to your project.

  • A font issue

Did you get this error when trying to place text? Solution >

  • Update didn’t complete

Did you get this error after trying to run an update? The update may not have completed correctly. Follow our steps to Revert to a previous version after an update. Then run the update again and restart your computer.

 Close

• Error: ‘Bad argument type: INT nil’

We’ve seen this error pop up right after clicking the Site Color palette, but you might see it when you select or use other Land F/X tools as welll.

You can resolve this error quickly by following our steps to install the latest OpenDCL library.

 Close

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

Форумы CADUser

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

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

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

Страницы 1

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

#1 27 апреля 2008г. 14:35:20

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Тема: Нужна помощь с AutoLISP

Здравствуйте!
Задали написать программу на автолиспе чтобы запрашивала у пользователя размеры того что будет строить. Я не знаю каким образом это осоуществить. вроде с функциями типа commnad и setq разобрался, а как спросить пользователя у размерах, и каким образом недопкстить задание им слишком больших или слишком малых размеров?
Зарание спасибо.

#2 Ответ от Н.Н.Полещук 27 апреля 2008г. 14:43:37

  • Н.Н.Полещук
  • Восстановленный участник
  • На форуме с 19 марта 2004г.
  • Сообщений: 358
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

> Aspirine
См. функции getreal, getint, initget, getpoint

#3 Ответ от Aspirine 27 апреля 2008г. 14:56:09

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

Спасибо. А не подскажите какую-нибудь литературу в которой описаны эти функции?

#4 Ответ от Aspirine 28 апреля 2008г. 11:24:58

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

В общем немного разобрался. Вот только проблема небольшая. Вот код:

(command "_cylinder" "0,0,0" "3" "6")
(setq c1 (ssget "l"))
(command "_cylinder" "0,0,0" "1.25" "8")
(setq c2 (ssget "l"))
(command "_cone" "0,0,8" "1.25" "радиус" "0.5" "0.2")
(setq k1 (ssget "l"))
(command "_zoom" "гр" "")
(command "_.union" c2 k1 "")
;(setq c1 (entlast))

При попытке загрузки в автокад, выдаёт:
«; ошибка: неверная строка режима ssget»
Синтаксис проверил, вроде всё норма.
В чем проблема?
P.S. Цункцию ssget пытаюсь использовать для дальнейшего использования команд _union и _substract. Если возможно подругому подскажите плиз. Спасибо.

#5 Ответ от Александр Ривилис 28 апреля 2008г. 13:30:12

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

Re: Нужна помощь с AutoLISP

#6 Ответ от Aspirine 28 апреля 2008г. 14:14:40

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

Спасибо. Действительно помогло…
Можно ещё вопрос. Мне нужно организовать чтобы пользователь имел возможность сам вводить размеры детали из определённой зоны значений.
Написал пока вот что:

(setq hd 10)
  (setq parametr1 (getreal (strcat "\nВведите высоту детали <" (rtos hd) ">: ")))
  (setq hd (if parametr1 parametr1 hd))
(setq rc1 3)
  (setq parametr2 (getreal (strcat "\nВведите радиус большого цилиндра <" (rtos rb) ">: ")))
  (setq rc1 (if parametr2 parametr2 rc1))
(setq rb1 6)
  (setq parametr3 (getreal (strcat "\nВведите высоту большого цилиндра <" (rtos rs) ">: ")))
     (while (> parametr3 hd)
     (setq parametr3 (getreal (strcat "\nВведите высоту большого цилиндра <" (rtos rs) ">: ")))
     )
  (setq rb1 (if parametr3 parametr3 rb1))

При загрузке а AutoCAD, он даёт ввести первое значение, а потом вылетает обратно в редактор автолиспа и в консоли Автолиспа следующая ошибка:
«ошибка: неверный тип аргумента: numberp: nil»
Никак не могу понять в чём проблема.

#7 Ответ от Victor 28 апреля 2008г. 14:38:09

  • Victor
  • Восстановленный участник
  • На форуме с 26 марта 2007г.
  • Сообщений: 270
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

Что такое rb?

#8 Ответ от Atol 28 апреля 2008г. 14:39:00

  • Atol
  • Активный участник
  • На форуме с 21 февраля 2006г.
  • Сообщений: 1,365
  • Спасибо: 3

Re: Нужна помощь с AutoLISP

В редакторе Автолиспа есть возможность проставлять метки остановки (наставь до и после функций) и просмотра текущего значения переменных (а то и целых выражений) для контроля и поиска ошибок

#9 Ответ от Aspirine 28 апреля 2008г. 15:08:25

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

rb- это переменная которая должна по идеи соответствовать высоте большого цилиндра.

#10 Ответ от Aspirine 28 апреля 2008г. 15:19:39

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

Увидел… Да, это не внимательность и моя лень, копировал и набивал разное.
Исправил.
Но это не решило проблему…

#11 Ответ от Aspirine 28 апреля 2008г. 16:35:26

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

Разобрался, спасибо. Дело было в неправильно ориентированных переменных.
Но возник ещё вопрос:
Мне нужно в координатах начальной точки тела указать две координаты и одну переменную, котороя может измениться исходя из желанию конеченого пользователя.
Например:

(command "_cylinder" "0,0,S3" rc1 rb1 "")

где rc1,rb1, S3 — переменые. Автокад при загрузке в него говорит что так координаты точек
«0,0,S3» задавать нельзя. Как пуступить в этой ситуации?

#12 Ответ от Александр Ривилис 28 апреля 2008г. 16:49:24

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

Re: Нужна помощь с AutoLISP

(command "_cylinder" (list 0 0 S3) rc1 rb1 "")

#13 Ответ от Aspirine 28 апреля 2008г. 18:18:56

  • Aspirine
  • Восстановленный участник
  • На форуме с 20 марта 2008г.
  • Сообщений: 13
  • Спасибо: 0

Re: Нужна помощь с AutoLISP

помогло, спасибо. А команда List- она создаёт список, да?

#14 Ответ от Александр Ривилис 28 апреля 2008г. 18:41:36

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

Re: Нужна помощь с AutoLISP

> Александр Ривилис
Функция (а не команда) (list …) создает список. Учи мат.часть (т.е. язык программирования AutoLisp/VisualLisp).

Сообщения 14

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

Страницы 1

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

Понравилась статья? Поделить с друзьями:
  • Ошибка не удалось запустить проверочный звук
  • Ошибка неверный домен ключа ucoz
  • Ошибка не удалось запустить компьютер восстановление запуска
  • Ошибка неверный домен ключа recaptcha конфиденциальность условия использования
  • Ошибка не удалось запустить приложение ce 30005 8