Author Topic: issues with x,y extraction and alteration coding, please help.  (Read 4706 times)

0 Members and 1 Guest are viewing this topic.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Code: [Select]
(setq base_point (getpoint "\nSpecify base point: "))
(setq ptascii_x (car base_point))
(setq ptascii_x (rtos ptascii_x 2 2))
(setq ptascii_y (cadr base_point))
(setq ptascii_y (rtos ptascii_y 2 2))
(setq point_calc (rtos (- ptascii_y 4.5)))

Quote
Specify base point: *Cancel*
bad argument type: numberp: "531632.7"
« Last Edit: April 11, 2008, 01:42:17 PM by alanjt »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

ronjonp

  • Needs a day job
  • Posts: 7529
Re: what's wrong with this code?
« Reply #1 on: April 11, 2008, 01:30:01 PM »
Your trying to subtract from a number that you already converted to a string:

(setq base_point (getpoint "\nSpecify base point: "))
(setq ptascii_x (car base_point))
(setq ptascii_x (rtos ptascii_x 2 2))
(setq ptascii_y (cadr base_point))
(setq point_calc (rtos (- ptascii_y 4.5)))


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

JohnK

  • Administrator
  • Seagull
  • Posts: 10641
Re: what's wrong with this code?
« Reply #2 on: April 11, 2008, 01:32:33 PM »
Whats wrong with the subject line of your post?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: issues with x,y extraction and alteration coding, please help.
« Reply #3 on: April 11, 2008, 01:43:34 PM »
thanks ronjonp i knew it was something silly. Se7en, is that a better subject line, sorry about being ambiguous?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

daron

  • Guest
Re: issues with x,y extraction and alteration coding, please help.
« Reply #4 on: April 11, 2008, 01:57:55 PM »
Would "why can't I subtract a real from a string" be a better subject line, 7? :-D

JohnK

  • Administrator
  • Seagull
  • Posts: 10641
Re: issues with x,y extraction and alteration coding, please help.
« Reply #5 on: April 11, 2008, 02:04:09 PM »
I dunno...To be honest, I never read the post (Nothing personal, I saw a response and assumed it was taken care of).

A good subject line is for your benefit not mine (well it is in a obscure way.). You get better help if people know what the question is before they read the actual question.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: what's wrong with this code?
« Reply #6 on: April 11, 2008, 02:10:10 PM »
Whats wrong with the subject line of your post?
A: Se7en cannot understand it as it relates to the subject matter presented by the question.

Q: Do I win the prize?
Q: Is there a prize?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

JohnK

  • Administrator
  • Seagull
  • Posts: 10641
Re: issues with x,y extraction and alteration coding, please help.
« Reply #7 on: April 11, 2008, 02:13:09 PM »
How should i know?! Did you answer correctly?
I didn't know there was a contest.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

daron

  • Guest
Re: issues with x,y extraction and alteration coding, please help.
« Reply #8 on: April 11, 2008, 02:40:54 PM »
What was the original name?

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: issues with x,y extraction and alteration coding, please help.
« Reply #9 on: April 11, 2008, 02:55:56 PM »
Quote
what's wrong with this code?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: issues with x,y extraction and alteration coding, please help.
« Reply #10 on: April 11, 2008, 03:22:05 PM »
How should i know?! Did you answer correctly?
I didn't know there was a contest.
I'll take that as a resounding NO on both accounts
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

daron

  • Guest
Re: issues with x,y extraction and alteration coding, please help.
« Reply #11 on: April 11, 2008, 03:57:02 PM »
Quote
what's wrong with this code?
:-o Hmm. I see nothing wrong with that title. I've seen worse. At least that let's us know that you have tried something and it's not quite working.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: issues with x,y extraction and alteration coding, please help.
« Reply #12 on: April 11, 2008, 04:08:29 PM »
Quote
what's wrong with this code?
:-o Hmm. I see nothing wrong with that title. I've seen worse. At least that let's us know that you have tried something and it's not quite working.

i'm not trying to make an enemy here, but seriously Se7en?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

JohnK

  • Administrator
  • Seagull
  • Posts: 10641
Re: issues with x,y extraction and alteration coding, please help.
« Reply #13 on: April 11, 2008, 05:28:14 PM »
Not `trying'? Your not `trying' by posting a private message in a public forum?

But to answer your question; whats wrong with me trying to explain where im coming from so you dont take what i say the wrong way (get angry)?

What you just did (post a PM in public) is NOT cool, not cool by any means. If you had a problem with what i PM'ed you, you should have either reported me to a moderator or just wrote me back saying that you didnt not want to speak with me.

Am i angry? Yeah kinda.
*Was* i angry? Not at all.
Was i trying to make you angry? Never!
Did you make an enemy? Not with me.
(but we will see how other people react to you posting PMs.)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: issues with x,y extraction and alteration coding, please help.
« Reply #14 on: April 11, 2008, 05:36:32 PM »

John, since you chastised Alan publically perhaps your link and reasoning may have been better posted as well .. takes the same energy and everyone benefits.
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.