Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Member
tjm024000
Posts: 4
Registered: ‎03-30-2012
Message 1 of 10 (707 Views)
Accepted Solution

Help with LISP routine

707 Views, 9 Replies
03-30-2012 12:48 PM

I just switched to AutoCAD 2012. The attached LISP routine worked in 2008, but doesn't work in 2012. Can someone help me out?

Valued Mentor
gjrcmb
Posts: 322
Registered: ‎06-21-2011
Message 2 of 10 (678 Views)

Re: Help with LISP routine

03-30-2012 05:42 PM in reply to: tjm024000

After looking at the files I can tell you that the lsp file is missing some code and has some syntax errors, and will not operate with any version of AutoCAD as is.  The dcl file also has some syntax errors that prevent it from operating properly.  I did not fully analyze the programs and there may be other problems.  Additionally the dcl file must reside in a folder that is listed in the AutoCAD search path for it to be found by the lsp program, but that is incidental to the other problems.

I question whether some one messed with the files or just flat out didn't know what they were doing when trying to modify them.  I do not want to modify the files for you as they appear to be proprietary.  Maybe it's time to pick up an Autolisp book.

If you company backups these files, I suggest that you recall the last time the programs where working and go back to the previous backup and restore the files.

*Expert Elite*
pbejse
Posts: 2,460
Registered: ‎11-24-2009
Message 3 of 10 (655 Views)

Re: Help with LISP routine

03-30-2012 11:40 PM in reply to: tjm024000

tjm024000 wrote:

I just switched to AutoCAD 2012. The attached LISP routine worked in 2008, but doesn't work in 2012. Can someone help me out?



Missing "" (quoation) marks on DCL[file Modified]

Missplaced parenthesis on LSP file [Modified]

 

Try it now

 

See atached files

Mentor
diagodose2009
Posts: 259
Registered: ‎12-04-2009
Message 4 of 10 (653 Views)

Re: Help with LISP routine

03-30-2012 11:50 PM in reply to: tjm024000

I fix so many errors in your program..

a)I conmvert DCL to LISP with embedding DCL in LISP program

b)I search errors

c)I rename your program LISP to a new name "pp_asdk_tjm024000.lsp"

d)I convert your LISP to C+ADS

I work for your program source (8hours):smileysurprised:

Your program still have errors

You load the the programe "pp_asdk_tjm024000.lsp" and you enter the command Q2  [enter] or (Defun C: Q2 (/ )

If you need fix errors in the "pp_asdk_tjm024000.lsp", please send to me the private message..

 

Member
tjm024000
Posts: 4
Registered: ‎03-30-2012
Message 5 of 10 (576 Views)

Re: Help with LISP routine

04-02-2012 12:39 PM in reply to: tjm024000

grjcmb: It may be ugly, I can assure you that the routine works in AutoCAD 2008, I just double-checked with the guy who sits next to me and still has 2008.

 

pbejse: I didn't get your LISP to run, but...

 

diagodose2009: Your version worked! I'm sorry it took 8 hours of your time.

 

Thank you all for your help.  Everyone here at the office will appreciate it!

 

Tim Minich

*Expert Elite*
pbejse
Posts: 2,460
Registered: ‎11-24-2009
Message 6 of 10 (546 Views)

Re: Help with LISP routine

04-02-2012 08:49 PM in reply to: tjm024000

tjm024000 wrote:

pbejse: I didn't get your LISP to run, but...

 

 Tim Minich


First of all, its not my lisp code, I would have written it entirely different from what it is now.

 

It works fine when i tested it, (perhaps not thoroughlly  :smileyvery-happy:), otherwise i wouldnt have posted the modified code. (kept it really short and simple)

 

Anyhoo. What is the error you're getting when you run the lisp code?

 

Member
tjm024000
Posts: 4
Registered: ‎03-30-2012
Message 7 of 10 (522 Views)

Re: Help with LISP routine

04-03-2012 06:07 AM in reply to: pbejse

Update on LISP Routine:

 

The updated version by diagdose2009 succesfully opens the dialog box, but otherwise fails to work.

 

pbejse: I just double checked your edit of the program. I made sure that I only have your version loaded. I get the following error messages:

 

"Error in dialog file: (reference location of LISP Routine), line 12: missing semicolon."

 

"Error in dialog file: (reference location of LISP Routine), line 12: invalid attribute, Symbol: "Prefix"

 

"Error in dialog file: (reference location of LISP Routine), line 12: syntax error, Symbol: "Prefix"

 

Are you running AutoCAD 2012? The original routine worked in 2008, but doesn't work in 2012.

 

In case it's not clear to anyone what's supposed to happen (I don't program at all, so I'm not sure how obvious it is), the routine pulls up a dialog box that has a starting number, a prefix, suffix, and number to increase by. After you enter the information & press OK, you can then select text items and it will change the text accordingly. For example, if you have 5 single line text objects, and you set your prefix to F, your starting number at 1, and your increase number to 1, you should be able to click on the first text to change it to F1, then the second to F2, etc. I'm not sure if that helps you guys or not, but that's the goal.

 

Thank you all again for your help.  If you can get this working I'll be forever grateful.

 

TIm Minich

*Expert Elite*
pbejse
Posts: 2,460
Registered: ‎11-24-2009
Message 8 of 10 (512 Views)

Re: Help with LISP routine

04-03-2012 06:43 AM in reply to: tjm024000

tjm024000 wrote:

 

pbejse: I just double checked your edit of the program. I made sure that I only have your version loaded. I get the following error messages:

....

 

Thank you all again for your help.  If you can get this working I'll be forever grateful.

 

TIm Minich


No worries TIm it didnt take me that much time to modify the code. really. 10 minutes to identify the problem and another 5 minutes to modify it.

 

Before the mod, it gives me that error you posted . Just make sure you download the files i posted

 

You can easily recognize the modified file.

on the lsp file

(setq Suffix (get_tile "enteredSuffix"));<-----

on the DCL

label = "Enter a Prefix if desired, ELSE leave blank:"; // <--- labels in quotes ""

 

I editied the file so little  that you wont even recognize the difference.

Anyhooo.. dont worry about it

 

Cheers

Member
tjm024000
Posts: 4
Registered: ‎03-30-2012
Message 9 of 10 (501 Views)

Re: Help with LISP routine

04-03-2012 08:05 AM in reply to: tjm024000

We have an in-house solution! If you're interested, it's attached.

 

 

*Expert Elite*
pbejse
Posts: 2,460
Registered: ‎11-24-2009
Message 10 of 10 (495 Views)

Re: Help with LISP routine

04-03-2012 08:51 AM in reply to: tjm024000

tjm024000 wrote:

We have an in-house solution! If you're interested, it's attached.

 

 


 You have got to be kidding me tjm024000 :smileylol:

 

 Did you even looked at the attached code I posted and my previous reply?

 

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 or visit the Installation and Licensing Forum to get help installing your software.