CAD/CAM discussion forum > CAD > Lisp loading error in ZWCAD 2017

Lisp loading error in ZWCAD 2017

    
  Subscribe Topic

Rank: 1

flavio8305

Newbie

posts: 6

Registered: 2016-8-3

Message 1 of 12

 Lisp loading error in ZWCAD 2017
30-09-2016 03:09 . am   |   View his/her posts only

I have a lisp routine which runs normally in AutoCAD, CMS Intellicad and ZWCAD Classic, with some modifications for each software.

However, it isn't loading in ZWCAD2017.


I have already tried to make some changes, as changing the variables declaration place, but there is always an error.


Are there any problems with ZWCAD2017 lisp environment?


I'm using VERNUM = "2016.08.26(8293)_x64"

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 325

Registered: 2015-6-9

Message 2 of 12

30-09-2016 02:11 . pm   |   View his/her posts only
Reply 1# flavio8305


Hi, What is the error after loaded the LISP program?
There will be a new update version to be released in the next week, which has fixed some bugs since the version you are using. You can send the error to us for further check firstly.

Rank: 1

flavio8305

Newbie

posts: 6

Registered: 2016-8-3

Message 3 of 12

01-10-2016 01:21 . am   |   View his/her posts only
Hi, Jeffrey.

This is the error when loading the program:

Error: quit / exit abort
happened in: #


If I comment the line where (exit) is called, I get this other error:

Error: expecting then clause - nil
happened in: #

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 325

Registered: 2015-6-9

Message 4 of 12

17-10-2016 10:02 . am   |   View his/her posts only
Reply 3# flavio8305


Have you tried the latest version yet (2016.09.30(10203))? If so, did your problem solved in it?

Rank: 1

flavio8305

Newbie

posts: 6

Registered: 2016-8-3

Message 5 of 12

31-10-2016 09:01 . pm   |   View his/her posts only
Reply 4# withje8478


I have just tried with VERNUM = "2016.09.30(10203)_x64" and the error persists.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 325

Registered: 2015-6-9

Message 6 of 12

29-11-2016 08:55 . pm   |   View his/her posts only
Reply 5# flavio8305


Hi, ZWCAD 2017 has updated to the latest version SP1.2, please download it and give it a try.

Rank: 1

flavio8305

Newbie

posts: 6

Registered: 2016-8-3

Message 7 of 12

08-12-2016 03:43 . am   |   View his/her posts only
Post Last Edit by flavio8305 at 2016-12-8 03:50

using this version:
VERNUM = "2016.11.14(11574)_x64" (read only)
The dialog opens, I can select the files to be modified. It starts to perform the commands, but then it freezes and ZWCad shuts down.

I'll make some tests, trying to find which command is the problem. If I find, I'll tell you.

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 325

Registered: 2015-6-9

Message 8 of 12

08-12-2016 10:00 . am   |   View his/her posts only
Reply 7# flavio8305


Thank you very much.

Rank: 1

flavio8305

Newbie

posts: 6

Registered: 2016-8-3

Message 9 of 12

22-12-2016 09:24 . pm   |   View his/her posts only
Post Last Edit by flavio8305 at 2016-12-22 21:31

I debugged the program and the error is now occuring durinng the execution of my getFormat() function, which tries to discover which format (A0, A1, etc) was used in a drawing (code below - origin of drawing must be 0,0).

It freezes in this command: (setq totLength (round totLength 0.01))

(defun getFormat()

;SELECTING THE BOUNDARY LINES AT (0.0, 0.0) AND GETTING THEIR LENGTHS
(setq lineSet (ssget "_C" '(0.5 0.5) '(-0.5 -0.5)))
(setq totLength 0 count 0)
(repeat (sslength lineSet)
(setq ename (ssname lineSet count))
(setq edata (entget ename))
(setq pt1 (cdr (assoc 10 edata)))
(setq pt2 (cdr (assoc 11 edata)))
(setq length1 (distance pt1 pt2))
(setq totLength (+ totLength length1))
(setq count (+ 1 count))
);end reapeat

;DEFINING THE FORMAT VARIABLE ACCORDING TO DRAWING DIMENSIONS
(setq totLength (round totLength 0.01))
(if (= totLength 221.5)
(progn
(setq format "A0L")
(setq formatX 137.4)
(setq formatY 84.1)
);end progn
(if (= totLength 203.0)
(progn
(setq format "A0")
(setq formatX 118.9)
(setq formatY 84.1)
);end progn
(if (= totLength 162.0)
(progn
(setq format "A1L")
(setq formatX 102.6)
(setq formatY 59.4)
);end progn
(if (= totLength 143.5)
(progn
(setq format "A1")
(setq formatX 84.1)
(setq formatY 59.4)
);end progn
(if (= totLength 101.4)
(progn
(setq format "A2")
(setq formatX 59.4)
(setq formatY 42.0)
);end progn
(if (= totLength 71.7)
(progn
(setq format "A3")
(setq formatX 42.0)
(setq formatY 29.7)
);end progn
(progn
(setq format "OUTRO")
(setq formatX 0.0)
(setq formatY 0.0)
);end progn
);endif
);endif
);endif
);endif
);endif
);endif

);end defun

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 325

Registered: 2015-6-9

Message 10 of 12

06-01-2017 03:06 . pm   |   View his/her posts only
Reply 9# flavio8305


Hi, I tried to run this code in ZWCAD/ACAD, it run to (setq ename (ssname lineSet count)), and then there is an error "; error: bad argument type: lselsetp nil". Could this lisp program work in any CAD software?

Rank: 1

flavio8305

Newbie

posts: 6

Registered: 2016-8-3

Message 11 of 12

17-01-2017 03:47 . am   |   View his/her posts only
Yes, it does work in ZWCAD Classic, AutoCad, CMS Intellicad...

It's a part of a much bigger program, which you can download here to give a try:
https://1drv.ms/u/s!AlBzxD0Rw3skp3sTaIwr26UCrR0k

Rank: 5Rank: 5

Jeffrey_ZWCAD

posts: 325

Registered: 2015-6-9

Message 12 of 12

17-01-2017 11:47 . am   |   View his/her posts only
Reply 11# flavio8305


Hi, I checked the tese function, and found that there is a bug in function REM currently in ZWCAD 2017 (bug ID T12836). We will fix it ASAP. There is a workaround to solve this, as the following picture shown.
2017-01-17_11-43-22.png
7 DayBefore 11:45





Thanks.
See also
X