Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Active Contributor
morrissette
Posts: 42
Registered: ‎05-17-2006
Message 1 of 12 (1,577 Views)
Accepted Solution

LISP routine no longer working in AutoCAD 2014, not sure why

1577 Views, 11 Replies
09-04-2013 12:39 PM

One of our users has recently upgraded from AutoCAD 2005 to AutoCAD 2014. He has a LISP routine that will no longer work and I'm not sure why. I'm not a LISP expert and would appreciate anyone looking at the small file and seeing if the problem area can be identified.

 

Very much obliged,

Jody in NH

Distinguished Mentor
BlackBox_
Posts: 733
Registered: ‎02-25-2013
Message 2 of 12 (1,570 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-04-2013 12:44 PM in reply to: morrissette
Active Contributor
morrissette
Posts: 42
Registered: ‎05-17-2006
Message 3 of 12 (1,562 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-04-2013 01:02 PM in reply to: BlackBox_

Thank you blackbox, but it doesn't seemed to have helped. I followed the steps suggested in your reply.

Distinguished Mentor
BlackBox_
Posts: 733
Registered: ‎02-25-2013
Message 4 of 12 (1,551 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-04-2013 01:31 PM in reply to: morrissette

No worries; that was only one commonly overlooked place to start, especially when stepping up to 2014 from anything older than 2013 SP1.

 

Does the routine load properly?

 

Is the user able to start the routine, and it errors out?

 

What error message is reported to the command line (if any)?

 

... We'll need more information to know the exact cause.

 

 

 

FWIW - The code you posted could use some localized variables; not sure if that's what's causing the issue, but is typically a no-no (to use all global variables, particularly those with such common symbol naming). I'll see if I cannot offer a quick rewrite later.

 

Cheers



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security

*Expert Elite*
Kent1Cooper
Posts: 5,242
Registered: ‎09-13-2004
Message 5 of 12 (1,549 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-04-2013 01:35 PM in reply to: morrissette

morrissette wrote:

One of our users has recently upgraded from AutoCAD 2005 to AutoCAD 2014. He has a LISP routine that will no longer work ....


I don't have 2014 here, but I can see a couple of possibilities:

 

Might the Leader command no longer be accepted as a sub-command within DIM?  LEADER is a command of its own, though there's been support for it as a sub-command that may now have disappeared.  Might DIM itself no longer be a command in 2014, since all its sub-command possibilities are now top-level commands?

 

Might any of the commands used have been redefined by some vertical/overlay program?  Preceding command names with a period/decimal will force it to use the native non-redefined commands, and while you're at it you may as well do what's done with a lot of code posted here: also precede them with an underscore to make them usable in non-English versions of AutoCAD.

 

Try changing

"LAYER" to "_.LAYER" [all instances]

and

"CIRCLE" to "_.CIRCLE"

and

"TEXT" to "_.TEXT"

and

"DIM" "LEADER" to just "_.LEADER"

and remove the "EXIT" that gets it out of the DIM command.

 

You may also need to look at the answers to prompts in the Leader command -- I expect you might be better off going for "None" annotation, rather than apparently a single-space text string [might it be that that no longer survives as a drawing entity, but disappears and is no longer available as (entlast)?], and somehow referencing the Marker location from the Leader itself.

Kent Cooper
*Expert Elite*
hmsilva
Posts: 2,639
Registered: ‎12-17-2004
Message 6 of 12 (1,547 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-04-2013 01:55 PM in reply to: morrissette

morrissette wrote:

One of our users has recently upgraded from AutoCAD 2005 to AutoCAD 2014. He has a LISP routine that will no longer work and I'm not sure why. I'm not a LISP expert and would appreciate anyone looking at the small file and seeing if the problem area can be identified.

 

Very much obliged,

Jody in NH


Jody,
the code worked correctly in AutoCAD 2005?


Try the attached code, and please let me know if it works correctly.

 

HTH

Henrique

 

Active Contributor
morrissette
Posts: 42
Registered: ‎05-17-2006
Message 7 of 12 (1,504 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-05-2013 06:04 AM in reply to: hmsilva

Thanks very much to all of the responses. Henrique, it worked and a huge thanks to you. Very much obliged.

 

Jody

*Expert Elite*
hmsilva
Posts: 2,639
Registered: ‎12-17-2004
Message 8 of 12 (1,495 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-05-2013 06:12 AM in reply to: morrissette
You're welcome, Jody
Glad I could help

Henrique
Active Contributor
morrissette
Posts: 42
Registered: ‎05-17-2006
Message 9 of 12 (1,494 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-05-2013 06:15 AM in reply to: hmsilva

Henrique, I'm curious and intended to ask you.....are you able to explain to me in simple terms what the difference is and what caused it to bomb out before your fix?

 

Sincerely,

Jody in NH

*Expert Elite*
hmsilva
Posts: 2,639
Registered: ‎12-17-2004
Message 10 of 12 (1,486 Views)

Re: LISP routine no longer working in AutoCAD 2014, not sure why

09-05-2013 06:27 AM in reply to: morrissette

Jody,

 

the change I made at the code is commented...

From the code:

  (command "LAYER" "M" "DIM" "" "DIM" "LEADER" PT1 PT2 "" " " "EXIT")

  ;; added to delete the laste entity, an empty string from the DIM/LEADER command,
  ;; so the code be able to select the last line in the leader...
  (entdel (entlast))


Now the last entity, is the last line drawn from dim/leader command...

 

Henrique

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community