Author Topic: Malformed String??  (Read 2997 times)

0 Members and 1 Guest are viewing this topic.

vinnyg

  • Guest
Malformed String??
« on: January 09, 2007, 05:09:02 PM »
Hi All,

I recently added a few lines of code to a lisp program that was loading and
running just fine. Since I added these lines, I get this error message
"malformed string".  Here is the lines I added. Can anybody find the malformed
string and let me know how to correct it?
Appreciate any help

vinnyg

Code: [Select]
(setq ans50 (getstring "\n Do you want to locate a point for an
 embed at left side of panel near top? <Y or N>: "))
  (if (or (= ans50 "Y") (= ans50 "y"))
(progn
  (prompt "\n 1st point is how far")
  (setq pt1 (getdist "\nBelow top of panel?:"))
  (setq p108 (polar p4 (+(dtr 180) ang) pt1))
  (command "exit" "")
)
 )


(setq ans51 (getstring "\n Do you want to locate a second point for an
 embed at right side of panel near top? <Y or N>: "))
  (if (or (= ans51 "Y") (= ans51 "y"))
(progn
  (prompt "\n 2nd point is how far")
  (setq pt2 (getdist "\nBelow top of panel?:"))
  (setq p109 (polar p3 (-(dtr 0) ang) pt2))
  (command "exit" "")
)
 )


(setq ans52 (getstring "\n Do you want a center line between
 those 2 points <Y or N>: "))
  (if (or (= ans52 "Y") (= ans52 "y"))
(progn
  (setvar "clayer" "1")
  (setvar "cecolor "1")
  (command "line" p108 p109 "")
  (command "exit" "")
)
 )


  (redraw)
  (princ)
) ; end of defun

<edit>  Added code tags   Mav
« Last Edit: January 09, 2007, 05:32:23 PM by Maverick® »

hmspe

  • Bull Frog
  • Posts: 362
Re: Malformed String??
« Reply #1 on: January 09, 2007, 06:28:34 PM »
The obvious issue is:

  (setvar "cecolor "1")

should be

  (setvar "cecolor" "1")
"Science is the belief in the ignorance of experts." - Richard Feynman

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Malformed String??
« Reply #2 on: January 09, 2007, 09:20:21 PM »
vinnyg,

If you open that code in the VLIDE < or any editor with color coding capability > you will/should see immediately where the problem is located.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Malformed String??
« Reply #3 on: January 09, 2007, 09:24:14 PM »
as an aside, do you normaly draw byColor < not ByLayer >
'cause when the routine exits you will be left with all new objects being drawn byColor RED.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8728
  • AKA Daniel
Re: Malformed String??
« Reply #4 on: January 09, 2007, 10:23:37 PM »
Kerry, How did you get the nice little red ellipse?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Malformed String??
« Reply #5 on: January 09, 2007, 10:33:49 PM »
Kerry, How did you get the nice little red ellipse?

Snagit 8.2
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8728
  • AKA Daniel
Re: Malformed String??
« Reply #6 on: January 09, 2007, 10:44:32 PM »
Very cool !
Thank you

vinnyg

  • Guest
Re: Malformed String??
« Reply #7 on: January 10, 2007, 09:01:22 AM »
Kerry & Danielm,

Thanks for your help....thought that maybe it was something as simple
as you pointed out, but just couldn't find it. Where can I get VLIDE or
any editor with color coding capability?

Thanks again

vinnyg

hmspe

  • Bull Frog
  • Posts: 362
Re: Malformed String??
« Reply #8 on: January 10, 2007, 09:43:04 AM »
The editor built-in to Autocad has color coding.  It's under Tools / AutoLISP / Visual LISP Editor

Martin
"Science is the belief in the ignorance of experts." - Richard Feynman

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Malformed String??
« Reply #9 on: January 10, 2007, 02:45:34 PM »
Type VLIDE at the command prompt.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.