Thread: Error message, Help I can't figure it out!
|
Replies:
7
-
Last Post:
Mar 16, 2009 8:23 PM
Last Post By: Owen Wengerd
|
|
|
|
|
|
|
Error message, Help I can't figure it out!
Posted:
Mar 14, 2009 11:07 AM
|
|
|
|
When running a routine, the code below stops at the command "insert" line and prints the error shown below....If I re-run the code, the routine works fine... It almost acts like it is looking for input to the layer command.
Anyone have any thoughts why this would not work, then work just fine when run again? Thanks a million this one has me stumped!
;***** start of code **** (setq sstemp (ssadd)) ;**** insert lower die shoe threads **** (setq temp inspt);just for testing
(tp "in draw_top_view_balance_block tp300") (command "insert" "THX5-16-18" "non" inspt "" "" "")
(tp "in draw_top_view_balance_block tp310") (setq ent (entlast)) (ssadd ent sstemp)
(tp "in draw_top_view_balance_block tp340")
(if ent (command "change" ent "" "P" "layer" "lds" "") (notify "in draw_top_view_balance_blocks and there is no ent") )
;****end of code ****
Invalid option keyword. ; error: Function cancelled [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/Plot/Freeze/Thaw/LOck/Unlock/stAte]:
-- Bob Q Pentium 4 3.33 GHz 1GB RAM XP Pro SP2 ATI Mobility Radeon 9000 IGP graphics..... MDT 2004DX
|
|
|
|
Posts:
147
Registered:
05/22/07
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 14, 2009 11:59 AM
in response to: Bob Quinn
|
|
|
|
I copied and pasted, and looked up ssadd, which I had never used before. the code you showed has nothing I see to evoke a layer command to fail with a layer error message.
however, it looks like you have ( tp ) defined as a subroutine, maybe in a setup generic subroutine. is it possible that ( tp ) is somehow looking for some sort of layer input and not finding it?
??
|
|
|
|
|
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 14, 2009 3:56 PM
in response to: curmudgeon
|
|
|
don't think it is the tp command, all it does is print out the test point text.... and I have tried with and without the tp's in place... I am almost thinking it is something to do with the insert command, possibly it is being called in another routine, that is goofing up the variables in it or something.... I have run into problems with the text command before i.e. how you use it changes the prompts it displays, but never with the insert command... Bummer, I think I will just run it at a different time, so that it will work. not a good solution but o.k. for now. Thanks for your help! I posted earlier, and somehow lost the post, now found it, a couple people had some thoughts there, I will investigate further... Thanks again! -B
----- Original Message -----
I copied and pasted, and looked up ssadd, which I had never used before. the code you showed has nothing I see to evoke a layer command to fail with a layer error message. however, it looks like you have ( tp ) defined as a subroutine, maybe in a setup generic subroutine. is it possible that ( tp ) is somehow looking for some sort of layer input and not finding it? ??
|
|
|
|
|
Posts:
147
Registered:
05/22/07
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 14, 2009 4:38 PM
in response to: Bob Quinn
|
|
|
|
I don't mean to be a snob, except I know what is important to me. if there is the "command" command in my code, it means I am not done yet. I tell myself that there is some real benefit this way - if they change the syntax of the command in a future version I am covered.
this does not need to be true - really, I just like it my way.
but, this thing I am working on presently, it is taking every trick I know and I am having to learn more. in other words, I am in hog heaven. I need the areas of very many polygons, and I coded my own area command, which I needed to calculate the centroid. LWPOLY's do not have a centroid, and if autocad has an implied centroid, I missed it.
I guess I just want to be encouraging. doing it the hard way has it's benefit, just hard to bill for.....
:)
|
|
|
|
|
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 15, 2009 4:00 PM
in response to: Bob Quinn
|
|
|
Bob: (command "change" ent "" "P" "layer" "lds" "") Focus on this line of code. :) -- Owen Wengerd President, ManuSoft < http://www.manusoft.com> VP Americas, CADLock, Inc. < http://www.cadlock.com>
|
|
|
|
|
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 15, 2009 7:32 PM
in response to: Owen Wengerd
|
|
|
Thanks Owen, I put a (command) statement at the begining of the routine, and the problem went away...... Not sure why but it works. "Owen Wengerd" wrote in message news:6142453@discussion.autodesk.com... Bob: (command "change" ent "" "P" "layer" "lds" "") Focus on this line of code. :) -- Owen Wengerd President, ManuSoft < http://www.manusoft.com> VP Americas, CADLock, Inc. < http://www.cadlock.com>
|
|
|
|
|
Posts:
147
Registered:
05/22/07
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 15, 2009 10:31 PM
in response to: Bob Quinn
|
|
|
|
Hi Bob - I see it now. when I see command in lisp my eyes glaze over. hard to see that way. the command command is echoing input as if you had typed it. but in lisp, I don't know of a way to re-invoke the command all in one line. or, it makes sense that you would need another command in front of "layer".
anyway, glad you have something that works.
roy
|
|
|
|
|
|
|
|
|
Re: Error message, Help I can't figure it out!
Posted:
Mar 16, 2009 8:23 PM
in response to: Bob Quinn
|
|
|
Bob: The (command) works because it cancels the pending command. Better would be to fix the code so that no command is left pending. Try entering your commands manually and you should be able to spot the error quickly. :) -- Owen Wengerd President, ManuSoft < http://www.manusoft.com> VP Americas, CADLock, Inc. < http://www.cadlock.com> "Bob Quinn" wrote in message news:6142478@discussion.autodesk.com... Thanks Owen, I put a (command) statement at the begining of the routine, and the problem went away...... Not sure why but it works. [...]
|
|
|
|
|
|
|
|