Author Topic: Copy Last object to list of coordinates in CSV file  (Read 10043 times)

0 Members and 1 Guest are viewing this topic.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy Last object to list of coordinates in CSV file
« Reply #15 on: July 15, 2011, 04:04:54 PM »
Lee, the user reports the following:


** Error: no function definition: VLAX-GET-ACAD-OBJECT **


I am not sure if the error is in the code, or that they did not select the file with the coordinate pairs in it; or both.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Copy Last object to list of coordinates in CSV file
« Reply #16 on: July 15, 2011, 04:05:56 PM »
Add:

Code: [Select]
(vl-load-com)

Edit: FWIW - Most users add this to acaddoc.lsp, so it is not needed for each routine which uses Visual LISP (ActiveX).
"How we think determines what we do, and what we do determines what we get."

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Copy Last object to list of coordinates in CSV file
« Reply #17 on: July 15, 2011, 04:20:54 PM »
Quote
See, and I'm trying to decide between a Vodka Tonic, or a dram of Glenlivet (18yr)... decisions, decisions.

Well I'm in Florida and it's HOT, so Margaritas are the obvious choice. 

Oh wait, I could muddle some fresh mint and make Mojitos next!  Course after that I probably should post anymore.

 :wink:
James Buzbee
Windows 8

BlackBox

  • King Gator
  • Posts: 3770
Re: Copy Last object to list of coordinates in CSV file
« Reply #18 on: July 15, 2011, 04:24:46 PM »
Quote
See, and I'm trying to decide between a Vodka Tonic, or a dram of Glenlivet (18yr)... decisions, decisions.

Well I'm in Florida and it's HOT, so Margaritas are the obvious choice. 

Oh wait, I could muddle some fresh mint and make Mojitos next!  Course after that I probably should post anymore.

 :wink:

Tell me about it!

Not sure where you are, but here in SW Florida it's been 90+ since about 10:00 AM... I just keep my AC at 72 and below LoL  ;-)

I also enjoy margaritas, and mojitos alike... especially when we hang out by the pool all day (weekends).
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy Last object to list of coordinates in CSV file
« Reply #19 on: July 15, 2011, 05:07:21 PM »
mmmmmmmmmm mo mo mo Mojito pro favor!

although it's so hot in AZ one dare not drink until well after the sun goes down.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Copy Last object to list of coordinates in CSV file
« Reply #20 on: July 15, 2011, 05:31:42 PM »
Did your victim user ever get back to you after the (vl-load-com) business, or is it looking more like Monday to find out?
"How we think determines what we do, and what we do determines what we get."

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy Last object to list of coordinates in CSV file
« Reply #21 on: July 15, 2011, 06:28:17 PM »
my guess is after he got loaded it all went to plan
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Copy Last object to list of coordinates in CSV file
« Reply #22 on: July 16, 2011, 07:45:17 AM »
Lee, the user reports the following:

** Error: no function definition: VLAX-GET-ACAD-OBJECT **

I am not sure if the error is in the code, or that they did not select the file with the coordinate pairs in it; or both.

I sometimes forget the (vl-load-com) because I too include it in my ACADDOC.lsp, so sometimes don't notice when its missing...I shall update the earlier code to save anyone else the confusion.

Edit: FWIW - Most users add this to acaddoc.lsp, so it is not needed for each routine which uses Visual LISP (ActiveX).

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy Last object to list of coordinates in CSV file
« Reply #23 on: July 16, 2011, 10:22:59 AM »

I sometimes forget the (vl-load-com) because I too include it in my ACADDOC.lsp, so sometimes don't notice when its missing...I shall update the earlier code to save anyone else the confusion.

Edit: FWIW - Most users add this to acaddoc.lsp, so it is not needed for each routine which uses Visual LISP (ActiveX).
would this 'error' not be similar in nature to the 'nils' error I was puzzling over?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Copy Last object to list of coordinates in CSV file
« Reply #24 on: July 16, 2011, 10:46:08 AM »
would this 'error' not be similar in nature to the 'nils' error I was puzzling over?

nils error? Are you referring to the Lynn Allen thread?

If so, then no.
Since (vl-load-com) only needs to be called once per drawing session to load the Visual LISP extensions, it makes sense to include it in the ACADDOC.lsp and not in every program (in which every subsequent call to the function is redundant). However, this more efficient approach may confuse beginners who don't include it in the ACADDOC.lsp or have not experienced errors similar to that described above.

The 'nils' returned by a program is not an error, but merely bad practice when writing a program called from the command line. Note that some functions may intentionally return nil to serve a particular purpose.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Copy Last object to list of coordinates in CSV file
« Reply #25 on: July 16, 2011, 11:51:12 AM »
Since (vl-load-com) only needs to be called once per drawing session to load the Visual LISP extensions, it makes sense to include it in the ACADDOC.lsp and not in every program (in which every subsequent call to the function is redundant).
This is not quite correct, Lee. (vl-load-com) need be called only once per Autocad session, so it really only needs to be placed in acad.lsp which is normally only called when Acad starts (unless ACADLSPASDOC is set to true when it, too, loads with every drawing)

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Copy Last object to list of coordinates in CSV file
« Reply #26 on: July 16, 2011, 01:09:00 PM »
Since (vl-load-com) only needs to be called once per drawing session to load the Visual LISP extensions, it makes sense to include it in the ACADDOC.lsp and not in every program (in which every subsequent call to the function is redundant).
This is not quite correct, Lee. (vl-load-com) need be called only once per Autocad session, so it really only needs to be placed in acad.lsp which is normally only called when Acad starts (unless ACADLSPASDOC is set to true when it, too, loads with every drawing)

Thanks for the clarification Jeff  :-)

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Copy Last object to list of coordinates in CSV file
« Reply #27 on: July 18, 2011, 08:15:07 AM »
To all involved; thanks for the quick reply, the effective code, and the clear explanation of concepts involved.

TheSwamp crew is the greatest thing on the Internet!
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: Copy Last object to list of coordinates in CSV file
« Reply #28 on: July 18, 2011, 09:42:15 AM »
Since (vl-load-com) only needs to be called once per drawing session to load the Visual LISP extensions, it makes sense to include it in the ACADDOC.lsp and not in every program (in which every subsequent call to the function is redundant).
This is not quite correct, Lee. (vl-load-com) need be called only once per Autocad session, so it really only needs to be placed in acad.lsp which is normally only called when Acad starts (unless ACADLSPASDOC is set to true when it, too, loads with every drawing)

Thanks for the clarification Jeff  :-)

1+ ... I learn something new everyday.
"How we think determines what we do, and what we do determines what we get."

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Copy Last object to list of coordinates in CSV file
« Reply #29 on: July 18, 2011, 10:15:20 AM »
Wait, what?  It's Monday already?

What happened to the weekend - oh, never mind.
James Buzbee
Windows 8