| Правила | Регистрация | Пользователи | Поиск | Сообщения за день | Все разделы прочитаны |  Справка по форуму | Файлообменник |

Вернуться   Форум DWG.RU > Программное обеспечение > Программирование > повторное выполнение операции с ощибкой

повторное выполнение операции с ощибкой

Ответ
Поиск в этой теме
Непрочитано 14.03.2009, 21:09 #1
повторное выполнение операции с ощибкой
msblast
 
Регистрация: 14.03.2009
Сообщений: 12

повторное выполнение операции с ощибкой:

(command "_LINE" "0.003,0.64088" "0.003,0.64295" "")
(command "_LINE" "0.006,0.64240" "0.006,0.64478" "")
....
....
(command "_LINE" "0.006,0.64240" "0.006,0.64478" "")

после 40 таких операций начинают сыпаться оошибки:

Следующая точка или [Отменить]: 0.342,0.65753 В точке (0.3390, 0.6578, 0.0000)
создана линия нулевой длины

если заливать небольшими .lsp порциям поочередно операции, то все они успешно выполняются.. а вот разом неполучается, почему?
конечно стабильность языка поражает.... сел, 5 минут попрограммировал и нате...

Последний раз редактировалось msblast, 14.03.2009 в 21:36.
Просмотров: 1856
 
Непрочитано 14.03.2009, 21:40
#2
Кулик Алексей aka kpblc
Moderator

LISP, C# (ACAD 200[9,12,13,14])
 
Регистрация: 25.08.2003
С.-Петербург
Сообщений: 36,749


А какой смысл делать 40 отрезков один над другим?
P.S. Только что прогнал код
Код:
[Выделить все]
(defun test()
(command "_.line" "0.003,0.64088" "0.003,0.64295" "")
(repeat 50
(command "_.line" "0.006,0.64240" "0.006,0.64478" ""))
(princ))
AutoCAD 2008 Eng + SP1, AutoCAD 2009. Ошибок не обнаружено.
__________________

---
Обращение ко мне - на "ты".
Все, что сказано - личное мнение.
Кулик Алексей aka kpblc вне форума  
 
Автор темы   Непрочитано 14.03.2009, 21:45
#3
msblast


 
Регистрация: 14.03.2009
Сообщений: 12


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


Код:
[Выделить все]
(command "_LINE" "0.003,0.64088" "0.003,0.64295" "")
(command "_LINE" "0.006,0.64240" "0.006,0.64478" "")
(command "_LINE" "0.009,0.64208" "0.009,0.64410" "")
(command "_LINE" "0.012,0.64220" "0.012,0.64340" "")
(command "_LINE" "0.015,0.63922" "0.015,0.64225" "")
(command "_LINE" "0.018,0.63863" "0.018,0.64115" "")
(command "_LINE" "0.021,0.63930" "0.021,0.64183" "")
(command "_LINE" "0.024,0.63848" "0.024,0.64017" "")
(command "_LINE" "0.027,0.63817" "0.027,0.64176" "")
(command "_LINE" "0.030,0.63727" "0.030,0.64105" "")
(command "_LINE" "0.033,0.63540" "0.033,0.63830" "")
(command "_LINE" "0.036,0.63444" "0.036,0.63725" "")
(command "_LINE" "0.039,0.63399" "0.039,0.63630" "")
(command "_LINE" "0.042,0.63142" "0.042,0.63620" "")
(command "_LINE" "0.045,0.63150" "0.045,0.63580" "")
(command "_LINE" "0.048,0.63337" "0.048,0.63697" "")
(command "_LINE" "0.051,0.63090" "0.051,0.63508" "")
(command "_LINE" "0.054,0.63093" "0.054,0.63455" "")
(command "_LINE" "0.057,0.63090" "0.057,0.63265" "")
(command "_LINE" "0.060,0.63190" "0.060,0.63370" "")
(command "_LINE" "0.063,0.63099" "0.063,0.63367" "")
(command "_LINE" "0.066,0.63042" "0.066,0.63200" "")
(command "_LINE" "0.069,0.63054" "0.069,0.63240" "")
(command "_LINE" "0.072,0.63083" "0.072,0.63322" "")
(command "_LINE" "0.075,0.63226" "0.075,0.63433" "")
(command "_LINE" "0.078,0.63397" "0.078,0.63645" "")
(command "_LINE" "0.081,0.63520" "0.081,0.63765" "")
(command "_LINE" "0.084,0.63630" "0.084,0.63765" "")
(command "_LINE" "0.087,0.63674" "0.087,0.63861" "")
(command "_LINE" "0.090,0.63746" "0.090,0.63866" "")
(command "_LINE" "0.093,0.63779" "0.093,0.63996" "")
(command "_LINE" "0.096,0.63698" "0.096,0.63979" "")
(command "_LINE" "0.099,0.63805" "0.099,0.64068" "")
(command "_LINE" "0.102,0.63890" "0.102,0.64151" "")
(command "_LINE" "0.105,0.63918" "0.105,0.64090" "")
(command "_LINE" "0.108,0.63928" "0.108,0.64130" "")
(command "_LINE" "0.111,0.63942" "0.111,0.64218" "")
(command "_LINE" "0.114,0.64179" "0.114,0.64560" "")
(command "_LINE" "0.117,0.64364" "0.117,0.64710" "")
(command "_LINE" "0.120,0.64565" "0.120,0.64875" "")
(command "_LINE" "0.123,0.64578" "0.123,0.64813" "")
(command "_LINE" "0.126,0.64613" "0.126,0.64874" "")
(command "_LINE" "0.129,0.64385" "0.129,0.64738" "")
(command "_LINE" "0.132,0.64090" "0.132,0.64438" "")
(command "_LINE" "0.135,0.64018" "0.135,0.64440" "")
(command "_LINE" "0.138,0.64343" "0.138,0.64612" "")
(command "_LINE" "0.141,0.64490" "0.141,0.64670" "")
(command "_LINE" "0.144,0.64545" "0.144,0.64788" "")
(command "_LINE" "0.147,0.64545" "0.147,0.64792" "")
(command "_LINE" "0.150,0.64733" "0.150,0.64903" "")
(command "_LINE" "0.153,0.64600" "0.153,0.64800" "")
(command "_LINE" "0.156,0.64595" "0.156,0.64705" "")
(command "_LINE" "0.159,0.64182" "0.159,0.64752" "")
(command "_LINE" "0.162,0.63973" "0.162,0.64287" "")
(command "_LINE" "0.165,0.64125" "0.165,0.64418" "")
(command "_LINE" "0.168,0.64070" "0.168,0.64360" "")
(command "_LINE" "0.171,0.64052" "0.171,0.64292" "")
(command "_LINE" "0.174,0.64122" "0.174,0.64310" "")
(command "_LINE" "0.177,0.64256" "0.177,0.64480" "")
(command "_LINE" "0.180,0.64478" "0.180,0.64780" "")
(command "_LINE" "0.183,0.64657" "0.183,0.64968" "")
(command "_LINE" "0.186,0.64898" "0.186,0.65180" "")
(command "_LINE" "0.189,0.64838" "0.189,0.65165" "")
(command "_LINE" "0.192,0.64815" "0.192,0.65146" "")
(command "_LINE" "0.195,0.64864" "0.195,0.65056" "")
(command "_LINE" "0.198,0.64684" "0.198,0.65090" "")
(command "_LINE" "0.201,0.64658" "0.201,0.64953" "")
(command "_LINE" "0.204,0.64620" "0.204,0.64935" "")
(command "_LINE" "0.207,0.64821" "0.207,0.65120" "")
(command "_LINE" "0.210,0.65005" "0.210,0.65229" "")
(command "_LINE" "0.213,0.64923" "0.213,0.65202" "")
(command "_LINE" "0.216,0.64945" "0.216,0.65183" "")
(command "_LINE" "0.219,0.64677" "0.219,0.65040" "")
(command "_LINE" "0.222,0.64653" "0.222,0.65209" "")
(command "_LINE" "0.225,0.64847" "0.225,0.65115" "")
(command "_LINE" "0.228,0.64760" "0.228,0.65005" "")
(command "_LINE" "0.231,0.64770" "0.231,0.65025" "")
(command "_LINE" "0.234,0.64708" "0.234,0.64847" "")
(command "_LINE" "0.237,0.64653" "0.237,0.64915" "")
(command "_LINE" "0.240,0.64375" "0.240,0.64723" "")
(command "_LINE" "0.243,0.64324" "0.243,0.64575" "")
(command "_LINE" "0.246,0.64101" "0.246,0.64348" "")
(command "_LINE" "0.249,0.64275" "0.249,0.64666" "")
(command "_LINE" "0.252,0.64398" "0.252,0.64600" "")
(command "_LINE" "0.255,0.64351" "0.255,0.64675" "")
(command "_LINE" "0.258,0.64630" "0.258,0.64923" "")
(command "_LINE" "0.261,0.64473" "0.261,0.64888" "")
(command "_LINE" "0.264,0.64203" "0.264,0.64615" "")
(command "_LINE" "0.267,0.64418" "0.267,0.64728" "")
(command "_LINE" "0.270,0.64560" "0.270,0.64788" "")
(command "_LINE" "0.273,0.64662" "0.273,0.65030" "")
(command "_LINE" "0.276,0.64918" "0.276,0.65254" "")
(command "_LINE" "0.279,0.65115" "0.279,0.65452" "")
(command "_LINE" "0.282,0.65330" "0.282,0.65753" "")
(command "_LINE" "0.285,0.65448" "0.285,0.65671" "")
(command "_LINE" "0.288,0.65100" "0.288,0.65560" "")
(command "_LINE" "0.291,0.65150" "0.291,0.65462" "")
(command "_LINE" "0.294,0.65359" "0.294,0.65604" "")
(command "_LINE" "0.297,0.65394" "0.297,0.65613" "")
(command "_LINE" "0.300,0.65336" "0.300,0.65500" "")
(command "_LINE" "0.303,0.65303" "0.303,0.65478" "")
(command "_LINE" "0.306,0.65184" "0.306,0.65425" "")
(command "_LINE" "0.309,0.65175" "0.309,0.65335" "")
(command "_LINE" "0.312,0.65208" "0.312,0.65469" "")
(command "_LINE" "0.315,0.65216" "0.315,0.65515" "")
(command "_LINE" "0.318,0.65445" "0.318,0.65910" "")
(command "_LINE" "0.321,0.65656" "0.321,0.65930" "")
(command "_LINE" "0.324,0.65553" "0.324,0.65910" "")
(command "_LINE" "0.327,0.65715" "0.327,0.65920" "")
(command "_LINE" "0.330,0.65708" "0.330,0.65936" "")
(command "_LINE" "0.333,0.65700" "0.333,0.65930" "")
(command "_LINE" "0.336,0.65623" "0.336,0.66034" "")
(command "_LINE" "0.339,0.65407" "0.339,0.65778" "")
(command "_LINE" "0.342,0.65632" "0.342,0.65753" "")
(command "_LINE" "0.345,0.65667" "0.345,0.65750" "")
(command "_LINE" "0.348,0.65673" "0.348,0.65743" "")
(command "_LINE" "0.351,0.65640" "0.351,0.65740" "")
(command "_LINE" "0.354,0.65690" "0.354,0.65795" "")
выполняя, получаю построение не со всеми линиями (должно быть ~120, получаю ~40 в автокаде, остальные идут с ошибкой: Команда: _LINE Первая точка: 0.354,0.65690 "Для пересечения выбрано избыточное число объектов", или "создана нулевая линия"

И как должна выглядеть правильно написанная .lsp, чтобы автокад корректно воспринимал такой объем данных (скажем в 10 раз больший)?

Последний раз редактировалось Солидворкер, 14.03.2009 в 22:05.
msblast вне форума  
 
Непрочитано 14.03.2009, 22:05
#4
Солидворкер
Moderator

Конструктор (машиностроение)
 
Регистрация: 23.10.2006
Россия
Сообщений: 20,911
<phrase 1=


msblast, есть тег code
И исправь ошибку в названии
Солидворкер вне форума  
 
Автор темы   Непрочитано 14.03.2009, 22:12
#5
msblast


 
Регистрация: 14.03.2009
Сообщений: 12


в названии не могу исправить, а с тегом - будем знать
msblast вне форума  
 
Непрочитано 14.03.2009, 22:18
#6
Кулик Алексей aka kpblc
Moderator

LISP, C# (ACAD 200[9,12,13,14])
 
Регистрация: 25.08.2003
С.-Петербург
Сообщений: 36,749


msblast, попробуй osmode перед построением выставить в 0. А откуда точки получаешь, если не секрет? Потому что есть более простой вариант (с точки зрения написания кода, но не понимания )
P.S. Название ты исправить можешь - см. справку по форуму.
__________________

---
Обращение ко мне - на "ты".
Все, что сказано - личное мнение.
Кулик Алексей aka kpblc вне форума  
 
Автор темы   Непрочитано 14.03.2009, 22:30
#7
msblast


 
Регистрация: 14.03.2009
Сообщений: 12


(command "ocmode" "0") - помогло! респект! тему можно под снос
а пока я ищу как заголовки менять
точки получаю из .csv файла сохраненного как текстовый файл с разделителем "пробел"

Последний раз редактировалось msblast, 14.03.2009 в 22:36.
msblast вне форума  
 
Непрочитано 14.03.2009, 23:04
#8
Кулик Алексей aka kpblc
Moderator

LISP, C# (ACAD 200[9,12,13,14])
 
Регистрация: 25.08.2003
С.-Петербург
Сообщений: 36,749


только не ocmode, a osmode. Вариант без изменения системных переменных:
Код:
[Выделить все]
(defun test (/ file handle str lst)
  (if (and (setq file (getfiled "csv-file" "" "csv" 2))
           (/= file "")
           ) ;_ end of and
    (progn
      (setq handle (open file "r"))
      (while (setq str (read-line handle))
        (setq lst (cons str lst))
        ) ;_ end of while
      (close handle)
      (setq lst (mapcar (function (lambda (x) (read (strcat "(" x ")")))) (reverse lst)))
      (entmakex (append (list '(0 . "LWPOLYLINE")
                              '(100 . "AcDbEntity")
                              '(100 . "AcDbPolyline")
                              (cons 90 (length lst))
                              '(70 . 0)
                              '(43 . 0.)
                              '(38 . 0.)
                              '(39 . 0.)
                              ) ;_ end of list
                        (mapcar (function (lambda (x)
                                            (cons 10 x)
                                            ) ;_ end of lambda
                                          ) ;_ end of function
                                lst
                                ) ;_ end of mapcar
                        ) ;_ end of append
                ) ;_ end of entmakex

      ) ;_ end of progn
    ) ;_ end of if
  (princ)
  ) ;_ end of defun

;;
(princ "\nType (test) to call function")
Проверял на файле, который во вложении.
Вложения
Тип файла: rar test.rar (2.3 Кб, 58 просмотров)
__________________

---
Обращение ко мне - на "ты".
Все, что сказано - личное мнение.
Кулик Алексей aka kpblc вне форума  
Ответ
Вернуться   Форум DWG.RU > Программное обеспечение > Программирование > повторное выполнение операции с ощибкой

Размещение рекламы
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск