Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-07-27, 01:45 AM   #1
rharris51
Member
 
Join Date: 2003-09
Posts: 9
rharris51 is starting their journey
Question Problem using (command "Insert" fname ^C) in Autolisp routine

We are trying to make an old lisp routine for automatically redefining detail blocks work under AutoCAD 2005. The following instruction now fails and interrupts the routine when it executes but does not find a matching filename:

(command "insert" fname ^C)

It's a very simple command and it still works when it finds the file it is looking for - but now it crashes the whole routine when fname is not found in the path.

It exits the lisp routine after displaying the search path and the last line displayed is *Invalid*.

Is there a flag or switch that needs to be set to make this command work the ways it did under older versions? Any workarounds or quick solutions?
rharris51 is offline   Reply With Quote
Old 2004-07-27, 02:41 AM   #2
CAB2k
All AUGI, all the time
 
CAB2k's Avatar
 
Join Date: 2002-12
Location: Brandon, Florida
Posts: 685
CAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the starsCAB2k is shooting for the stars
Default RE: Problem using (command "Insert" fname ^C) in Autolisp routine

Try this.
Code:
(if (findfile fname)
   (command "insert" fname ^C)
   (alert "\nFile not found")
 )
__________________
CAB
ACAD2K & 2K4 Windows 2000
CAB2k is offline   Reply With Quote
Old 2004-07-27, 10:22 AM   #3
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default

Just an observation. The ^C thingie should be changed to nil (^C is seen as a symbol that just happens to be nil when the call is made but it has no real meaning)
stig.madsen is offline   Reply With Quote
Old 2004-07-27, 03:45 PM   #4
mathew.worland
Moderator
 
mathew.worland's Avatar
 
Join Date: 2002-12
Location: Denver, CO USA
Posts: 150
mathew.worland has a bright futuremathew.worland has a bright futuremathew.worland has a bright futuremathew.worland has a bright futuremathew.worland has a bright futuremathew.worland has a bright futuremathew.worland has a bright future
Default RE: Problem using (command "Insert" fname ^C) in Autolisp routine

You can also try this.

(command "insert" fname \E)
mathew.worland is offline   Reply With Quote
Old 2004-07-28, 04:09 PM   #5
jwanstaett
I could stop if I wanted to
 
Join Date: 2002-02
Location: Kansas
Posts: 462
jwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of lightjwanstaett is a beam of light
Default RE: Problem using (command "Insert" fname ^C) in Autolisp routine

(command "insert" fname)(command)

this work in 2002 the 2nd (command) send the esc to autocad
jwanstaett is offline   Reply With Quote
Old 2004-07-28, 08:04 PM   #6
RobertB
Administrator
 
RobertB's Avatar
 
Join Date: 2001-08
Location: Seattle WA US
Posts: 4,393
RobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the stars
Default RE: Problem using (command "Insert" fname ^C) in Autolisp routine

Quote:
Originally Posted by jwanstaett
(command "insert" fname)(command)
this work in 2002 the 2nd (command) send the esc to autocad
That is the same as Stig's reply because (command nil) = (command)
RobertB is offline   Reply With Quote
Old 2004-09-03, 12:44 PM   #7
partha_ghosh70
Member
 
Join Date: 2004-09
Posts: 8
partha_ghosh70 is starting their journey
Arrow RE: Problem using (command "Insert" fname ^C) in Autolisp routine

You better include the folder (which contains the required file) in your "support file search path" and then run the programme.
partha_ghosh70 is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Plotting with VBA vferrara VBA 5 2006-03-14 02:41 PM
Sample AutoLISP code - what would you do different? sinc AutoLISP 13 2004-07-30 01:38 AM
autolisp in LDD om_change AutoLISP 2 2004-07-07 11:34 PM
Block insertion problem Cad4men ACA General 3 2004-06-28 03:26 PM
Problem in vla-explode method rajat126 AutoLISP 4 2004-06-23 02:40 PM


All times are GMT +1. The time now is 03:01 PM.