See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Do you see the Malformed List?

  1. #1
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Do you see the Malformed List?

    Due to an introduced error after several months away from using AutoCAD Mechanical, I now get a malformed list error. Can you find its source?
    My VLIDE skills are very slowly growing...snail-like.

    (This particular acaddoc.lsp file contains an AutoCAD Mechanical-specific code area).

    Thanks!
    Attached Files Attached Files
    Last edited by chillme1; 2021-05-12 at 04:33 PM. Reason: Add attachment

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    How I'd find the error:
    If you put ;| before first line and |; at the end of say line 322 the first 322 lines will be commented out.
    If you still get the error on loading move the |; down and reload till you don't.

  3. #3
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    Hi Tom,
    I like it!

    Thanks!

  4. #4
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    1

    Default Re: Do you see the Malformed List?

    I did a cut and paste into vlide and broke it down into 3 sections to check. None of the sections had an error in them but the overall program has an issue.
    Also, I attached an acaddoc.lsp also. Notice the formatting difference. Sometimes just the way you format makes it easier to find errors.

    Edit: Also... you can use a
    ;;;
    at the beginning of the line to rem out that line. Also shown in my attached lsp.
    Attached Files Attached Files

  5. #5
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    1

    Default Re: Do you see the Malformed List?

    Found it

    Code:
    (if (/= (getvar "ucsicon") 3)
      (progn (setvar "ucsicon" 3)
    	 (princ
    	   "\nSet ucs icon to display at the origin." ; Added on August 22, 2018 - UCS Icon at Origin
    	 )
      )

  6. #6
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    I live for tips. Your time taken and interest are not lost on me!

    - - - Updated - - -

    Quote Originally Posted by madcadder View Post
    I did a cut and paste into vlide and broke it down into 3 sections to check. None of the sections had an error in them but the overall program has an issue.
    Also, I attached an acaddoc.lsp also. Notice the formatting difference. Sometimes just the way you format makes it easier to find errors.

    Edit: Also... you can use a
    ;;;
    at the beginning of the line to rem out that line. Also shown in my attached lsp.
    An (excellent) example like yours is worth a thousand words!

  7. #7
    Member
    Join Date
    2021-04
    Posts
    9
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    I looked into your acaddoc(Error in Code).lsp and found that just one missing ")" can mess it all up.
    Code:
    (if (/= (getvar "ucsicon") 3)
      (progn (setvar "ucsicon" 3)
       (princ
         "\nSet ucs icon to display at the origin." ; Added on August 22, 2018 - UCS Icon at Origin
       )
      )
    );<-- It was missing this ")" right here.
    I found another occurrence of "ucsicon" near the bottom of your acaddoc(Error in Code).lsp.
    Code:
    (if (/= (getvar "ucsicon") 1)
      (progn (setvar "ucsicon" 1) (princ "\nUCSICON On!"))
    )

  8. #8
    I could stop if I wanted to CEHill's Avatar
    Join Date
    2006-05
    Location
    TN
    Posts
    327
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    Quote Originally Posted by Adam Junior View Post
    I looked into your acaddoc(Error in Code).lsp and found that just one missing ")" can mess it all up.
    Code:
    (if (/= (getvar "ucsicon") 3)
      (progn (setvar "ucsicon" 3)
       (princ
         "\nSet ucs icon to display at the origin." ; Added on August 22, 2018 - UCS Icon at Origin
       )
      )
    );<-- It was missing this ")" right here.
    I found another occurrence of "ucsicon" near the bottom of your acaddoc(Error in Code).lsp.
    Code:
    (if (/= (getvar "ucsicon") 1)
      (progn (setvar "ucsicon" 1) (princ "\nUCSICON On!"))
    )
    Hi Adam,
    I appreciate your observations. With the freely-available Crimson Editor, the .LSP settings include parentheses matching. Your results agree with mine. All is well.
    NOTE: Somewhere along the way, the code was involuntarily realigned: A break was introduced after the code "(princ" and the rest was shifted to a new line. I restored it to a single line.

    Thanks!

  9. #9
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    Quote Originally Posted by chillme1 View Post
    I live for tips. Your time taken and interest are not lost on me!

    - - - Updated - - -



    An (excellent) example like yours is worth a thousand words!
    I liked your IF statements for setting variables. Mine is a hammer method, where it does not matter what the current setting is I am changing it to... Even if it doesn't need changing.
    I may have to take some time to polish mine up a bit and remove some of garbage that been sitting in there for years upon years.

  10. #10
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    561
    Login to Give a bone
    0

    Default Re: Do you see the Malformed List?

    For me I would do like this moved the ")"

    (princ "\nSet ucs icon to display at the origin.") ; Added on August 22, 2018 - UCS Icon at Origin

    The remark is possibly being seen as part of the princ string.

Page 1 of 2 12 LastLast

Similar Threads

  1. XREF.LSP Causing malformed error
    By jdcincy in forum AutoLISP
    Replies: 1
    Last Post: 2013-08-27, 07:50 PM
  2. error: malformed string on input
    By Bear31831 in forum AutoCAD General
    Replies: 13
    Last Post: 2013-08-27, 06:50 PM
  3. Replies: 16
    Last Post: 2012-07-16, 07:41 PM
  4. Replies: 16
    Last Post: 2011-03-01, 03:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •