Text Aling Lisp Help

Text Aling Lisp Help

S.T.123
Participant Participant
3,588 Views
19 Replies
Message 1 of 20

Text Aling Lisp Help

S.T.123
Participant
Participant

Hey, 

I've got the attached lisp routine which I normally use to quickly align text to a line within a drawing. 
It's usually works fine with ACAD 2020, no troubles, though lately it has just given out and I am getting an error and I've got no idea why. 

 

The lisp is a beyond my understanding of how it all runs. Is there anyone who could have a quick help and see if they can figure out quickly what's going on?

Error.JPG

 

 

 

0 Likes
Accepted solutions (1)
3,589 Views
19 Replies
Replies (19)
Message 2 of 20

hak_vz
Advisor
Advisor

You can contact  @Lee_Mac  author of this marvelous code at http://www.lee-mac.com/contact.html or through his profile on this site.

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 20

ВeekeeCZ
Consultant
Consultant

Post a sample dwg where the issue occurs.

0 Likes
Message 4 of 20

cadffm
Consultant
Consultant

@S.T.123 

A genius, we don't know who, tried to edit a well working code - but it failed 😉

This Genius also used find&replace in this lisp file: bad idea..

 

My suggestion: Take the original current version 1.4 from lee mac,

and when it works for you.. (feel free also for not) you will find the [Donate] button.

Search for Align Text on www.lee-mac.com

 

-

Also your buggy code works for me for the most of options and setting.

Check out your write-right to

C:\Users\<User>\AppData\Roaming\Autodesk\AutoCAD <20XX>\R<nn>\<lang>\Support\

Check the content of .\LMAC_atc_V1-2.cfg

For example: "mtx"
"Middle-Right"
1.00000000
0.78539816
nil
nil
nil

 

But the best way, take the original in version 1.4

Sebastian

Message 5 of 20

ВeekeeCZ
Consultant
Consultant

Ohh dear, nice catch @cadffm !!!

 

@S.T.123  re-download the original from HERE (it's 1.2 version btw)

 

...and don't use Find-and-Replace to edit the code! See the comparison original vs modified, what damage has been done!

 

Z9E3zK5E_0-1602058279513.png

 

 

If you want to have a different name, define an alias in PGP file.

 

 
0 Likes
Message 6 of 20

cadffm
Consultant
Consultant

Yes, but it isn't the current problem (numberp nil)

 

 

(it's 1.2 version btw)

But the best way, take the original in version 1.4

Yes, I confused it with AlignText, another tool.

Sebastian

0 Likes
Message 7 of 20

S.T.123
Participant
Participant

@ВeekeeCZ @cadffm 

I have re-downloaded the original lisp AlignTextToCurveV1-2.lsp from the site. 


I wasn't aware my version of the lisp had been edited it's just been a lisp someone shared with me and it worked great so I brought it into my regular rotation for CAD commands.  None the less, the newly downloaded original version has NOT ben edited by me at all. I'm still getting the same errors unfortunately 😞

 

Here's a screenshot of the command line process I've gone through from a new drawing in a freshly opened version of ACAD 2020 with the newly downloaded original lisp ;

commandline.JPG

 

I wish I had better understanding of what is going on here but unfortunately my understanding of how the lisp works only extends as far as loading it in then how the command is supposed to work. 

 

0 Likes
Message 8 of 20

S.T.123
Participant
Participant

If someone is kind enough to help me sort it out I'd be glad to hit the donate button @cadffm 

0 Likes
Message 9 of 20

ronjonp
Mentor
Mentor

You need to upload your drawing that the code is breaking on.

0 Likes
Message 10 of 20

S.T.123
Participant
Participant

@ronjonp  It's breaking and doesn't work on all drawings. From more complex drawings with several xrefs, lines bits of text etc. Right through to completely empty drawings that have been opened in a fresh session of ACAD and I've only created a single piece of MTEXT and drawn a poly line to test the lisp. 

0 Likes
Message 11 of 20

ВeekeeCZ
Consultant
Consultant

I never understand why posting a dwg is such an issue. Doing that, with one dummy mtext will cost you no time. But still, you feel the need to argue why YOU think it's useless. YOU, who asked us for help, you with very limited knowledge of coding. You have no idea how often we prove you smart-guys wrong then. You just complicate things.

 

Anyway, you need to locate the line causing the error. Follow steps:

- type VLIDE to the command line to open the Editor

- open Lee's *.lst code there

- from Toolbar Debug / Break On Error, make sure it's ticked.

- Tools / Load Text In Editor

- Window / Activate AutoCAD (leave VLIDE open on background)

- run the routine by typing ATC

- then it should switch to VLIDE

- Debug / Last Break Source, this should highlight the error-causing code.

 

Post the line here, also look into the lower right corner of VLIDE to line number.

Message 12 of 20

cadffm
Consultant
Consultant
Accepted solution

@S.T.123 

 

I don't want to annoy, it's not my problem, but


@cadffm wrote:

Also your buggy code works for me for the most of options and setting.

Check out your write-right to

C:\Users\<User>\AppData\Roaming\Autodesk\AutoCAD <20XX>\R<nn>\<lang>\Support\

Check the content of .\LMAC_atc_V1-2.cfg

For example: "mtx"
"Middle-Right"
1.00000000
0.78539816
nil
nil
nil

 


1. Navigate to this folder

2. Rename both files (LMAC_atc_V1-2.cfg/LMAC_atc_V1-2.dcl => *.cfg.old and *.dl.old and)

    (or move them to another folder as backup)

 

3. Try it again in a new saved DWG with only one Text and one ARC.

    If it fails: Check the folder again, can you see new LMAC_atc_V1-2.cfg/LMAC_atc_V1-2.dcl files?

 

If yes,

Try to follow Z9E3zK5E hint for debugging.

(Which Windows setting about Country/Language?)

 

Sebastian

Message 13 of 20

ВeekeeCZ
Consultant
Consultant

Agree, the most likely is the bad *.cfg file the cause of the issue. 

0 Likes
Message 14 of 20

cadffm
Consultant
Consultant

@S.T.123 wrote:

If someone is kind enough to help me sort it out I'd be glad to hit the donate button @cadffm 


Read & try the suggestion from #12

 

 

Sebastian

0 Likes
Message 15 of 20

S.T.123
Participant
Participant

@cadffm BINGO!!

That works and it's all back the way it should be! Thank you so much!!

 

0 Likes
Message 16 of 20

S.T.123
Participant
Participant

@ВeekeeCZ 

 

My bad mate. I wans't trying to be a "smart guy" just didn't see the value in it as it wasn't a specific drawing problem. 

 

Anyways solved or now. Thanks any way!

0 Likes
Message 17 of 20

cadffm
Consultant
Consultant

Good.

Then share your renamed file for analyses, and to help lee to fix the problem.

Thx

Sebastian

0 Likes
Message 18 of 20

S.T.123
Participant
Participant

@cadffm  So in the end up changing any of the lisp. 


I deleted the LMAC_atc_V1-2.cfg and LMAC_atc_V1-2.dcl from the "C:\Users\<User>\AppData\Roaming\Autodesk\AutoCAD <20XX>\R<nn>\<lang>\Support\ " file path you mentioned in your other post and everything worked fine from that point. Both the orginal lisp and the one I had that has been edited somewhere along the line. 

 

So I spose the errors I was facing lie somewhere in the .cfg and .dcl files I had. 

 

0 Likes
Message 19 of 20

cadffm
Consultant
Consultant

 


@S.T.123 wrote:

I deleted the LMAC_atc_V1-2.cfg and LMAC_atc_V1-2.dcl from the "C:\Users\<User>\AppData\Roaming\Autodesk\AutoCAD <20XX>\R<nn>\<lang>\Support\ " file path you mentioned in your other post

I never mentioned to delete these files!

CADffm wrote:

  1. Rename both files (LMAC_atc_V1-2.cfg/LMAC_atc_V1-2.dcl => *.cfg.old and *.dl.old and) (or move them to another folder as backup)

And why i mentioned this? Because we can check the content(settings) in these files after,

if the problem comes with the settings inside (what ww know now, it was the case).

 


@S.T.123 wrote:

So I spose the errors I was facing lie somewhere in the .cfg and .dcl files I had. 

 


Sure, but know we are not able to check if the "error" source come from the program

or from another issue with the cfg/dcl file.

 

😞  But at least it's working again for you right now.

Sebastian

0 Likes
Message 20 of 20

pcoutu37QSW
Community Visitor
Community Visitor

I am also having this problem and cant find the .cfg as mentioned so I went this route.

Please find attached. Any help is appreciated.

atc.JPGThanks in advance.

@ВeekeeCZ @cadffm 

0 Likes