Exception in AutoCAD AutoLISP script on dim command that works ok on old Autocad upto 2010.

Exception in AutoCAD AutoLISP script on dim command that works ok on old Autocad upto 2010.

bugmenot
Explorer Explorer
310 Views
2 Replies
Message 1 of 3

Exception in AutoCAD AutoLISP script on dim command that works ok on old Autocad upto 2010.

bugmenot
Explorer
Explorer

Hello, trying to fix an old AutoLISP script that works up to AutoCAD 2010. On newer AutoCAD versions tried to debug it with Visual Studio Code v1.97 and stops with exception on this line:

(command "layer" "s" "DIM" "" "dim" "hor" p2 p3 y1_dim strem "dim" 
                       "hor" p9 p10 y2_dim "" "cont" p11 "" "exit"
 )

The problem is that Visual Studio Code writes that there is an exception on this line without anymore explanation why there is an exception. Do you have an idea why this exception may happen?

0 Likes
Accepted solutions (1)
311 Views
2 Replies
Replies (2)
Message 2 of 3

rgrainer
Collaborator
Collaborator

try   "-layer" (no quotes) instead.
you may not need the "exit".

0 Likes
Message 3 of 3

bugmenot
Explorer
Explorer
Accepted solution

Found solution thanks to other topic in this forum.

 

(command "layer" "s" "DIM" "" 
"_.Dimhorizontal" p2 p3 y1_dim strem
"_.Dimhorizontal" p9 p10 y2_dim ""
"cont" p11 ""
"exit" )
0 Likes